> a big part of my frustration comes from having a JavaScript background Yeah, I thought so when I was reading the list of "problems". In fact, many of those are features (e.g. lists & tuples being different, list comprehensions, lazy evaluation, distinction between maps/dicts and objects, ...) but the author doesn't actually understand them. I hate to sound so negative, I guess I just didn't realize how bad a progra…
How about how condescending of a programmer not knowing JS causes you to be :-) Either way, if the number of idiosyncracies in your language is confusing to junior developers it's absolutely something worth considering.
Python is not a great programming language
51–60 of 156 posts
Re: Python is not a great programming language
#52Jack of all trades, master of none. The article has a silly premise - I don't know anybody who would claim it's a great programming language. For the moment, it's just the most practical in certain areas (notably data science and machine learning.)
Re: Python is not a great programming language
#53Earlier quoted context omitted.
Complaining about having to cast generators to list... seems like the kind of dev that has their code randomly run out of memory until a senior dev comes and fixes it.
It is annoying! And doesn't always save memory. In theory a "sufficiently smart language" should have a feature to understand that `thing[3]` can be translated to "call `next()` 3 times and gimme the last thing", not in "turn this completely to a list, that may take a ton of memory, although I only need that one third element". Generators should be treatable as lazy lists in the end, and lists should have a common in…
With that said...
> In theory a "sufficiently smart language" should have a feature to understand that `thing[3]` can be translated to "call `next()` 3 times
This might be a newbie trap, because next() isn't the same as indexing. What happens if I perform `thing[7]` followed by `thing[5]`? Should performing `thing[7]` put 1-6 in memory and turn the object into a generator-list hybrid?
Re: Python is not a great programming language
#54> a big part of my frustration comes from having a JavaScript background Yeah, I thought so when I was reading the list of "problems". In fact, many of those are features (e.g. lists & tuples being different, list comprehensions, lazy evaluation, distinction between maps/dicts and objects, ...) but the author doesn't actually understand them. I hate to sound so negative, I guess I just didn't realize how bad a progra…
> Too many other weirdo bits of magic syntax, like [list comprehensions].
I sadly have to agree with you.
Re: Python is not a great programming language
#55This list is so deliciously sophomoric. The best one is, and I quote: """To many other weirdo bits of magic syntax, like [list comprehensions]""" Obviously without actually proposing how comprehensions could be made better one has to hope the author would say he likes the equivalent Haskell better, but there is a strong doubt that is not the case.
I personally find list comprehensions in python pretty horrible. They seem to exist only to do lots of stuff in one single line of code. You end up with totally impenetrable unreadable perl-esq garbage write-once-read-never code that is too clever for its own good. And people say python is easy to learn and good for beginners...! A better approach would be something like Java Streams/.net Lync/RxX pattern IMO. Explic…
g = [i for i in list if x == 3] -> g = []; for i in list: if x == 3: g.append(i);
Re: Python is not a great programming language
#56> a big part of my frustration comes from having a JavaScript background Yeah, I thought so when I was reading the list of "problems". In fact, many of those are features (e.g. lists & tuples being different, list comprehensions, lazy evaluation, distinction between maps/dicts and objects, ...) but the author doesn't actually understand them. I hate to sound so negative, I guess I just didn't realize how bad a progra…
How about how condescending of a programmer not knowing JS causes you to be :-) Either way, if the number of idiosyncracies in your language is confusing to junior developers it's absolutely something worth considering.
Why? Aiming for the lowest common denominators and the simplest systems tends to not create scalable long term solutions.
You also seem to really undercount what a properly trained junior developer is capable of understanding.
Re: Python is not a great programming language
#57> a big part of my frustration comes from having a JavaScript background Yeah, I thought so when I was reading the list of "problems". In fact, many of those are features (e.g. lists & tuples being different, list comprehensions, lazy evaluation, distinction between maps/dicts and objects, ...) but the author doesn't actually understand them. I hate to sound so negative, I guess I just didn't realize how bad a progra…
Hey now - not all of us ECMA devs are total crap, but, I guess I know a fair bit of other languages. This guy is just totally ... I have words for it but I'd rather not get the mods on me.
I struggled with an appropriate way to say this but I think he's super pretentious and just sounds frustrated with learning a new language. I mean, we've all been there but typically we don't post ignorant BS to HN/GitHub about it... Every time I jump into a new language I'm always stubbing my toes on things I find "awkward", only to learn later that there's usually a reason people design languages certain ways.
If he wants to shoot his social media reputation in the foot as a developer then so be it I guess =/
Re: Python is not a great programming language
#58Re: Python is not a great programming language
#59From my main perspective (scheme programmer): I am constantly amazed by the bad code python programmers write in scheme. Take a nice recursive function, sprinkle it with set! (which leads to boxing and general slowness in many implementations) and if that wasn't slow enough for you, wrap it in a call/cc to be able to return from arbitrary places in the function. As a bonus, forget to discard the captured continuation to make your program use insane amounts of memory.
Then proceed to complain on Reddit.
Re: Python is not a great programming language
#60This list is so deliciously sophomoric. The best one is, and I quote: """To many other weirdo bits of magic syntax, like [list comprehensions]""" Obviously without actually proposing how comprehensions could be made better one has to hope the author would say he likes the equivalent Haskell better, but there is a strong doubt that is not the case.
I personally find list comprehensions in python pretty horrible. They seem to exist only to do lots of stuff in one single line of code. You end up with totally impenetrable unreadable perl-esq garbage write-once-read-never code that is too clever for its own good. And people say python is easy to learn and good for beginners...! A better approach would be something like Java Streams/.net Lync/RxX pattern IMO. Explic…
How could that be improved? That's 3-4 LOC minimum in any other language
My main grip is python's ternary operators, since the True value is evaluated before the condition, if you are doing ternaries on things that might throw exceptions the False value has to come first
value = 0 if key not in dic else dic[key] * 5
rather than (throws indexerror if key isn't in dic)
value = dic[key] * 5 if key in dic else 0