Why was/is Bitcoin written in C++ instead of C?

I don't know what Bitcoin required but generally speaking C++ has lots of features C doesn't.
Why should anyone use C when starting a project from scratch?
A choice like that is usually made based off pros and cons listed by the team members and evaluated by the high ranking folks involved.

why not write it in C? Maybe that team did not know C as well. Maybe they wanted modern features of object oriented coding. Maybe there was some library they wanted that did not come in a C flavor. It could be any of hundreds of reasons.

There is nothing that can be done on a computer that cannot be done in assembly, C, and C++. the same is true for most but not all languages. The question comes into how much trouble it is to do it, not whether it can be done. The amount of effort is tied to many things but the big ones are usually {team's knowledge of that language, available libraries and cost thereof, difficulty in expressing the concept (for example, c++ can be annoying to talk to databases compared to python, but its an order of magnitude faster at processing), performance concerns, existing codebase at that company (reuse of common items)} and things of that nature. Clearly bitcoin wants performance to solve their equations for the tokens, but the rest of it apart from the token searching could be in any language. The difference in C and C++ for performance is microscopic esp for number crunching tight loops.

Maybe a better question is, why do you ask? Why would you expect it in C?
Last edited on
Last edited on
Topic archived. No new replies allowed.