First impressions of Solidity
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 BlockChain {
uint256 myNumber; struct myObject { uint256 anotherNumber;
string name;
}string[] public people;}
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:
public string[] varName;
Whereas in Solidity the visibility is stated after the type declaration:
string[] public varName;
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
- Best Crypto Exchanges in Germany | Arbitrum: A Layer 2 Solution
- Binance Trading Bots | OKEx Review | Atani Review
- Best Crypto Trading Signals Telegram | MoonXBT Review
- How to buy Shiba(SHIB) Coin on Bitbns? | Buy Floki
- CoinFLEX Review | AEX Exchange Review | UPbit Review
- 10 Best Cryptocurrency Blogs | YouHodler Review