Live data from Hacker News

Python is not a great programming language

gist.github.com

101–110 of 156 posts

Re: Python is not a great programming language

#101
post #82

Sure Python has many problems, but these aren't a great selection. > The syntax for classical inheritance. Half of each Django app is super().__init__( args, *kwargs). At least you don't have to pass arguments to super anymore. Yes, inheritance is hard to do well, but that's generally true. Much better to prefer composition ( https://en.wikipedia.org/wiki/Composition_over_inheritance ) > Too many magic __double-under…

Sure Python has many problems, but these aren't a great selection. Yes. I have my disagreements with Python, but those are not it. The article author is mostly complaining about ways Python differs from Javascript. - Agree that the mechanism for talking about parent classes wasn't very good. Multiple inheritance usually adds complication without adding much necessary functionality. That's not just a Python problem. I…

Regarding performance, I'm hoping alternate interpreters like pypy start thriving. Theres no reason python needs to be as slow as CPython.

Re: Python is not a great programming language

#102

TLDR: if you’re a new programmer, don’t take this seriously. This person clearly doesn’t understand programming languages so well. Sorry to make this response an “ad hominem” one, I should revoke the claims. But it’s impossible if they don’t understand basic concepts of programming languages. For example, complaining that a dictionary key must be place in quotes. It’s not that “the key needs quotes”, but that you’re…

Actually nowadays it's discouraged to use list comprehensions in Haskell. Even though he didn't complain about it, Python has very poor facilities for functional programming overall.

Re: Python is not a great programming language

#104
post #67

Earlier quoted context omitted.

>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.

Most popular programming languages got popular by aiming for the LCD in some capacity, e.g. Java. It's the reason why we're not all writing LISP or Haskell.

I don't think that's the main reason why and is probably a small factor at best.

Java rode a couple of different trends at the same time: it provided a somewhat smooth upgrade path from C++, cross-platform compatibility, and an astronomical marketing budget.

Many languages in the top-10 that we believe are popular or mainstream got there by having one of platform lock-in, smooth upgrade from a prior language, or a killer, exclusive app. It's a lot less about what is good or objectively better and more about being in the right place at the right time.

I've heard some claim that Python got there by being slow and steady. At one point I think I would have agreed but it does have a killer app and that's in the analysis, scientific and machine learning communities.

Re: Python is not a great programming language

#105
One realizes the true cost of Pythons forced indentation when using MicroPython over a serial connection, for example It's a big PITAS, tbh. I see Python as a Vala-like glue language for C (as in Cython or FFI) but this singular weakness makes you pay attention to it in a context in which it' s truly beyond ridiculous. One may as well lisp for such use-cases...

Re: Python is not a great programming language

#106
post #97

Earlier quoted context omitted.

> I guess I just didn't realize how bad a programmer knowing (only/mainly) JavaScript causes you to be. 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 n…

I struggle with learning new languages from time to time and there's always been a learning curve from starting out to being proficient. But while Python itself I think provides an awesome developer experience, django seems less than awesome, and it's taken a while for me to feel proficient in Django.

Personally, I'm not a huge Django fan, but then again lots of people aren't huge Laravel/Symfony fans which is my web framework of choice if I'm building a monolith web app/API "software bus" sorta solution without roping in Java.

That all said, I do love me some Python though! I use it as a general purpose tool to get semi-complex things done that are more scripting/job oriented vs. needing the orchestration that Django brings to the table. You could say it's a "cog" for me vs. the overall machine/engine.

It's on my TODO list to get into some other Python framework libraries because I've seen lots of promising ones pop up since Django, if anyone has suggestions of what to poke my nose into I'm all ears!

Re: Python is not a great programming language

#107

TLDR: if you’re a new programmer, don’t take this seriously. This person clearly doesn’t understand programming languages so well. Sorry to make this response an “ad hominem” one, I should revoke the claims. But it’s impossible if they don’t understand basic concepts of programming languages. For example, complaining that a dictionary key must be place in quotes. It’s not that “the key needs quotes”, but that you’re…

> any immutable object as a key

Any hashable object, technically. Especially with custom objects, the two (immutability and hashability) don’t necessarily have to overlap, although it’s often a bad idea to have hashable, mutable objects

Re: Python is not a great programming language

#108
post #75

> you have to do foo.get('bar')... or in some cases getattr(foo, 'bar', None) This is a mistake based on thinking in Javascript: in JS the index operator is effectively the same as the dot operator, for example foo[“bar”] == foo.bar. In Python those are different. [] corresponds to get in dicts, and . corresponds to getattr in objects. My personal biggest gripe with Python is that there isn’t a better story for typin…

How about post 3.5 type hints?

Re: Python is not a great programming language

#109
post #60

Earlier quoted context omitted.

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…

dic = {k: v for k, v in dic.items() if k in other_dic and v == "bar"} 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 i…

I like comprehensions, but think this style has some advantages (and some disadvantages):

dic = dic.where((k, v) => k in other_dic and v == "bar").todict()

Re: Python is not a great programming language

#110

These all just seem related to syntax, not actual program structure or capabilities. The only program structure thing I see is list comprehensions, which is one of Python's great strengths. Ironically they say Ruby is more pleasant to write, when Ruby has the deepest structural flaws of any dynamic programming language.

I’ve always been super happy using Ruby. Never had any experiences that would cause me to label it in the way that you have. However, I am interested to know what those flaws are. Could you elaborate?
Post reply on HN