Post
Topic
Board Development & Technical Discussion
Merits 1 from 1 user
Re: why was bitcoin written in C++ instead of pure C?
by
ABCbits
on 08/03/2024, 10:40:54 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/

But so far, Rust (along with other language) remain to have small popularity[1]. In addition, previously Linux kernel already switch from C89 to C11[2].

--snip--
Java is a more advanced C++. It's great for general purpose applications and of course it's easy to use and maintain. Most of the libraries you need are available in Java, so actually customization is minimal, most of the time.
--snip--

Does your statement apply to Java in general or just newer Java version? I often hear Java 8.0 or older is hated due to various reasons.

[1] https://openhub.net/p/linux/analyses/latest/languages_summary
[2] https://www.zdnet.com/article/linus-torvalds-prepares-to-move-the-linux-kernel-to-modern-c/