3 ms·
I started programming python in 98. It won because before that, Perl was king. Have you seen perl? Python made a great decision, it was the anti perl. One wa
by segmondy 3y ago
I started programming python in 98.
It won because before that, Perl was king. Have you seen perl?
Python made a great decision, it was the anti perl. One way to do things, keep the syntax easy and simple. Force whitespace indents. Before python got really "pythonic" It read like pseudo code. As someone that explored Ruby for a bit, Ruby has too much magic. Magic is cool when you're the one casting the spell, but for your audience, it's annoying if their job is to figure it out.
It offered OOP, but was like C++. It didn't force it on you. If you came from a C background, you could write C like code. If you came from an Objects/structs background you can do OOP.
It then offered a great standard library.
It had a REPL. DO NOT UNDERESTIMATE THE REPL. Not just a basic REPL, but an interactive one. dir()? __docs__? The power of man pages built into the REPL, allowed one to explore an unknown library.
Say what you want, but the FFI was well thought out and embraced. This made it possible for lots of C library to be made available in Python. PyQT, wxPython, allegro, OpenGL, all these paved the way for NumPy,TensorFlow, PyTorch. Your favorite graphics, sound library and many other libraries where wrapped in Python. You didn't have to write C anymore for most people with computers being fast enough.
Python won because of many little correct decisions along the way. The python2 to python3 drama was not a nightmare like perl5 -> perl6 or VB to VB.NET. Many good little decisions with a big of luck helps.
- imgabe 3y agoThe REPL is huge and makes it so much easier to learn to program by trying out little snippets of code to see what they do. You can trial and error your way to a working program pretty quickly. Only Lisp has a better REPL.
- unethical_ban 3y agoI have come around to dislike forced whitespace. I don't think non-visible characters should be syntactically important, and spaces are thus overloaded by separating both within lines and defining functions. With linters how they are, a traditional semicolon makes things a lot more clean IMO.
- mixmastamyk 3y agoSemicolons, braces, and indentation are redundant. That can be useful, but it’s the opposite of clean.