3

I am new to the ethereum space, and though I can code in C and C++, I keep noticing in the docs that there are references to Javascript and node.js and how similar it is to solidity as well as multiple use cases where they are used alongside solidity. I know nothing about either, and I'm wondering if it would be useful to put in some time to learn the basics before I get started with solidity? Any thoughts are appreciated.

3

Solidity's syntax has some similarities to JavaScript, and a large amount of tooling has been written in JavaScript. However, I would not say that knowledge of JavaScript is an absolute prerequisite.

ethereum.org maintains a list of language specific resources that you may find useful: https://ethereum.org/developers/#language-specific-resources

3

I teach and develop courseware for B9lab.

There is no absolute requirement for JavaScript knowledge and I would argue that similarities between Solidity and JavaScript are superficial. There is much to unlearn, in any case, because blockchain platforms are unlike any other form of software regardless of syntax.

External to the blockchain there is always a client, which could be a server, a web client, mobile device or something else. There is no restriction on that, but, as it happens, JavaScript is a common element for Web clients and node servers and unsurprisingly, there are libraries like Web3 that sort of lead the charge.

Consequently, familiarity with those is helpful for constructing clients.

We take many students who are in similar situations and recognize that smart contract design is indeed a specialization. There will probably be other specialists who will build the UI and other external concerns for any serious project.

As such, we teach survival-level JavaScript for those who don't arrive with that skillset. The goal is to equip the Ethereum specialist with enough know-how to transfer skills to the UI team so they can learn to work with Ethereum. In case that isn't clear, imagine the smart contract designer leading the meeting in which the React, node, whatever, team discovers what they need to know to interact with the system. It requires just enough know-how to frame the explanations in terms they will understand without presuming to take over where they know best. Think about loading dependencies and showing minimalistic examples and describing the way the flow has to be.

Non-obvious implications of immutability and designs that rely on incentives are sources of serious error for teams that maybe don't have a strong grip on it, so a specialist who can raise oversights and hidden assumptions helps keep things on track. There is much to do without necessarily getting deep into JavaScript.

Hope it helps.

0

I agree with the previous answer: knowledge of JavaScript is not an absolute prerequisite. But I don't think it's any kind of a prerequisite.

Solidity's syntax is inspired by JavaScript. But if you know any modern programming language (and the thought patterns required in coding) it helps a lot more than just learning JavaScript syntax. After all Solidity is (almost) just another coding language and the most important thing is to be able to think like a coder.

So it won't be difficult for you to learn Solidity with a C/C++ background. The most difficult part will be understanding the environment in which Solidity operates: Ethereum and its consensus mechanism. And learning JavaScript wouldn't help you with that in any way.

As a learning resource/tutorial I suggest https://cryptozombies.io/

1
  • Thanks for this reply. Will check it out – Mitch Ostler Jan 11 '20 at 20:30
0

For some reason people in this space like to say solidity is javascript-like. I suspect this is a bit of marketing, as clearly web devs are a targeted demographic.

What I've found is that syntactically solidity is more like Java, which perhaps shouldn't be too surprising as Javascript syntax is based on Java's (as part of another marketing ploy by Netscape).

With its visibility keywords (private, internal, etc.) and its fine-grained types (with primitive and reference types), solidity just feels a lot more like Java.

Update (May 2020): Solidity documentation now starts with the intro: "Solidity was influenced by C++, Python and JavaScript" <-- I think this strongly implies the comparisons to JavaScript are exaggerated.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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