Now, before we even get into the idea of why I think you should learn Python, let me tell you that I do not consider myself a “god” at this whole thing. Python is probably the first language I have ever “mastered”(how much experience with something must you have before saying you mastered it? No idea.). Let me also tell you that my target audience with this text is mainly programmers themselves.
Python is a very complex language. And yet I hear a lot of people say:
“Python is easy”.
- Everyone at some point of their lives.
Those people probably don’t even know what a Pythonic code is like, they probably can’t even read pythonic code, because they don’t actually know Python, they just know — or think that they know — programming in general and when they read really simple Python code, I believe that they just think for themselves:
“Hey, it looks easy enough, so I’ll just write some code here like I’m writing C and say that I know Python”.
DON’T. EVER. DO. THAT.
You will probably just end up writing bad, inefficient Python code.
Do not write Python code like you’re writing C. If you want that, why don’t you just go and write C code anyway?
You don’t have to go very deep into Python to hear about “pythonic” ways of doing things. Those “pythonic” ways are often what we consider the most efficient way of doing things in Python.
What I love about Python is that it is very easy to manipulate data with it. That’s probably the main reason why it is one of the most if not the most used programming language in Data Science. As a programmer, you are dealing with data all the time, so this is really useful for you even if you’re not into Data Science.
I started programming back in high school through Code Academy and I was learning javascript. I didn’t go too far though. Then I messed around with Lua — which is often compared with Python. Then I learned C, which I didn’t quite enjoy, but it helped me understand a lot of things. Then, for a whole year I was a Java programmer, and I knew Java really well — thanks Kathy Sierra and Bert Bates — and was TA on OOP in Java during a whole semester in college.
But then, something really bad happened at my life, and the name of that thing is “LPF”, which in english stands for “Functional Programming Language”, which is a course at the university I study at. Functional programming is really great, I just didn’t enjoy the course. Anyway, I learned Haskell and I considered myself a Haskell programmer for a whole year — cause I had to be. With Haskell, I learned a lot of things like Pattern Matching, Higher-Order Functions, Lazy Evaluation, Lambda Expressions, etc.
After the whole “LPF” thing, when I started to actually learn Python, I started to realize that it was like a whole new world. It was like combining everything I ever studied into one language, it’s like a programmer’s paradise. If in Haskell I could write some impressive piece of software using only 3 lines of code, I could — maybe — do it using 1 line in Python. So there was no reason for knowing Haskell just because of the number of lines of code it needs to create software — which is what attracts most people to Haskell, I believe. Other than it being a purely functional language.
Now, before people start throwing rocks at me, I’m not saying Haskell is bad, I LOVE Haskell, I really do. It has a really great community, the code looks great and it’s a really powerful language. I’m just saying that it wouldn’t make sense to compare Haskell with Python just in terms of lines of code. You can write a Python solution with less lines of code than a Haskell’s and vice versa.
Python has everything you will probably ever need. It has many types of data structures in itself that I have particularly never heard before like sets and dictionaries, and at the same time some data structures I have studied from other languages, like tuples (Haskell). Those data structures make our lives so much easier, believe me. And I’m not even going to say anything about generators, decorators, all the comprehensions available and etc., which are all “new” and powerful tools you can use.
All those data structures, all the packages, all the tools, all the support, the community, the Python Software Foundation and everything combined is what makes Python my current favorite language to work with.
And, of course, I’m not saying that Python is the best language of the world and that everyone should start using Python and Python only. Use whatever tool fits best, but be aware that learning Python can be really helpful for you as a programmer.
If you are a true expert or just more experienced than me and want to correct me, or if you just feel like you disagree with something, please feel free to create a discussion about it.
Thank you for reading!