The way I walked from C++ to Python
People say that coding in Python is indeed easy that even a 6 year old can do it. This is the idea that I experienced in your mind once I started coding in Python in the office. I had been a full-time software developer for 4 years at that moment, writing mainly in C++ on Linux, heavily utilizing the QT library. However, I wrote bad Python code in the beginning.
It is often around 36 months since I've made that switch and I also genuinely believe that it is a beneficial point to sum-up the progress that I've made during this time. When looking back, I didn't only change my main program coding language, but also changed my work environment and also the way I think about code.

I won't go into the details and differences when considering C++ and Python, as there are several resources online, but rather will describe my personal experience. I really hope that this post will be useful for people going through the same transition that i did so.
C++ feels like diving into the magical mysteries of the sea - it is beautiful, but requires more learning and practice, and overall, the length which you cover isn't that big. Python is a bit like snorkeling - the truth is the sweetness as soon as you stick your face in to the water, but you don't go much further down. You keep on swimming in shallow waters, and certainly will cover a lengthy distance easily. Out of this description it is clear, that each of those languages should always be used at its right place and time.

C++ feels like diving to the magical mysteries for the sea - it is beautiful, but requires more learning and practice, and overall, the exact distance that you cover isn't that big. Python is a bit like snorkeling - you see the beauty when you stick your mind in to the water, you don't go much further down. You retain on swimming in shallow waters, and certainly will cover a long distance easily. Using this description it is clear, that every of those languages should always be used at its right place and time.
Diving into C++ and surviving it

C++ is more strict and penalizes you more harshly on the mistakes. It's not an effective coding session if you haven't gotten a surprising Segmentation fault at least one time. Therefore, it entails a deeper comprehension of the pc, the compiler therefore the language. When you go deeper, you are able to really see and stay impressed by beautiful things, like the compilation process and memory management.

As a C++ programmer I cared more about syntax tweaks and weird examples. I always knew where I allocated memory and how I was releasing it. The programs I wrote were more stand-alone when I preferred to know what was happening inside my code. The primary idea was, that code that another person wrote was less reliable, more error-prone, and could blow-up your memory usage.
One of the primary things that you ought to learn when switching to Python is just how to let go of - you don't know what is going on beneath the hood, where memory is allocated and released, and it's OK. You may be also encouraged to use code that has been published by others, packed into libraries, because it saves your time and helps you code faster. It does not imply that you ought to write code that is dog-slow and hinges on unmaintained and nonfunctional libraries, but the focus is certainly different.

Once I started coding in Python, I first wrote C++ code in Python. It worked, but i did son't gain any benefit from the language. My coding improved once I started writing in an even more "Pythonic" fashion and started using libraries, and much more advanced concepts such as generators, decorators and contexts.

As a Python developer I tend to look first for the library that solves the issue in front of you. Python has a rich library ecosystem and community that supports it. There are libraries for doing practically anything. Below are a few handy ones that I prefer every day: NumPy for numerical calculations, OpenCV for computer vision, json for reading json files, SciPy for scientific calculations, sqlite3 for databases.

My everyday tool is PyCharm (yes, an IDE) with IdeaVim plugin. I started utilizing it due mainly to the fact that it's a powerful debugger, which is much friendlier than the default Python debugger, pdb. I also use pip for installing libraries that i would like. I don't monitor my memory usage anymore unless i truly have to.

No matter what other individuals say, switching to another program coding language, especially to a language that is fundamentally distinct from the only you are familiar with, just isn't easy. Take time to learn, some coffee, to dig in, to see. But most importantly, recognize that not merely the language should change, but additionally your coding style and work methodology.

Good luck!
September, 18 / 2018

Text author: Zakir Muravyov

© All Right Reserved By Me.

This site was made on Tilda — a website builder that helps to create a website without any code
Create a website