Live data from Hacker News

Reasons Python Sucks

hackerfactor.com

331–340 of 554 posts

Re: Reasons Python Sucks

#331

A great example of how Trump has been elected. He lied a lot, (or said stupid things because he was ignorant in a topic) but it doesn't matter, because rebuttal takes a bit more effort than saying stupid things so what he said stuck with a lot of people. Sorry, but this article is just ignorant in almost every point.

> A great example of how Trump has been elected. He lied a lot, (or said stupid things because he was ignorant in a topic) but it doesn't matter

A number of the people with federal felony convictions, some having already gotten federal prison sentences to go with them, for their role in supporting Trump's dishonesty might quibble with the “doesn’t matter” characterization.

Re: Reasons Python Sucks

#332
While I agree with the author's reasons why Python sucks ass, he's wrong about Commodore but thinks that he isn't:

"Where's Commodore today? It died out as users abandoned the platform."

No. Commodore died because Irving Gould told Tramiel to pack his bags and go when Tramiel told him it wasn't okay to use company's assets like the jet as personal property. Once Tramiel was fired, the company was plagued by chaos and mismanagement, but it had nothing to do with how bad or good Commodore's computers were. It's the 21st century and people still write fresh software and design modern hardware for Commodore computers, so they've never been abandoned.

Re: Reasons Python Sucks

#333

Earlier quoted context omitted.

What Java, JavaScript and C# call "arrays" are each very much like what Python calls "lists'. In particular the indexing after push() and pop() type operations and the bigO of indexing. More abstractly, Historically, in computing "list" connotes pointers and "array" connotes sequential memory. The connotations imply engineering tradeoffs. [1] "List" may make more sense for a beginning programmer. It is an arbitrary c…

Not true for Java or C#. In both of those languages, arrays are fixed-size and don't have anything like a push or pop operation. Both have an automatically resizing container backed by an array that is referred to as a list. Python's use of "list" matches the use in Java and C# perfectly.

Requiring a type definition, Python's Array type more closely matches Java and C# Lists than Python's List type.

In Python, Arrays are sequence types and behave very much like lists[1] In other words, even in Python, arrays have similar semantics to Javascript Arrays not Java Arrays.

[1] https://docs.python.org/3.4/library/array.html

Re: Reasons Python Sucks

#334

Earlier quoted context omitted.

You can't add methods to integers in Python, but they're still objects in the sense that you can call methods on them: >>> i = 123 >>> i.bit_length() 7

Some methods but not others. Specifically, I can call built-in methods, but not methods I define. For example: >>> def f(self): ... return self ... >>> (3).f Traceback (most recent call last): File " ", line 1, in AttributeError: 'int' object has no attribute 'f'

Your `f` is not a method, but a top-level function whose first parameter happens to be named `self`.

You can't call `f` as a method of any object, because in Python (unlike Ruby) the top-level namespace is unrelated to the namespaces of any classes.

Re: Reasons Python Sucks

#335
post #117

Earlier quoted context omitted.

Python (and Java) do not pass anything by reference. They pass by pointer-value. (If they passed by reference, you could change to which value a caller's variable was bound, like you can in C++).

> They pass by pointer-value. No, Python doesn't even do that, because Python variables aren't names for storage locations to begin with. They're namespace bindings. Passing a variable to a Python function means transferring a namespace binding from the caller's namespace to the function's local namespace.

The semantics are identical.

Re: Reasons Python Sucks

#336

Earlier quoted context omitted.

>3 (syntax) seems to be about not supporting the author's own highly idiosyncratic habits Yeah, I don't get the author at all. Using indentation is so, so, so, so, much cleaner and easier to understand, even with lots of nesting than trying to figure out if you closed all the stupid curly braces, curly braces be damned.

I asked a "C all the things!" developer a while back why he hated Python's enforced indentation and in a whole lot of words he basically said that it makes it difficult to visually track scope when you have long chains of conditionals. The standard Python developer response to that is, "Aha! You like braces because they enable your bad programming practices !" However, I found the best way to illustrate that point is…

> * I asked him, "If you're never allowed to use a text editor/IDE that highlights braces or the space between them ever again would you still prefer braces to indentation?"*

Being visually impaired and also having coded since before syntax-highlighting editors became standard, yes. A brace character is something that's easy to visually perceive; whitespace isn't.

Re: Reasons Python Sucks

#337
post #228
post #100

Earlier quoted context omitted.

It's funny how far off the author was, because there are genuine things to complain about with python, though they may not be exclusive to python. I regularly wish python required some sort type indication for function parameters, because dealing with libraries that take complex objects as function parameters can be an absolute nightmare. I wish python had some equivalent to the switch statement that didn't involve w…

Edit: Also fuck this whole "it's so cool to shit on Java" thing. Grow up. You aren't in college anymore. You should recognize that Java fills its niche effectively, and does a decent job of being semi-fast, portable, easy to read and maintain, and safe. The "it's so cool to shit on Java" thing served an important purpose and is probably close to being retired, but it's easy not to understand if you weren't a Java pro…

That provides some interesting context to that attitude, thanks.

Re: Reasons Python Sucks

#338

This article gets worse with every paragraph: > My code for Python 3.5 won't work with the Python 3.7 installation unless I intentionally port it to 3.7. Probably not. While I can't guarantee there are zero breaking changes, it is highly unlikely to encounter any from 3.5 to 3.7. Another numerical pair might have been a better example. The split between 2/3 was an issue, widely known, and in the past. Personally I'm…

hah yeah, perl5 was basically perl's renaissance. the web took off and perl was basically used to glue it all together. they did go crazy with perl6 though, and i think a lot of the reason why python took off was because of the hole the perl developers left and google liked python.

it seems the performance problems in python can (and are) being fixed. the big downsides i see are the 2to3 mess (which seems like it will be solved with time), weak concurrency support in the default implementation and the lack of the ability to do much real static analysis.

makes for great interactive glue though!

Re: Reasons Python Sucks

#339
post #287

Earlier quoted context omitted.

> author is admitting he's unhappy because Python isn't C That's not the point at all. I mean, did you read it? How do you mischaracterize the specific point about the casual opportunity for foreign module metaprogamming? Module initialization is bad in a pernicious way. While you can't do operator overloading, you can clobber namespaces (which was referenced). Paired with a community repository, this is exactly the…

My point wasn't to devalue his arguments - in fact, I find them valid arguments. My point was he's using inexperience and/or familiarity with C/C++ as a reason to "hate" it. He complains about Python developers grep'ing directories when he admits to looking through just as arbitrary of a directory. His complaints about random code execution during import is valid but also seen as a feature _allowing_ metaprogramming.…

> It's just as bad as C/C++ allowing clobbering over memory.

That's a good parallel.

> My point was he's using inexperience and/or familiarity with C/C++ as a reason to "hate" it.

I have less familiarity with C/C++ than Python and I hate it because it's not about language perspective. It's bad language design, for such a high level language. Inclusion wrapped with execution is unsafe and has an easy fix for most language interpreters. Don't allow execution during a declaration. If you want to do metaprogramming, there are other ways that don't break the paradigm (rewriting files before inclusion, chaining programs, etc).

Re: Reasons Python Sucks

#340
post #293

Earlier quoted context omitted.

I asked a "C all the things!" developer a while back why he hated Python's enforced indentation and in a whole lot of words he basically said that it makes it difficult to visually track scope when you have long chains of conditionals. The standard Python developer response to that is, "Aha! You like braces because they enable your bad programming practices !" However, I found the best way to illustrate that point is…

I hate meaningfull identation because the tools I end up using suck at maintaining it. I end up bugfixing on customer systems, sometimes on systems used by coworkers. There is no editor with consitent tab vs. spaces or tab width settings. I had editors clear two indents at once, fail to correctly line up new indents more often than not. I will accept whitespace as sane block scoping method the moment every text edito…

>There is no editor with consitent tab vs. spaces or tab width settings.

This is just plain false. PyCharm does, and I am sure there are others.

Post reply on HN