First impressions of Solidity

Gavin Maselino
Coinmonks
2 min readMay 26, 2022

--

Solidity language image

Coming from a background of working with both loosely-type and strongly-typed languages, my first thoughts on Solidity were really, really positive.

Super quick recap: Solidity is the language used to create blockchain contracts.

The structure and syntax in Solidity feels very familiar, even with different keywords.

So taking the example contract below:

Contract keyword: Akin to Class keyword in JavaScript or C#

unint256 myNumber: In this case — a variable within the Class.

struct myObject: Same syntax in C#. Similar concept in JS is an object literal.

People[] people: An array (dynamic at that), again also found in JavaScript with same syntax. In C# this would produce an array but of course they need to be a fixed size.

The only interesting difference is the member visibility. In Typescript/C#, the visibility is stated before the type declaration. So for example:

Whereas in Solidity the visibility is stated after the type declaration:

There’s lots more in the language syntax and structure — I’m still working through as I build stuff out!

But if you’re interested in blockchain, but unsure whether you can absorb yet another language, I highly recommend diving in, even for an hour or two and have a play :)

Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing

Also, Read

--

--

Gavin Maselino
Coinmonks

Full stack Senior Test Engineer with a love of learning. Currently filling my head with all things Blockchain.