Post
Topic
Board Development & Technical Discussion
Re: why was bitcoin written in C++ instead of pure C?
by
Flavatron
on 07/03/2024, 09:47:35 UTC
I think the OP asked about C, and C++ ... not c# which is totally different. For the most part, the performance of C and C++ are almost identical in most cases if you were not to use the Object Orientated features(like  inheritance, classes, templates, and some others). C# is a high level level language and not really comparable with either of the above, it's level of abstraction is probably on par with Python.

Seriously though, try implementing a linked list or hash table in C. And then again for your second and third project. Then you will see why everyone uses STD for this kind of stuff.

There is only so much you can implement without using classes, if you don't want to fill up your program with messy structures and pointers like in the Linux kernel. It makes for an unmaintainable mess.



100%. I probably wasn't very clear in my answer, but what I was meaning is C and C++ are very much related( so much so that if certain OO features are not used, the performance is exactly the same. However you are most certainly right, and actually writing something(complex) without using OO = pain! Smiley