<p>Maybe yes or maybe not, that is, there is no specific reason sometimes for choosing the programming language (This in general) especially in open source projects the language depends a lot on who is part of the project.</p>

<p>Surely C ++ is a ubiquitous language nowadays, just think that java and python were born from this language.
In my opinion, in first the choice of C ++ has been given a lot since the presentation of the idiom to objects, we say that C does not have the classes it is not possible to realize many techniques that are in the everyday reality for current programmers.</p>

<p>Then just think that in 2009 all these "Go" languages were not present.</p>

<p>So my definitive answer is:
"I think that in the periods when bitcoin core was released and in the previous one in which C ++ was developed it was a reference language for object-oriented programming and it was probably better to use an object-oriented language for technical reasons. as hereditary polymorphism.</p>

<p>I believe that this code cannot be written in C above all the transactions
look here in my fork where I'm studying bitcoin core <a href="https://github.com/vincenzopalazzo/bitcoin/blob/master/src/primitives/transaction.h" rel="nofollow noreferrer">Click me</a></p>

<p>This is just my thought, I may be wrong.</p>

<p>Sorry for my terrible English but I'm learning</p>

CC BY-SA 4.0
2019-03-25T18:57:16.833Z
Bitcoin Core hardly uses polymorphism. There are plenty of reasons to prefer C++ over C (such as avoiding manual memory management).
Pieter Wuille
CC BY-SA 4.0
2019-03-25T19:01:49.977Z
@PieterWuille feel free to adjust my answer
vincenzopalazzo
CC BY-SA 4.0
2019-03-25T08:36:39.160Z
2019-03-25T08:36:39.160Z
vincenzopalazzo
<p>Why C++ and not C? Are there some features of C++ not present in C required for Bitcoin to function as it does?</p>

<p>I can see that a similar question has been asked before but I am more curious as to the specific features of C++ meaning that it was chosen for for Bitcoin's codebase instead of C (under the very large assumption it wasn't written in C++ purely as Satoshi's favourite language).</p>

<bitcoin-core-development>
Why was/is Bitcoin written in C++ instead of C?
tsujp
# Why was/is Bitcoin written in C++ instead of C?

(Asked by: username_0 on 2019-03-25)

Why C++ and not C? Are there some features of C++ not present in C required for Bitcoin to function as it does?

I can see that a similar question has been asked before but I am more curious as to the specific features of C++ meaning that it was chosen for for Bitcoin's codebase instead of C (under the very large assumption it wasn't written in C++ purely as Satoshi's favourite language).

**Tags:** bitcoin-core-development


---

## 1 answers

### Answer by username_1 on 2019-03-25. Score: 0

Maybe yes or maybe not, that is, there is no specific reason sometimes for choosing the programming language (This in general) especially in open source projects the language depends a lot on who is part of the project.

Surely C ++ is a ubiquitous language nowadays, just think that java and python were born from this language.
In my opinion, in first the choice of C ++ has been given a lot since the presentation of the idiom to objects, we say that C does not have the classes it is not possible to realize many techniques that are in the everyday reality for current programmers.

Then just think that in 2009 all these "Go" languages were not present.

So my definitive answer is:
"I think that in the periods when bitcoin core was released and in the previous one in which C ++ was developed it was a reference language for object-oriented programming and it was probably better to use an object-oriented language for technical reasons. as hereditary polymorphism.

I believe that this code cannot be written in C above all the transactions
look here in my fork where I'm studying bitcoin core [Click me](https://github.com/username_1/bitcoin/blob/master/src/primitives/transaction.h)

This is just my thought, I may be wrong.

Sorry for my terrible English but I'm learning

> **Comments:**
> **username_2**: Bitcoin Core hardly uses polymorphism. There are plenty of reasons to prefer C++ over C (such as avoiding manual memory management).  
> **username_1**: @username_2 feel free to adjust my answer  

---

