4 ms·
It's because you believe the pros of type checking always surpass the cons. But the Python user base is very diverse, with a huge difference in tastes, skills,
by sametmax 8y ago
It's because you believe the pros of type checking always surpass the cons. But the Python user base is very diverse, with a huge difference in tastes, skills, goals, time and constraints.
That's why you can code in imperative, OO or functional and not just one paradigm.
That's why you can choose between threads, processes and asyncio, or callbacks vs await.
And of course, declaring your types or not.
This allows Python to be suitable for geography, data analysis, scripting, web dev, sysadmin, machine learning, UI, pentesting, etc.
Python is never the best language at anything. But it's a damn good language at most things. It's an invaluable powerful versatile toolbox because it gives you the margin to adopt the style that fits your problem instead of forcing one on you.
It also has the benefit of not getting out of fashion precisely because of that.
- ksec 8y ago>Python is never the best language at anything. But it's a damn good language at most things. It's an invaluable powerful versatile toolbox because it gives you the margin to adopt the style that fits your problem instead of forcing one on you. I think this so much. What the best programming languages for me isn't necessarily the best at anything, and shouldn't be at all. But it should be 80% of everything the best. And that in itself is possibly even harder to achieve. I really wish Ruby was the case here. But clearly Python is taking this title.
- msie 8y agoIf only Ruby had as strong an ecosystem as Python. But right now it's Rails 95% of the time and the documentation sucks most of the time.
- goatlover 8y agoI hate that Rails came to dominate the Ruby language in most people's minds. It's such a nice dynamic language on it's own that you can use anywhere you use Python (if the libraries exist for it). And there were minimal frameworks like Sinatra when everyone was running to Node to use Express because of Rails, ignoring that Rails wasn't the only Ruby game in town.
- thethirdone 8y agoIIRC, Express was actually originally based on Sinatra. When I was doing a ruby server stuff I was using Sinatra and when I switched to JS (for various reasons) I looked specifically for Sinatra like libraries and found Express.
- dnautics 8y agoI think the dominant reason why ruby lost out was because python won the educational market; there was something seductive about forcing children to use good indentation. The final blow came when the difficult 1.8.5 -> 2.0 transition made the act of installing ruby a challenge, of course this happened to python not too long after with the 2.7 -> 3 transition.
- BeetleB 8y agoFrankly, Ruby lost due to the lack of libraries compared to Python. The latter had a few years of head start. Anecdotally, I've heard the syntax may have been the cause. In those early days, Ruby was too much like Perl. If you didn't like Perl's syntax and philosophy, Python was a good alternative. If you were the type of person who grokked Perl, then why go to Ruby when you have all of CPAN at your disposal?
- sametmax 8y agoPrecisely. Ruby was such a hit with rails they never bothered creating an ecosystem outside of the web. JS doesn't have this problem because it has the terribly unfair advantage of a monopoly of the most popular platform in the world. But Ruby did not, the server was open too all. And so when competition arrived on the backend, people chose a language that you could use for the web and something else.
- philwelch 8y agoSo has the Python community collectively abandoned "there's only one way to do it"?
- jrs95 8y agoThat (and Zen of Python in general) was always intended to be primarily about the development of the language itself and it's core libraries. Of course it carried over a fair bit, but I don't think it was ever really a thing enough to say that the community abandoned it.
- joshuamorton 8y agoI find it funny that everyone misremebers this. The zen states that there should be one, and preferably only one, obvious way to do it. Not only one way to do it, but one obvious way, and if you have one obvious way you probably don't need more than one. There's always been more than one way to do things. String formatting, loops/map-filter/comprehensions., Even importing. The idea is that for whatever you're doing, the language should provide an obvious way to accomplish that. Sometimes that means having competing ways of doing it, so that distinct but similar problems both have obvious solutions.
- hellofunk 8y ago> I find it funny that everyone misremebers this. Probably because the Zen is also right about most people not being Dutch.
- sametmax 8y agoThe zen is a target, but python fails to reach it very often. After all, duck typing is implicit, there are many way to format and the logging library is very much nesting. We are not monks, we live in the real world.
- golergka 8y agoI love type checking and have a huge disdain for dynamic languages. But I also recognize that I work on codebases that live a long time and change and get refactored A LOT. I can't imagine statistical researcher being effective writing effective if he was forced to write his one-off experiments in something like C#, although it's almost the best language for me and my tasks.
- sametmax 8y agoPrecisely. And the opposite is true. I'm now working on the first code base so huge that every time i open a file, i annotate all the lines a touch. That's a beautiful thing.
- paulmd 8y ago> Python is never the best language at anything. But it's a damn good language at most things. It's an invaluable powerful versatile toolbox because it gives you the margin to adopt the style that fits your problem instead of forcing one on you. This is meaningless bullshit. I could say the same thing about Java - tons of battle-tested high-level libraries, and a variety of frontends that all compile onto the same runtime. Just like Python, you can write imperative or functionally, and have your choice of working in a hand-holding high-level framework or down close to the API. It's a programming language, if it's not a powerful+versatile toolbox it's doing something wrong. Now, if we look at the cases where a programming language is obviously not fit-for-purpose, the common thread is the inability to scale to larger codebases without the programmer effort becoming exponential. And that's where Python fails, because it's missing a critical piece of the toolbox - type checking. It makes maintaining code vastly more difficult, because you don't have any compile-time checking about how your code is being used. That makes it brittle and difficult to refactor. > It also has the benefit of not getting out of fashion precisely because of that. PHP also never goes out of style. Should we all be taking cues for language design from PHP? I don't think Python is that bad. I write Python code when it's appropriate. But it's not the language I'd choose to write a large, long-lasting codebase in, either.
- deleted 8y ago[deleted]