9

I have little knowledge about C++, so I want to ask two questions from "expert" (C++) programmers here:

  1. Why Satoshi wrote Bitcoin in C++ and not in (for example) C language? any technical reasons? OOP? just a personal choice?

  2. How good is the quality of original Satoshi Bitcoin source code? I saw some opposite viewpoints about this topic on the internet; some say that it is like an academic code with low quality, some say that it is a code written by old pre-2000 C++ standard, some say it is a very secure code with high quality, and...

2 Answers 2

1
  1. As far as I know, Satoshi never gave a definitive answer on why C++ was chosen, so we can only speculate. There are existing questions on this site about that question, e.g. Why is bitcoin written in C++?

  2. Quality comes in many forms. I think it's fair to say that the original Bitcoin codebase, as published by Satoshi, was remarkably good, in the sense that it (even in retrospect) had very few bugs. However, the code was also not modern, in that it didn't have clear abstractions between the components, had no tests (that were published), and was written in a somewhat outdated style.

-1
  1. I'm not sure anybody could answer this except Satoshi. My guess would be that they were comfortable with it. There's no technical reason why C++ would be chosen over any other language, there are Bitcoin full node implementations in other languages. C++ is fast, C++ can lower development time compared to C and has some more functionality.

  2. I can't speak to this, but I can say that much of the code has changed since then, if you are using this as a proxy for the security Bitcoin provides. A better proxy would be the size of the Bitcoin network, the length of time it has been online without any major security issues, the number of eyes on that code (a lot!), and the strength of the encryption underlying it. There are many classes of security problems the Bitcoin core client could without endangering people's funds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.