DEV Community

Raphael Zenou
Raphael Zenou

Posted on • Updated on

Happy little accidents when learning Pt. 1

This is not the most technical of all posts but I hope it will help some of you rockstars who are learning to code as we speak.

You have opened the pandora box so massive well done but the power you unleashed is wild and taming it is key for your happiness as a learner.

It might sound totally obvious to some but here is what I think in retrospect made some coding sessions way WAY more complicated than they should have been...

PART 1 TUTORIAL NIGHTMARE

Versions gone wild

So you're following a tutorial either on video or web page and you're really excited to learn to build a cool app by mirroring a slightly more experienced dev.

It all goes well until... You just cannot get the app to run. Even locally. So you try and google the error messages but nothing matches your case. It's ok you think, let's start the tutorial again paying attention to every little detail. You do that and... Still not working arghhhhhhh.

Arghhh

Why is that ? Does the tutorial author have magic powers 儭 ? Are they hiding secrets from us ? Are they simply faking it (sneakyyyy) ?

Most likely it's another very simple reason...
儭 You are not using the exact same versions of the frameworks and libraries (aka dependencies) used in the tutorial.

JavaScript

If you are following a Javascript/Node based tutorial you really want to go through the package.json in the repo to ensure you are using the right NPM dependencies (for instance 'react' and 'react-dom' for a Frontend Client). And also you want to also have the same version of Node! You can easily manage multiple versions using NVM by the way.

Python

The same applies for Python fans out there with the requirements.txt libraries file for PIP and the version of Python or the web Framework in use if any (e.g. Django themselves.

I always assumed that when following a tutorial I just had to upgrade the software I used to the latest stable version (LTS) and everything would even go smoother than in the tutorial that is automatically using older versions of the stack.

Closing thoughts

Well some of you reading this might think it sounds obvious especially when one understands Semver but no one told me that clearly when I was learning and it made me almost lose hope sometimes.

Be safe out there and use the exact same versions of every layer of the stack in any tutorial.

That's all for today folks! Hope at least one fellow developer will find this useful. In the next part of this nano-series I will be discussing source control disasters so stay tuned !

Happy coding 扑

Discussion (0)