DEV Community

Loralighte
Loralighte

Posted on

Should You Use Python? 5 Pros and Cons.

Python is the most used and loved programming language in the world. Is this a good thing? Well yes and no. See, there are tons of pros and cons. I will be focusing on five pros and cons that I feel are most important to new users of the programming language.

1. Syntax

Pro

The syntax is easy and simple to understand. Python's syntax is easy to grasp, and you get cool abilities like for (i in array): over C's for (i=0; i < sizeof(arr)/sizeof(arr[0]); 1++){ which is positive in many ways.

Con

You can argue the syntax is simple and easy, but is it efficient? No. For much more complicated apps, a simple indentation error will be the semicolon-like boot up your butt. The indentation will add slight bloat as they count in the final app size, which can suck for massive software if you are an absolute minimalist like me.

2. Interpreted, not Compiled

Pro

This means the language, as long as it is supported on a platform (which we will get to later) then you will 100% be able to run the script. Doesn't matter what CPU architecture or operating system you use. A Python script using version 3.8 will work the same on a Raspberry Pi running FreeBSD as an i386 CPU laptop running Debian and a Windows 10 desktop computer from 2020.

Con

This really makes it incompatible with some forms of applications. Some basic desktop applications and scripts work well with such a language, as more often than not the speed difference won't matter as much. Interpreted languages are slower than compiled, but do have a solid reason to exist. As long as milliseconds of slowness do not matter to you, this is not an issue.

3. Operating System/Platform Support.

Pro

Python supports almost every single operating system. CPython, the interpreter for Python is also open-source meaning many operating systems can have a version of Python on their operating system.

Con

Python also supports operating systems officially, and is willing to drop OS support at the drop of a hat. This can be devastating for the OS developers who might even shut down the project because they randomly got a metric butt ton of extra work to do. This is a real threat targeting the Solaris and maybe soon the BSD families.

4. Libraries in PyPI

Pro

The Python Package Index holds hundreds of packages and libraries. It is the go-to site for installing packages for Python. Basically think of it like Python's NPM. It is supported by the Python Software Foundation, but it is separate from Python's development.

Con

Making your own libraries is weirdly difficult, while the documentation is good enough it can be a pain. Also it might be problematic if PyPI gets DDoSed at any point in time.

5. BDFL

Pro

Benevolent Dictator For Life is a term all but invented by the Python community. It is a god-send idea for open-source as it keeps projects with a single idea instead of committees which kill projects. Basically there is a manager, but the software is still open. Same idea applies to the Linux kernel.

Con

This can mean the project is narrow-minded at times. While not always an issue, this can slow down development and rolling out of new features. Not an issue in Python necessarily, just a general problem with BDFL.

Conclusion

Should you use Python? Well, it depends. This article was a small list of items with pros and cons for Python. I personally get sick when using Python, and don't recommend it, but then again I am more biased than the Commission on Presidential Debates on what parties can debate.

Top comments (5)

Collapse
 
tizz98 profile image
Elijah Wilson

Imo, you should choose the right language for the project you're working on. Python is great for building web applications and data science and even command line applications. However, a compiled language like Go may have advantages when writing and distributing a CLI since all the dependencies are included in the resulting binary.

Collapse
 
waylonwalker profile image
Waylon Walker

Making your own libraries is weirdly difficult,

I want to say I agree, but I dont have another language that I am maintaining any packages in, so I have nothing to compare to.

The best advide I have is to start with a template or copy things like setup.py from a working project.

Collapse
 
waylonwalker profile image
Waylon Walker

What language do you prefer over python?

Collapse
 
kailyons profile image
Loralighte

Personally, I am into V.

Collapse
 
shadowjonathan profile image
Jonathan de Jong

Re: BDFL

I think they half-dropped this idea by now, because guido is retired/in the background atm, and instead of BDFL, they have adopted the idea more of a "guidance board"