Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: why was bitcoin written in C++ instead of pure C?
by
Flavatron
on 07/03/2024, 09:52:26 UTC
⭐ Merited by vapourminer (1)
Because Bitcoin is complex, and complex projects are better to be programmed in object oriented programming. It also comes with rich libraries like STL, which reduce the overall chance for making a mistake, and it improves performance.

C is (usually) faster than C++, but I wouldn't want Bitcoin's source code to be a monster like the Linux kernel, even if it was slightly faster (which isn't necessarily to be the case).

True. There has been some momentum around moving the kernel over to Rust, in time.

https://www.zdnet.com/article/rust-in-linux-where-we-are-and-where-were-going-next/