I’d now like to talk about some of my motivations for choosing this language.
A good start is to give some context as to why I chose Python as my main language way back when, and why I’d kept on using it.
What Makes Python an Ideal Starting Point
Like many people just learning to program, I needed something simple that would allow me to focus on learning programming logic before diving into more complex concepts.
Considering that Python is a simple, dynamic-typed and practically ubiquitous language of programming, it is very good for beginners. It also lets you learn more complex programming concepts, like functional and object-oriented programming paradigms. (But I actually think C# or Java is better for those who want to learn OO.)
Python is also great for people who haven’t quite decided on their career path. In my case, Python opened the doors to both a data science career path (it's great for machine learning) or back-end development (great for web apps).
After I settled on becoming a web developer, Python remained a good option for learning new things and improving my knowledge — but it became a limitation when I wanted to learn about frontend development.
Comparing Node.js & Python
Even though both are very good for writing scripts, there are differences in the way they’re utilized. Ultimately, Node.js has better performance and a larger ecosystem for web development compared to Python, while Python is much more applicable for scientific purposes. This differentiation was why I decided to continue working with Node.js.
Differences found when comparing the technologies:
- There are two versions of Python (Python 2 and 3), and it's quite difficult to manage both because you sometimes have to deal with conflicts.
- When using Python, environment management can be confusing since you have lots of managers — like virtualenv, pyenv, poetry and conda (the last two can also be used as dependency managers). In comparison, Node.js only gives you one good option: nvm. (You also have nodenv, but I think that nvm is easier to use.)
- The same happens with dependency management. With Node.js, it is managed by npm more simply, since npm creates a package.json file and package-lock.json (where the goal is to keep the version fixed to avoid conflicts during the installation) that installs the dependencies right on your computer. With Python, you use one requirements.txt and, to avoid the global installation in your computer, you have to access your virtual environment.
- With regards to patterns, Python has more well-defined guidelines compared to Node.js. Node.js seems to lack official guidelines, so the same thing can be made in different ways — which can be annoying and confusing for someone coming from other programming languages.
- One of the most annoying problems caused by bad code design in Python is the issue of circular imports. I haven’t seen this happen on Node.js; its imports are more flexible, allowing you to import things from different places without that concern.
- What caught my attention most when I was writing Node.js is that it is naturally asynchronous using async/await and/or Promises (once again, a lack of patterns), something that — for someone coming from a synchronous programming language — can be a little challenging. However, you can write asynchronous code in Python as well using lib called asyncio, or with another lib called aiohttp.
There's no perfect programming language. They all have pros and cons in relation to each other, and it is up to us developers to decide which fits better to solve the problems that we want to solve.
It's common to see some developers show resistance to working with new programming languages which they don't yet understand very well. It can happen that they don’t take the time to understand the language’s purpose because they’ve gotten used to a certain stack. But this kind of thinking is somewhat unproductive because programming languages are like tools — and you can't use a hammer to saw wood.
What To Consider When Switching Languages
Given the discomfort of moving to a new stack — learning all of its peculiarities, how things fit together, how to apply all previous knowledge to new scenarios — it’s good to be surrounded by experienced people you can learn from.
In my case, I looked for a place where I could grow with the help of my colleagues, on real-life projects. I also made sure to keep in mind that, despite my previous experience, this transition would not necessarily be easy. This mindset kept me patient and motivated.
When I came across STRV, I immediately identified many parts of myself and the things I was looking for fully rooted in the team. I saw that I would have the basis I needed to make this transition since, in addition to providing a lot of content for study amidst great professionals, STRV came with a culture of knowledge exchange stemming from its team of people from all over the world.
I also knew that STRV would very likely make life as a whole a little more asynchronous for someone working from another continent. And so far, so good!