November 23, 2019

Why Python is the ideal programming language

The reason why alternatives to Python are widespread used by today's programmers has to do with a certain role a programmer plays. The assumption is, that a programmer is an expert programmer who has a deep knowledge of compiler technology and is able to write fast and efficient sourcecode. It surprising to see, that the Python language doesn't provide help for this task. It's simply not possible to write efficient sourcecode in Python.

The reason why Python is accepted by a newer generation of programmers as there preferred choice has to do with separating the programming workflow into two subparts: creating a GUI prototype and programming a piece of software. This two step pipeline is the result of modern software engineering which is trying to realize software design as a dedicated step. The basic fact why Python has become so popular in a short amount of time is, that it's the best Prototyping language available. In contrast to Matlab, Visual Basic macros and a pure graphical GUI prototyping tool, Python is more professional and available in non MS-Windows operating systems.

The funny thing is, that a written Python sourcecode fulfills certain needs great while other not. From the perspective of classical programming, Python sourcecode is something which can be ignored. Because it's slower than C++ code and less efficient than the Assembly language. The main advantage of a python program is, that it can be translated easily in any other programming language. Not because there are so many software tools available which can convert a “.py” programtext into a “.cpp” programtext, but because the manual task of doing so is an easy one.

Suppose at Stackoverflow it's allowed to post the following question. Hi guys, i have written a game in Python which is 10000 lines of code long. Can anybody help to convert the code into a Java program?” The interesting fact is, that a large amount of Stackoverflow users able to do so. Writing a Java program if the code was already tested and bugfixed in a Python prototype is an easy to realize software project. It will take longer than a single day, but it will take much shorter than creating the java code from scratch.

The most important part of programming is the prototyping step. If the Python code was developed, 80% of the overall project is done. Using Python as a prototyping language make sense, because it's much easier to write and bugfix code in Python. The compiler is very friendly to newbie programmers. And it's even possible to use multithreading. It's less efficient than in C++ but it works in a prototype.

The only technique which is more efficient than writing a prototype in Python is to search for code which was already written in github. Installing a program if the programmer has provided the repository in an archive is the fastest way of getting access to software. For example, if somebody likes to play a game of pong, he will need around a week until he has programmed the software in Python, but he can install and run the game with an existing repository within minutes.

Sometimes, Python is described as throw away prototyping language. The idea is, that the programmer develops a game in Python and if's ready he deletes the project folder, because the game doesn't make much sense. In reality, most of the written code is not new, and doesn't solve important problems. Many game development projects are started as learning / teaching experience. That means, somebody likes to learn programming and creates a bad programmed sidescrolling game, which isn't desired by anybody apart from the programmer itself.

Writing sourcecode and for throwing it away is not a mistake but the best practice method for testing out new ideas. The trick is to reduce the costs for doing so. Writing in the Assembly language throw away code is possible, but it will take very long. It's important for a programmer to anticipate, that even after investing lots of week into writing the code, the result won't fit to the needs.