Following my previous article where I explored Java, in this new post I like to start to explore Python, another programming language, very popular and at the top of the list of languages that developers love. In the Stack overflow survey, Python is the 4th language used from professional developer and the first in the TIOBE Index.
Python is a high-level, general-purpose and a very popular programming language that lets you work quickly and integrate systems more effectively. Python allows programming in Object-Oriented and Procedural paradigms. Python was created in the early 1990s by Guido van Rossum at Stichting Mathematisch Centrum in the Netherlands as a successor of a language called ABC.
Advantages and disadvantages
Python has many advantages and disadvantages as a programming language. Some of the advantages are:
- Easy to use and learn: Python has a simple and expressive syntax that is similar to the English language. It does not require semicolons or braces and uses indentation to define blocks of code.
- Free and open source: Python is developed under an OSI-approved open source license that allows it to be used and distributed freely, including for commercial purposes.
- Portable: Python can run on various platforms, such as Windows, Linux, Mac OS, etc. without requiring any changes in the source code.
- Extensive third-party libraries: Python has a large and diverse collection of libraries that provide various functionalities, such as web development, data analysis, machine learning, etc.
- Object-oriented and dynamic: Python supports multiple programming paradigms, such as object-oriented, procedural, functional, etc. Python is also dynamically typed, which means that the type of variables is determined at runtime.
Some of the disadvantages are:
- Slow performance: Python is an interpreted language that is dynamically typed, which makes it slower than compiled and statically typed languages, such as Java or C.
- Distinct nomenclature: Python has some features that are different from other languages, such as the use of underscores, self keyword, etc. This can make it confusing for beginners or programmers who are used to other languages.
- Code can become unruly in size: Python does not have strict rules for code organization, which can lead to large and messy code bases if not managed properly.
- Global Interpreter Lock (GIL) and threading limitations: Python has a mechanism called GIL that prevents multiple threads from executing Python code at the same time, which limits the concurrency and parallelism of Python programs.
- Runtime errors: Python does not check for errors at compile time, which means that some errors may only be detected at runtime, which can cause unexpected crashes or bugs.
How popular is Python?
Python is a very popular programming language in 2023. According to the TIOBE Index, which measures the popularity of programming languages based on the number of skilled engineers, courses, and third-party vendors worldwide, Python ranked first in August 2022 with a 15.42% share. Python has been consistently growing in popularity over the years, and has surpassed languages such as Java, C, and C#.
Some of the reasons why Python is so popular are:
- It’s one of the best languages when learning to code: Python has a simple and expressive syntax that is easy to understand and write. It also has a large and supportive community that provides many resources and tutorials for beginners.
- It is heavily used in the Internet of Things: Python is suitable for developing applications for small and low-power devices, such as Raspberry Pi, Arduino, etc. Python also has libraries that support communication protocols, such as MQTT, CoAP, etc.
- It is instrumental in data science and AI: Python is widely used for data analysis, visualization, machine learning, deep learning, natural language processing, etc. Python has many libraries and frameworks that provide these functionalities, such as NumPy, pandas, scikit-learn, TensorFlow, PyTorch, etc.
In conclusion, with this post “Getting started with Python”, I like to look around and learn more about this programming language. I have some new code to publish very soon. Stay tuned!