solidity – How Much C++ is Needed to Write Smart Contracts?

assemblycontract-deploymentcontract-designsolidity

Solidity seems to be written in C++ so does that mean that smart contracts require some level of C++ programming skills to get by? How much background knowledge is required for writing a simple one or two-condition contract compared to tokenizing stocks?

Best Answer

The ("official") Solidity compiler and associated utilities are written in C++.

But Solidity is its own language with its own grammar.

does that mean that smart contracts require some level of C++ programming skills to get by?

No. You could write a Solidity compiler in any language you like as long as the output of compilation is valid EVM bytecode. Knowing the language that the compiler is written in doesn't make the target of that compilation any easier to understand or work with, unless by coincidence there are inherent similarities in those two languages.

(Is Solidity similar to C++? Not similar enough that knowing C++ would give you an advantage, other than the fact that knowing C++ means you're familiar with programming in general. In my opinion.)

How much background knowledge is required for writing a simple one or two-condition contract compared to tokenizing stocks?

Difficult to answer objectively.

Back to the original question:

How much C++ is needed to write smart contracts?

Smart contracts can be written in languages other than Solidity1. Vyper is another popular one, and one which I would argue has greater similarity to Python that Solidity does to C++.

(1 You could write smart contracts in complete gibberish, as long as you wrote a compiler - in any language you like - that could compile that gibberish to valid EVM bytecode.)

Related Topic