7 ms·
I often say that Python is the best at nothing, but pretty good at most things. And hence it became huge by the sheer appeal of being versatile. Life is short a
by sametmax 7y ago
I often say that Python is the best at nothing, but pretty good at most things. And hence it became huge by the sheer appeal of being versatile. Life is short and most people needing to program are not programmers. Also many programmers didn't start as such, and were simply looking for an easy way to solve a task.
- blunte 7y agoBingo. When you just need to get something done, Python is great. Some quick googling to find the right libraries for the task, and then some caveperson programming, and the deal is done. Outside of lisps, I find Python to be one of the simplest syntaxes, so the only effort is the logic to solve the problem.
- AtHeartEngineer 7y agoI've been programming since I was a teenager, and for a long time I found myself struggling with my syntax and edge cases. Once I started using python, about 10 years ago, programming quickly turned into "what's the best way to solve this problem", instead of "wtf do you mean null pointer".
- petre 7y agoThe feeling is quite the same when switching from C to D. You don't have to use the advanced features of the language, but they're there if you want them.
- crdoconnor 7y agoGood C bindings and a willingness to accept that it wasn't ever going to be good at doing low level fast code are an underrated facet of how python grew so popular. Golang, by contrast, is really quite schizophrenic sometimes about whether it wants to be a high or low level language.
- roenxi 7y agoThere is a bit more insight to be found by reversing that - Python is simpler than other programming languages and achieves that by sacrificing a little power. Compare it to C, which it has displaced as an introductory language. Python and C are superficially interchangeable to a beginner, but to learn C you have to invest time into pointers and memory management. Python sacrifices the efficiency of direct memory management to avoid the complication of pointers. Arguably, this is a significant benefit because it also cuts down on ways to introduce bugs. Compare it to a Lisp - Python has a pretty inferior set of basic capabilities (can't even use a dict as a dict key, drives me mad), but that just means there is only one easy way to do things that everyone uses. Less room to think up clever ways of doing things, less complexity reading other's code. Being the 'best' language for a task has a huge cost - incidental complexity created by including specialist constructs. Python's success suggests maybe programmers prefer this complexity to be encapsulated in a library rather than the language core.
- np_tedious 7y ago> can't even use a dict as a dict key Curious, is this actually something you want to do often? While there is no hashable+immutable frozendict ala frozenset, you could throw one together or even define a hash function on a subclass and "swim at your own risk" not to mutate it later. I've encountered this enough with lists and the obvious solution is to cast them to tuples. Can't say I've found the same with dicts tho. As for the comparison with lisp - in most lisps this is a non issue because nearly all structures are immutable
- iainmerrick 7y agoNot often, but when you do want to do it, it’s frustrating (and unusual for Python) that the natural and obvious way doesn’t work.
- jotaf 7y agoWhen I read this my first thought was "you should use a FrozenDict", but looking into it, it seems that it doesn't exist; I assumed so because of FrozenSets (hashable sets). You can still create a hashable key from a dict with FrozenSet(mydict.items()).
- judge2020 7y agoJack of all trades, master of none but often better than master of one