I don't think the author of TFA makes the case he's trying to make at all. And mind you, Python isn't my first or favorite language, and I'm not particularly biased in terms of defending Python. My language of choice is Groovy in most contexts. Anyway, this all seems like a lot of nit-picking to me. Yes, these "issues" are real, they just don't amount to much. And basically every other language has an equally long li…
Reasons Python Sucks
291–300 of 554 posts
Re: Reasons Python Sucks
#292Earlier quoted context omitted.
> The "it's so cool to shit on Java" thing served an important purpose and is probably close to being retired I don't know in which world you live in, but in the real world Java is by far the dominant platform for web services.
> I don't know in which world you live in, but in the real world Java is by far the dominant platform for web services. I read it as meaning 'the "it's so cool to shit on Java" thing' is close to retirement, not the language itself.
Re: Reasons Python Sucks
#293Earlier 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…
Re: Reasons Python Sucks
#294Earlier quoted context omitted.
> I regularly wish python required some sort type indication for function parameters You can use type annotations, either via the builtin lib or 3rd party libs! https://docs.python.org/3/library/typing.html > do_x() if a.y() I feel this. You can use `a.y() and do_x()`, but I'm not sure how people would react :o
Type annotations don't seem to actually have any effect, though? Consider: >>> def add(a: int, b: int): ... return a+b ... >>> add("a", "b") 'ab' This should be an error, even if it's a runtime error.
Re: Reasons Python Sucks
#295A better reason to hate Python: the internal model is way overcomplicated for what it's meant to be: a beginner-friendly scripting language. "Everything-is-an-object", duck typing, decorators, bizarre scoping rules, etc., all make it difficult for experienced programmers to understand, let along beginners. I've always thought there's a much simpler language struggling to get out of Python, and I wish it would and wou…
I'd also welcome a simplified Python, from scratch as it were, but that is a giant undertaking and bigger than the 2 to 3 chasm.
Re: Reasons Python Sucks
#296Earlier quoted context omitted.
With regard to "pass by reference", it's not even clear to me that that's a correct way to describe how Python passes variables to functions. Python variables aren't names for storage locations to begin with; they're namespace bindings. Passing a variable to a function means passing a particular namespace binding from the caller's namespace to the function's local namespace. I don't think the author of this article u…
> Python variables aren't names for storage locations to begin with; they're namespace bindings. Can you explain the difference? What is a "namespace binding"? When accessing a variable's value, the interpreter's code sure looks like it treats the variable name as the name of a storage location. > Passing a variable to a function means passing a particular namespace binding "Passing a variable to a function" is not a…
Re: Reasons Python Sucks
#297Earlier quoted context omitted.
That doesn't help with the problem you're replying to – in fact it would contribute to it. More generally, yes, many people use auto-indenting and it works in Python in most editors. It's possible that you're using one where it doesn't work correctly but that doesn't mean that's true for everyone else.
It does help with the problem I replied to, which was code written in C. Auto indenting that code block would indent the `someotherstatement;` line correctly and I would notice that mistake. Anyway, single line if statement is a flaw in C's design. What I said was that in Python's case, if I indent some code block wrong, I can't just fix the indentation using auto indenting in python, because the indentation is the s…
In my experience that last part is somewhat optimistic for the implication that someone would notice it immediately.
> if I indent some code block wrong, I can't just fix the indentation using auto indenting in python, because the indentation is the semantics. There would be "nothing" to fix and the code would just run wrong.
This is true in some cases — most of the time you'll get an indentation error instead of it running incorrectly — but also why many editors have an auto-indent option for pasted code and autoformatters covert things like code which is consistently indented to match your project's indentation size.
Re: Reasons Python Sucks
#298With python, not only their code is readable, but they also enjoy using it.
For more advanced programming however, it is a mess, and I understand the author. It limits your option so that there is basically only one way to do things (the opposite of Perl), it makes it annoying to write since even debug code needs to comply. But on the other hand, it gives you constructs that are very permissive. Pass by mutable reference is an example: there is no easy way to know what will happen to your arguments. You can completely modify just about anything so that even simple operations can do really weird stuff in the background. Flexibility is nice but it feels strange for a "clean" language to let you mess things up so deeply with very little safeguards.
Re: Reasons Python Sucks
#299Earlier quoted context omitted.
What would you consider a beginner language then?
Basic is much easier for a complete novice to get into.
The "immediacy" is there in both languages (well, in Python and modern Basic without line numbers): you can just type code without any rituals or mumbo jumbo and it will do more or less what you tell it to.
Re: Reasons Python Sucks
#300My top 3 criticisms as an intermediate (~5 months of study) python programmer: 1. Importing behavior is ridiculous: https://chrisyeh96.github.io/2017/08/08/definitive-guide-pyt... 2. Python libraries' documentation leave a lot to be desired (compared to good javadocs). Just because your language is dynamically typed doesn't mean you don't need to describe what the expected shape of a parameter should be. 3. Static me…
As a former certified Java programmer, moving to Python was a breath of fresh air. More concise syntax, no more braces all over the place, much less boilerplate (think getter, setter, public static void main(String[] args)) and not everything has to be an object. First-class functions, yay ! (I haven’t used Java seriously since 1.6 so I don’t know how much the language has evolved since then). The only reason I’ve ha…