1

Why Work in Blockchain? — Journey from C++ to Rust Developer

 3 years ago
source link: https://medium.com/centrality/why-work-in-blockchain-journey-from-c-to-rust-developer-eddbc9ccdc3d
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Why Work in Blockchain? — Journey from C++ to Rust Developer

Image for post
Image for post

Blockchain has to be one of the most exciting developer opportunities on the planet. As a field still in its infancy, there is so much potential for passionate and dedicated developers to carve out new ground and get creative in a revolutionary space.

But as with all new and complex fields, blockchain requires learning new skills. On the CENNZnet team, the transition from developer to blockchain developer is a common experience. Many of our talented developers have taken (and survived!) the big leap from normal development into the blockchain world, learning the new languages and skills required. So why do they do it?

We checked in with Senior Dev Alex Sedighi to learn about his journey and offer some tips to up and coming blockchain developers.

What drew you to working in blockchain?

I got an invitation to apply for a development role. At the time I had heard about blockchain, but it had never drawn my attention. I saw them simply as an attempt to make true decentralised digital currencies. What I was missing at the time was their huge potential and the range of solutions they can offer.

I learned later through my own research, that digital money was only one (and maybe one of the hardest) of a series of applications that could be made possible only through blockchain technology. I became fascinated by the decentralised governance solutions; dApps not owning their user’s data, trustless permissioned sharing of data etc.

The other aspect of the role that was exciting to me was Rust. As an experienced C++ developer, I tend to prefer strictly typed languages. However, before Rust, modern C++ had no real rival. I knew Rust was the most beloved language among developers and really wanted to give it a go.

What new skills did you need to learn to work in the blockchain space? How did you go about learning these? Was it a tough journey?

Learning Rust, though very pleasant, takes a bit of time. I had the opportunity through my role to work on real-life programming solutions and issues in Rust, while simultaneously learning the theory from the Rust Book and Rust By Example. I would spend nearly one hour after work learning Rust.

However, Rust is not the only thing you will need. Learning the blockchain concepts is also a must. At Centrality.ai we use “Substrate” from Parity Technologies. Substrate is written in Rust in a super generic way and uses Rust’s advanced macros substantially. These were the other hurdles that I had to leap over to be able to become fully productive. It has been a challenging journey, but one which I’ve really enjoyed!

What do you use Rust for on a day to day basis?

On the CENNZnet, we use Rust for the blockchain core, or in other terms, for the software of our blockchain nodes. This is where the blocks are being generated, smart contracts are being executed and the consensus and governance protocols are running. For the interface and UI we use Typescript and React.

What makes Rust your language of choice?

Rust offers zero-cost abstractions and assumes the best practice design and development guidelines as defaults. Programmers only need to be explicit when they have to digress from the best initial choice. As a result, Rust is very fast and memory-efficient, while also very reliable. Rust also doesn’t have a garbage collector, which means there would be no indeterministic incident (caused by the language) during the runtime.

These characteristics make Rust an ideal choice for blockchains where reliability and efficiency matter a lot. The other advantage of Rust is in its pretty straightforward compilation to WASM, which is a very efficient platform-independent assembly. Substrate keeps its modules and smart contracts hot-pluggable through keeping and running them in WASM format, where a native format is not yet available. This has provided a self-upgradability solution for the chain.

What do you wish you had known as a new Rust developer?

I actually presented the following slides in an Auckland Rust meetup in an attempt to share my learning experience with the community: Rust Common Pitfalls.

The root cause for some of those pitfalls, in my opinion, is that there are some syntax similarities between C++ and Rust, which is both a good thing and a bad thing. It’s good because it helps you to start quickly if you know C++. It’s bad because it may hinder your learning process. Initially, you will want to follow your C++ assumptions, but after many challenges, you will realise how fundamentally different the two languages are.

What do you love about working on the CENNZnet blockchain?

CENNZnet, in my opinion, has chosen the best available platform and bleeding-edge technology, but a very promising one for its development. With CENNZnet, we are not going to reinvent the wheel. This helps us to be focused on our own unique values.

The other advantage of CENNZnet is the fact that it’s already got users and real-world applications such as Sylo. This means we cannot be blind to the practicality of our solutions. We have learned quite a bit from this process and we are in a very good place to deliver first-class solutions.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK