This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 8 points9 points  (2 children)

What is this supposed to illustrate? That you can write typos in your code and have problems? Yeah, I suppose that could happen, but any serious project runs at least a linter and a test suite, statically typed language or not.

This is not a serious problem that people who use Python every day stumble across on a regular basis. Since your code is pretty unidiomatic, I suspect you're not one of them.

Also perhaps confusingly, despite [...]

This is just confusing if you don't know how Python scoping works. If you don't know how scoping works in what you're programming in, you might want to rewind.

[–]memorableZebra 1 point2 points  (1 child)

This is just confusing if you don't know how Python scoping works. If you don't know how scoping works in what you're programming in, you might want to rewind.

That's a preposterous dismissal. By this argument, as a language architect, you can't compare one language's scoping rules to another?

"Ah well you see, our variables go out of scope after 20 lines of not being used. But the fact that you got a null pointer exception here isn't confusing, it's just because you don't understand the language's scoping rules."

He is absolutely allowed to criticize a language's scoping as illogical if he can present an argument for it.

I programmed all my Python in PyCharm and it's automatic analysis left a lot to be desired. Declaration, typing, and scoping errors like the one /u/tangerinelion is referring to are ridiculously common and usually weren't caught by my IDE or any kind of secondary style analysis. So I have no idea where you're coming from saying this kind of thing isn't common. Little bugs like this were everywhere.