Python is great, but stop using it for every damn project.
Recently, I saw a discussion on Reddit about why someone would opt to use Python over other programming languages. The discussion was pretty good so I decided to write a post about it.
First of all, let me give you my thoughts on Python. This is a programming language I love and it can be used in a wide variety of applications, though I agree that all languages have their faults. I do believe it’s a great language for professionals to use, and also for beginners to enter the fascinating world of programming.
With that said, would I use Python on every single project? Probably not. But there are some areas where Python excels, and I want to highlight those, and explain why.
- API Development
- Data Science / AI
Now, let’s review them in detail.
There are some excellent frameworks for API development with Python and, among those, these are the two favorites among the development community: Django and Flask.
The conversation around API development immediately went into the direction of web frameworks. Why? Well… I don’t believe that you should write your own web server or framework when you want to focus on writing the code for your API.
Some people also argue the use of Python for web development, though I don’t like to use those frameworks for the front-end part, and I prefer to build front-ends using React, VueJS, or Ember.
If you are getting started with API development in Python, it’s likely you will end up using either Django or Flask. So you may ask: which one should I use?
Django VS Flask
Both of these frameworks are great and will work for most situations. However, they follow different philosophies. Some people like one more than the other, and there are good reasons on both sides. Since both of these frameworks are so different in essence, I’ll only give you the high-level differentiation between the two, but you should definitely read more about them before deciding which is the best for you and your project.
Flask is a minimalistic framework. It provides simplicity, flexibility, and fine-grained control. It is very unopinionated (you can do whatever you want with it).
Django, on the contrary, is an all-inclusive framework. You can get libraries, admin panel, db interfaces, ORM, and even a solid directory structure for your apps out of the box.
If you want to learn more about this, here is an interesting article I found:
Data Science / AI
Any time you want to work with data, from scraping, data analysis, visualization, machine learning , or AI, Python will be your best friend. There are a number of important libraries for each one of these tasks, and they are great libraries, highly used in research and production environments.
I’ll not go into details of the libraries, but I want to mention a few: Pandas, Numpy, Matplotlib, Seaborn, Tensorflow, Pytorch, scikit-learn, Keras, NLTK, OpenCV.
Thanks to these libraries, you can build production-ready projects in almost any Data Science or AI topics. Though there are some drawbacks of using Python for some of these applications (such as performance), for many situations it will make for a great selection.
What kind of projects are we talking about?
There are many applications of Python for data science and AI in general. I’ll mention here a few common projects for which Python is used for:
- Time series analysis
- Sales predictions
- Language processing
- Sentiment analysis
- Recommendation systems (like music, videos, etc)
- Computer vision
- Self-driving cars
Scripting usually refers to small programs (usually executed through command line) that are designed to automate simple tasks.
Python is a very versatile programming language and thanks to its community and libraries you can pretty much do anything you want with it, though sometimes you shouldn’t. There’s no one language to rule them all: they all have advantages and disadvantages, and Python is no exception.
With that said, I do believe Python is great, and if you are curious you can build from games to embedded systems. Probably, those cases won’t be production-ready projects, but I may be wrong. If so, please let me know, because I’d like to hear about it.