Published in November 28, 2020

Python Programming limitations

...and Why it Comes at a Cost for Beginners

python-programming-limitationImage via pexels

Python is a versatile and easy language to learn. Its versatility and ease in programming has made it a general choice in the software industry.

In this article, I mention a few limitations of Python and the bad practice that it skips on as a programming language. The essence of this article is not to bash Python as a programming language( It’s actually my favorite language after JavaScript), but to highlight some of its shortcomings and to educate beginners on researching before learning any technology just because it’s a trend in the industry.

1. Python is Dynamically Typed

Although objects type are created dynamically, thus saving the programmer’s time, it’s a bad practice for beginners to follow. Programmers should always know the type of object they create. Not only does this make your code more readable and robust, but it helps type checkers and linters in catching errors.

2. OOP Encapsulation is Vague

Object classes in Python does not support encapsulation by specifying the public, private and protected keyword. By default, all members of class are public. They can be accessed outside of the class. To specify protected and private members, Python programmer are expected to follow the “pythonic” way of defining such class members by prefixing their names with a single or double underscore __. This is suppose to emulate the behavior of protected and private class members, but does not prevent access to and modification of instance variables. The responsible programmer (how many beginners are responsible?) should not access and modify instance variable prefixed with _. Likely, instance variables and methods prefixed with double underscores __ should not be access or touched outside the class.

3. Incompatibility of Versions

When I started out with Python. I didn’t know which version to pick and learn as they are two versions of the language: python 2.x and 3.x. Python 2.x is legacy version and the support for it halted as of January 1st 2020 and 3.x is the current version, systems legacy programs still use python 2.x. Also, there is compatibility issues with version 3.x when moving legacy code from 2.x.

This shouldn’t be much of an issue as the support for 2.x is over. More programs and system will support version 3.x overtime. Beginners should learn Python 3.x.

4 Python is Slow

Python is a slow language by default because it’s an interpreted language. python does not perform well in speed when compared to other general-purpose languages like like C/ C++, Java or Rust. Beginners that jump unto python for embedded systems and the sorts may find ease, but not speed. Fortunately this can be fastened by creating and using a custom runtime, instead of the default runtime built for the programming language. Beginners aren’t equipped enough to build their own custom runtime.

5 Frail Mobile Support

Although python is strong in the desktop and server environment, it is a weak language for building mobile programs. Programmer’s cant easily use Python in building apps for mobile platform like Android or iOS. Available frameworks for python mobile development incudes Kivy, PyQT and Toga. Beginners that hope to use Python’s versatility and fewer lines of codes in mobile app development might be disappointed.

6 Requires Additional Testing

Programs should be tested regardless of the programming language used, but with Python additional testing is needed just to be sure everything works as expected. This is as a result of lack of static type checking in the language. Dynamically typed languages like Python may come with brevity and simplicity code, but do you know what they also come with? Runtime Errors!

Python has errors that only show up during runtime. The only way to be sure and confident in a Python program is by testing it.

7. Memory Consumption

Memory consumption happens when a programs objects are available and active in the RAM during execution time, especially when there is restriction on the total count of memory available.

Unlike other general-purpose languages, Python does not necessarily release memory back to the OS. It uses an object collector to store chunks of already allocated objects for future use. This is why Python is avoided when building memory-intensive programs because of the flexibility of its data types.

8 Program packaging is bumpy

Packaging python programs can be a pain. Python is a general purpose programming language. It can be used in many fields. from web development, data science, industrial automation, to game development. It’s this flexibility that makes packaging rough as they a lot of ways to package a python program.

Programmers are encouraged to think of packaging from the start so as to avoid the bumps ahead. Even professional programmers still catch up with the bumps. How much more the beginners?

Summary

Let’s do a recap of what has been covered.

  • Python is Dynamically Typed
  • OOP Encapsulation is Vague
  • Incompatibility of versions
  • Python is slow
  • Frail Mobile Support
  • Requires Additional Testing.
  • Memory Consumption
  • Program packaging is bumpy

Hi, my name is Romeo Peter. I'm a self-taught software developer and blogger --- I build web application, and automate business processes. I don't know it all, but what I do know, I manage to share for others to learn.

Follow me on Twitter. I share my thoughts there.

I'm available for work. Contact me to work on a project or work with you. I usually get back immediately.