It’s no secret I love Python as a coding language. I love Python for writing complicated programs, I love Python for data science, I love Python for research – I even love Python for writing ridiculously lazy code to help check my emails.
Python is the main language I have coded in for the past 3 years, and it’s the language that is solely responsible for my successful career as a programmer and data scientist. Because I owe so much to Python, I thought I’d sit down today and sing its praises from the rooftops. Basically, here are nine reasons as to why Python is (seriously) the only programming language you’ll ever need.
1. So Easy to Read
Python is incredible well structured, optically pleasing, and just overall basic in the best way. It doesn’t use complicated programming words (ie. “malloc” and “pointer” from C++).
>> Honestly, can you even begin to guess what ‘malloc’ could mean? <<
The best part about Python is its simplicity; it doesn’t try to be fancy, it doesn’t try to be difficult. It’s very similar to typing in English or some form of cool ‘abbreviated English’.
Can you guess what this does?
Good job! You just read Python. Wasn’t so hard, now was it? Python is kind of like a buddy who talks in abbreviated slang and doesn’t like to use too many words. He’s a get-to-the-point kind of guy.
Not only is it easy for you to read, it’s also easy for others to read and understand, which makes it prime real estate for code-sharing. You’ll see Python code from someone else and be like ‘Ah… I can kind of understand what’s going on,’ instead of like ‘Dude, what?’
>> Something that takes 20 lines in Python can take 100 lines in Java. <<
Another reason why Python is just too good is that it’s so efficient. It doesn’t take 60 pages of code to write a program that runs in Python. (Honestly – I don’t need that kind of stress in my life. Do you?)
Just to give you a concrete comparison of how other languages work: In Python, you don’t worry about allocating memory. If you want to save something, Python allocates the memory for you automatically. In C++, you have to manually ask your computer to find memory. When you have to get down to the nitty-gritty and include every small detail, you end up needing a lot more code.
As a comparison, Python is kind of similar to how our brain works – it does specific things very automatically. Imagine if our brain worked like C++ – how crazy complicated would that be? If you met someone, you’d have to stop and ask your brain to not only find the memory space, but also tell it how much memory you need to use to remember this person.
Python is simpler! You don’t worry about the entire computer architecture, and you can just focus on coding and developing.
Something you learn quickly about coding in any language is that you often need help with either:
- finding a bug in your code
- figuring out how to code something
That’s what makes Python so, so good. The community on StackExchange is huuuuuuge, and ultra friendly. They answer all questions you might have, even if you’re a super newbie at coding. You can kind of imagine them as your secret back-up singers or back-up security – ready to help your code when you’re coming up short.
4. Lots of External Libraries
What are external libraries? Pieces of pre-written code that you can use for your own benefit!
A common misconception about programming is that you have to write your own code 100% the time. That’s so insanely inefficient. The point of programming is not to start from zero every single time. If someone has already built a foundation for what you want to do – use it! Build off of it! Make it better! Make it bigger!
Why are external libraries a life-saver? Because if you want to do machine learning, you don’t have to write machine learning algorithms – you just have to import them and put in your own data.
There’s a library for web developers that help create websites; libraries for game developers, libraries for handling data. External libraries can be used for math and physics and other types of research like biology simulations; you can solve complex equations and do linear programming, solve partial differentials equations (as one does when they’re bored) – ALL without having to re-write any of the mathematical algorithms behind it. (Can I get a Hallelujah?)
All you have to do is plug and play.
5. Object Oriented Programming
What is object-oriented programming? Well, It’s kind of difficult to explain, so let me just give you an example.
You can create a class called human, and give the class properties. Properties such as weight, height, and hair color. Then, you can give it functions (ie. things they can do), such as ‘go walk,’ ‘give name,’ or ‘ask name.’
That’s essentially what object oriented programming is: you have an object that you can create and customize.
Another bonus to this is inheritance – so you can create not just a human, but a German human who likes beer and bratwurst. This German would inherit all the properties of a human, but still be its own subsection of a specifically German human.
Basically: Python allows you to make layers of an onion when it comes to your objects. Object-oriented programming allows you to create ‘templates’ for anything that you can use multiple times over in your code. This can further be useful for in-depth customization and sectioning your code for clear organization.
6. Research + Industry
This is a strange reason, but it’s a good one nonetheless. Python is used by both researchers in labs and actively by the industry because it’s easy, powerful, and versatile.
If you want to get into coding new Internet of Things programs, or if you want to investigate dephasing time and energy gap fluctuations in light harvesting systems (My bachelor thesis, nbd) – you can’t go wrong with Python.
Python usage in Industry & research
- Walt Disney
- Los Alamos National Laboratory
- National Weather Service
7. All Grown Up: Mature and Open Source
Python is an adult in the world of programming. There are no apparent flaws in the programming language itself. Occasionally, in programming, your code encounters a bug not because of your code but because of an inherent issue in the language itself.
Python has come far in that department; it’s worked out its kinks and major issues. It’s a fully-developed language ready for use.
Not only that, Python is open-source, which means everyone can work on it. If bugs do happen, everyone works on fixing it. It’s a team effort in a team game.
If you find a bug, you can either fix it yourself or just register it (aka. pawn it off on someone else). No one’s making money so everyone is improving it for the overall community. That’s useful for you because problems get solved quickly and you’re not dealing with a support staff email for 16 hours.
8. Fast to Develop and Prototype
It doesn’t take fooooooorever to get something cool going on Python. If you know what you’re doing, you can realistically have an up and running prototype of data analysis in 30 minutes.
Example: If you have a database full of user ratings for movies, and you want to do an analysis on top rated movies – you could easily get this code running in half an hour.
To be fair, this can also be a teeny, tiny fault: Python is an interpreted language. This just means that it runs line by line. That makes it slow as it doesn’t really know what’s coming up in the rest of the code. All it knows is what’s right in front of it.
Python has to figure everything out on the fly, and it’s essentially just winging it while it’s running. (In comparison to C++, which knows the whole image of your code before it runs since it’s a compiled language.)
This means that while Python is good for development and prototyping, but not for full-blown application.
You’ll want to use Python for the beginning stages of a program. When you have a full ready product, you will probably end up moving it to another language because it will run faster.
9. Dynamic Programming
Last but not least, Python is dynamic. In simple terms, that means that Python is a big boy, and it can figure most things out by itself. You don’t have to tell it specifically that something is a word and something else is a number.
Python: a = 1 [You’re telling Python that “a” is 1.]
C++: int a = 1 [You have to define that “a” is going to contain an integer, that integer being 1.]
It helps often times if you’re just looking to get stuff done, and you don’t have the time (or patience) to tell your program that 1 is an integer or other little tiny details! I’m a busy man. I have stuff to do and Netflix to watch.
Honestly, the overall best thing about Python is that you’re just not limited at all. Whatever you’re looking to do with Python – you are able to do it.
Look at me! I didn’t study programming at all. I learned Python by myself, and landed several jobs in programming and data science. Now, I work as a Data Scientist. If I can do it, you can do it.