Live data from Hacker News

Reasons Python Sucks

hackerfactor.com

91–100 of 554 posts

Re: Reasons Python Sucks

#91

Earlier quoted context omitted.

In C#, all variables ( reference or value types ) are passed by value. Yes, even reference types are passed by value. If you want to pass variables by reference, you need to use special modifiers ( out or ref ).

Yes, but for a reference types that value IS a reference, so if you change a complex type, that change will persist after return to the calling code.

But it’s still pass by value. Passing by ref allows swapping out the entire object, which is not possible in a language such as JavaScript.

Re: Reasons Python Sucks

#92
> My code for Python 3.5 won't work with the Python 3.7 installation unless I intentionally port it to 3.7.

This statement is plain wrong at best and intentionally misleading at worst. 99.99% of Python 3.5 code runs unmodified on 3.7.

> At the official Python web site, their documentation is actively maintained and available for Python 2.7, 3.5, 3.6, and 3.7 -- because they can't decide to give up on the old code.

No. It's because some people still are on the not-latest version and still need access to the documentation. It's what every good project should do.

I stopped reading there. Too much wrong in too little text.

Re: Reasons Python Sucks

#93

I too have tried it many times mainly because of all the great ML libs for python but each time I dreaded using it for Reason #3 (Syntax). Using indents for blocks just seemed unintuitive and error prone to me. But I dismissed it because all the programming languages I've worked with have had curly braces so maybe the reason for my discomfort was that it was unfamiliar.

Most languages that use braces also encourage you to indent the things enclosed by the braces to make it easier to read. However, people sometimes make mistakes. For instance I've seen this quite a number of times if (a) somestatement; someotherstatement; athirdstatement; Which is of course horribly misleading unless you're careful because the second statement isn't actually conditional on a. Python forces the indent…

Does no one have auto indentation in their editors? Every so often I just select the block of code I'm editing and auto indent it, which matches indentation with semantics without me having to think about it. Annoyingly impossible to do this with python since indentation is semantics. It also results in copy pasting of code being 100 times harder in python than other languages.

Re: Reasons Python Sucks

#94
I agree with a number of the author's points. For me personally, the biggest single issue is the scope by indentation. I know some folks like this, and think it is good to restrict single functions/methods to less than a page in an editor ... but I personally do not like a language imposing such opinions on me. It makes, IMO, reasoning about the code your reading, even if it fits in a single editor page, very ... very hard.

As someone who works with multiple languages across multiple environments, the author's comments on the installation ecosystem are on point. Though, these critiques are better directed at the packagers of the distribution. I'd given up on getting current, correctly built versions of Perl, Python, R, Octave, etc. from packagers/distros, and simply build my own in a separate tree[1]. Most folks now do this in user home directories, but I still personally like the system level availability.

FWIW, I've found that Julia[2] is a far better Python than Python. You have all the advantages of a JIT compiled language which does parallelism/concurrency well, has an awesome FFI to simply use external libraries, etc.

[1] https://github.com/joelandman/nlytiq-base

[2] https://julialang.org/

Re: Reasons Python Sucks

#95

Most of the points in this article fall on a continuum between irrelevant to dead wrong. 1 (versions) and 2 (installation) have to do with the ecosystem, not the language. Unsigned packages are a real problem, but hating on community-maintained software is just weird. Most software in your local Linux distro's repository is maintained by a "community" that might just be one person working in their spare time. 3 (synt…

Thank you for going point by point. I was blown away by how little experience the author had with Python, compared to how strong his opinion is about it. I hate hate hate language debates, but this isn't even that, it's just a misunderstanding. If this guy took a class on Python he'd figure out like 5 or 6 of these issues no problem!

True of most "X Sucks" discussions. I used to do a lot of ColdFusion. A mention of that would elicit the oh-so-clever, "I'm sorry...." A little digging found they either had never written a line of CFML in their life, or they worked on a project back in 2005 before they added numerable features, and before many of the frameworks and tooling that a typical developer would use.

Re: Reasons Python Sucks

#96
post #32

Earlier quoted context omitted.

Only in Python can I commit a whitespace-only change that results in a 10x speed improvement.

Care to explain? I’m not sure where this would work without fundamentally changing the meaning of the code

I'm guessing it refers to moving something out of a loop, which in Python often requires only an indentation change. In most other languages, it requires moving the code to the other side of a brace, or perhaps adding a brace. If braces were considered whitespace, which is not entirely unreasonable when talking about Python vs. other languages, it would be much harder to come up with examples. Drawing a blank right now. Anyone else want to try?

Re: Reasons Python Sucks

#97
His early history of Perl is at odds with my memory. In my memory, perl was pretty great with not breaking old stuff. Even the pretty amazing feature set added between perl4->perl5 seemed a natural evolution to me.

https://en.wikipedia.org/wiki/Perl#Early_versions

(P.S. yes yes perl 6 went kookoo crazytown, but that's not what he was talking about.)

Re: Reasons Python Sucks

#98
I want to get a vote on indented nested blocks- how many of you like them? Please up the appropriate child comments (if I'm rate limited someone else please make child comments with like and unlike).

My reasoning (please give yours below proper heading)- I'm deadly afraid of refactoring or even accidental indentation change.

Re: Reasons Python Sucks

#99
post #71

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

Those languages use references rather than pointers (that is, their referring-things do not support arithmetic), so any name for what they do that involves "pointer" is a poor one. The distinction between passing the value of a reference being used by the caller and passing a reference to the caller's stack is so rarely important or useful that there's no consensus terminology for it. The distinction that's actually…

"The distinction between passing the value of a reference being used by the caller and passing a reference to the caller's stack is so rarely important or useful that there's no consensus terminology for it."

And the reason for that is essentially all modern languages make copies of something when passing argument parameters. The only question is what they are passing and exactly how hard the language layer works to make it look as if you are or are not passing something by reference.

I have to reach to something as obscure as Forth to find a language that does not work that way, and truly does not copy parameters into a function. (I haven't dug into Factor enough to know if under the hood it still copies parameters.) It's a very unusual choice to not copy something for a function call.

(This is one of the ways our CPUs have been optimized for the languages we run; they make this intuitively expensive operation otherwise cheaper than it would be on a naively designed CPU.)

Re: Reasons Python Sucks

#100

Most of the points in this article fall on a continuum between irrelevant to dead wrong. 1 (versions) and 2 (installation) have to do with the ecosystem, not the language. Unsigned packages are a real problem, but hating on community-maintained software is just weird. Most software in your local Linux distro's repository is maintained by a "community" that might just be one person working in their spare time. 3 (synt…

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 workarounds with dictionaries, because sometimes you just want a clean way to deal with a value that can take 7 different forms.

I regularly find myself wanting to write something of the form do_x() if a.y() This is stupid, but I still kind of want it since do_x() if a.y() else do_y() is valid

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.

Post reply on HN