Substrate Programming Starter Guide

Juan De Souza
6 min readNov 15, 2021

--

Image by — Crash Course Computer Science

One of the biggest problems that refrains Web3 from expanding is the lack of human resources able to build the decentralized world that hundreds of cryto projects are already envisioning. A few days ago, Sam Elamin, Data Tech Leader and Substrate developer, started an initiative to help to expand the knowledge on Substrate(Polkadot framework) programming. A lot of people got interested, but soon most of them got discouraged when they discovered that one cannot simply start programming Rust and Substrate from zero, with no previous knowledge on programming.

At the same time, it is very difficult for a top level developer to take a beginner by the hand from zero, because this kind of professional has been in a top level environment for so many years that they end up getting a little disconnected with the needs of a person who is not a programming literate yet and wants to start from the absolute begin. I saw this gap and I thought that I could help to fill.

In this guide, I’ll leave to you the steps that, for me, is the best path that will get you prepared to be able to start your studies on Rust and Substrate development.

*This guide is aimed for complete beginners who want a strong solid base on programming before going to Substrate tutorials, but some people might consider it unnecessarily long. If you feel you’re tech-savvy enough to start programming the blockchain, or you just feel you are capable of doing so, you can go straight to the bottom of the page and start taking Rust and Substrate tutorials, and join the Telegram group: https://t.me/substratedevs. If you come to find it’s been too harsh for you, come back to this guide and start from the beginning.

Everything starts with Introduction to Computer Science and, in this matter, no one has ever done a better job than Crash Course. You won’t code anything yet in this course, so just relax and watch. We’re only heating up!

Crash Course Computer Science

Now you’ll need a text editor to start playing with code. I recommend VS Code. I don’t know if I can say that it is industry standard, but taking from what I see, I consider it this way.

Visual Studio Code Crash Course

HTML and CSS are not programming. The first is markup language and the latter is style sheet. But it is the abc of web pages, so it’s very important that you at least are able to understand their basic structure and properties. The best source for learning HTML, in my opinion, is HTML from MDN and HTML from W3Schools. Just be careful that on W3Schools there’s a section called “HTML APIs”. This is not HTML, this is advanced JavaScript. Be aware to only look at this after you have gone through a JavaScript course. For CSS, best source is CSS from MDN, CSS from W3Schools and Responsive Web Design from freeCodeCamp. Just, please, don’t waste much time writing HTML as you were going to use it everyday, or trying to know by heart all the CSS properties at once. HTML is the only section of this guide that you are allowed to rush and go ahead. We already have front-end frameworks like React that generate HTML automatically. The necessity on taking all the 3 courses on CSS depends on your goal on development. If you plan to be a pure blood back-end developer, read only one and go ahead. If you plan to be a full-stack developer, I would recommend that you read the 3 sources about CSS. Although it’s about the same subject, the 3 websites have very different teaching styles and pretty much complement each other.

After the fundamentals approach, it’s time so see the Introduction to Computer Science from a more programming perspective and start diving a little bit more into coding.

CS50 — Harvard University’s Introduction to Computer Science

The best way to start to understand about programming languages is comparing the basic structure of the most used languages and discovering the common patterns that exist among them, and how each one finds its way to express its own features. In this computer programming tutorial, you’ll learn the basics of Java, Python and C.

Computer Programming Tutorial

From now on, you’ll start writing code with more frequency. You can save the code in your computer, but if you want to start looking like a professional, you’ll have to start using Git and sending the code to Github, so other people can see and work on the code along with you. If you’re planning to be a Substrate developer, you’re probably going to work with people that are in different parts of the world, and you’ll need this tool so everybody can work on the same code together.

Git Tutorial for Beginners: Learn Git in 1 Hour

Git and Github for Beginners

Now it’s time to start diving into JavaScript, but you need to have in mind that, since you’re aiming to be a Substrate developer, your goal is to use TypeScript, and not JavaScript. “Why do we need to study JavaScript then?”, you’re probably asking. TS is a superset of JS, it is built over JS. It means that everything that works for JS will work for TS also. So, generally, when you find a course or a tutorial about TypeScript, it will take in consideration that you already know JS and will only talk about the features found on TS that don’t exist on JS. But before diving into JavaScript, take a look at this short video: TypeScript — The Basics, it will help you to have TS in mind when you are taking your JS tutorials. We’ll dive deeper into TypeScript later on, no worry.

From my experience, the best sources that are out there for beginners to learn JavaScript are: MDN, javascript.info(part 1) and freeCodeCamp. MDN has high quality content. javascript.info has great exercises to practice on the bottom of the page of each topic. freeCodeCamp has an amazing algorithms section.Taking these three courses together you’ll have a very complete learning experience on the subject.

JavaScript from MDN

JavaScript Algorithms and Data Structures

javascript.info (part 1)

Hope you have survived the freeCodeCamp’s JavaScript intermediary algorithms and your brain is able to continue our journey.😅 As I said before, as a developer on the Polkadot Network, you’ll use strongly typed code, not loosely typed like we have in JavaScript. If you take a look at the Polkadot.js website, you’ll find: “interfaces should have full type definitions.” Sooo… We better start diving into TypeScript:

Learn TypeScript — Full Course for Beginners

TypeScript Handbook

Independently if you are a Windows or Mac user, sooner or later you will have to deal with a Linux machine/terminal, be it in a VM on VirtualBox, be it in a Docker container, so it’s essential to be a Linux literate.

Introduction to Linux

Configuring Linux Web Server Basics

Now it’s finally time for us to program the back-end and start having more control over the data and the network. Node.js is more coupled with Substrate because the Polkadot front-end templates or dapps use Node. So let’s go:

Back End Development and APIs

Node.js and Express.js — Full Course

Build a Restful API with Node.js, Express.js & TypeScript

How does the Web work? As a web developer, it’s handy to know a bit about the TCP/IP stack, IP addressing, DNS, and other protocols that underlie the Web technologies you use. Under the hood of HTTP there’s a whole stack of networking protocols. Let’s explore the underpinnings of the net with tools like traceroute, tcpdump, and nc.

Networking for Web Developers

Wow! We finally arrived to Rust! It means you are with one foot already inside Substrate development…

Learn Rust

Rust Crash Course

Now it’s time to learn a tool that is becoming industry standard and makes development predictable and efficient. Docker accelerates how you build, share and run modern applications.

Docker — Get Started

Docker for the Absolute Beginner

According to Polkadot website: “code should be comprehensively unit tested with Jest.” So now it’s time to take a look on these topics:

Jest Crash Course

Jest Docs

You have already watched a tutorial about Git in the beginning of the guide. I didn’t add the Git book there because there are things that only make sense for advanced programmers to learn when they are already working with a team. So it’s time to enhance your Git skills:

Pro Git book

And you’ve made it! Congratulations! You’re ready to start your studies on Substrate development. Now go to https://docs.substrate.io/ and check the tabs “How-to Guides” and “Tutorials”. And join the Telegram group “Substrate developers” to receive proper orientation on substrate learning: https://t.me/substratedevs

You can find me at:
Twitter
Minds
Telegram

--

--

Juan De Souza

I’m a Full-Stack Web Developer who loves all the technologies that help to increase individual freedom