Why is Python a bad choice for a first programming language?





Since I lead several technical groups and chats, I often came across a question from subscribers about which language is the best to start learning programming and computer science. Very often, someone advises Python. I fundamentally disagree with this advice. I like this language, and I have nothing against it, it is simple and convenient. But there are some arguments against putting it in the shoes of your first programming language. I'll make a reservation that everything said below is the subjective opinion of the author and does not pretend to be true.

So why ...



Below in the picture I gave an example of how you can process a matrix using a small function and return the structure corresponding to the transposed matrix.







Matrix transpose is an operation on a matrix in which its rows and columns are swapped. Anyone who has already begun to study analytical geometry (linear algebra) faced this simplest problem. Sometimes this task is given in computer science lessons as complex tasks for processing two-dimensional arrays, which we call matrices. Well, some may find it quite simple. However, for most beginners and people who are not familiar with programming, understanding what a two-dimensional / multidimensional array is is not an easy task. Believe it or not, there are many very tricky multidimensional array processing tasks that even an experienced developer will have to think about.



But back to our (more or less easy?) Problem about transposition. As you can see, in Python, a problem can be solved in just a couple of lines of code. And all this thanks to sophisticated built-in functions and methods that greatly facilitate your thought process. As a result, when you program in Python as your first language, you put on rose-colored glasses and start thinking that programming is easy. There is some truth in this, and there is a huge catch in this.



There are other languages, at a lower level, that will help you understand depth, understand the base, understand structure, take off your rose-colored glasses, remove syntactic sugar, and think about things that you previously took for granted. What is the conclusion from this? If you want to learn to think, to really understand how iron works, then it's best to start low. Therefore, it is more useful to start with Assembler or C.



First , it will give you a better understanding of how the processor and peripheral electronics work in your PC.



Second , you will begin to understand the error messages in the operating system.



Thirdly , subsequent high-level languages, based on a solid foundation of low-level foundations, will seem to you more transparent and understandable to use.



I think there are many more advantages to starting from a low level. Often, people who study Python, out of habit, include a bunch of libraries in their code for the sake of implementing some simpler functions. It is logical to assume that this greatly burdens the code and makes it slow. And if you also remember that even effectively written python code is about 1000 times slower than similar code in C / C ++, then imagine what kind of performance you will get in the end. Of course, not all developers need to write software that works in real time and requires instant responses with minimal delays. Not everyone needs to write AAA games.



However, pay attention to the current software situation. If earlier you needed an 8-bit processor to launch a satellite into space, now we have several tabs in the browser with a 2-4 core 64-bit CPU slowing down. So maybe the reason lies in the developers, and not in the "weak" hardware?

The earliest spacecraft found, which did not contain medium-level microcircuits, but a monolithic microprocessor (8-bit RCA 1802), is the Magsat satellite, launched on October 30, 1979.
In conclusion, I would like to say that all programming languages ​​are great achievements in the IT field. But in order for us to become real professionals and experts, we still have to find out where it all began, remember the origins, mathematics, algorithms, assembler and even electronics and physics. All knowledge should be woven in your head into a single picture, into a strong logical chain. The latter will be able to be built only when we start from the root of technology, we start from the lowest level.



Write in the comments if you agree with this idea? Or do you take a different approach?



All Articles