3 ms·
Nope! And unlike in JS theres no opt-in to them (let/const). But still js=bad python=good.
by jakear 6y ago
Nope! And unlike in JS theres no opt-in to them (let/const). But still js=bad python=good.
- brylie 6y ago==
- deleted 6y ago[deleted]
- coldtea 6y ago>But still js=bad python=good. I don't really understand the logic behind this comment. You're pointing this out like it's some contradiction in people's opinion. But it's not like "block scope" is the one and only determinant of whether a language is good or bad, so lack of that alone would negate the above statement. js could be bad and python good, regardless of whether Python lacks block scope. Doubly so since js also lacks it by default, and has only sort of tacked-it on with let/const. But the even better answer is that both are languages with different strenghts and tradeoffs, that JS did have several bad design decisions early on, that both have evolved, and x=bad, y=good is a fanboi reaction, not a developer reaction.
- zx14 6y agoFanboi discussions and reactions are the norm in the Python community. But this what you get when maybe more than half of your community is made of non-devs, who never touched any other language and never will.
- yunohn 6y agoIgnoring the snark and elitism in this comment, it’s unclear to me to why even “actual developers” must touch other languages, if python satisfies their needs. Programming is a tool, with the goal being building things that help the user.
- coldtea 6y ago>But this what you get when maybe more than half of your community is made of non-devs, who never touched any other language and never will. And this is supposed to be bad because? They had a problem, used a language to solve it, they've solved it, end of story. If they're satisfied with their solution, and it works for their purpose (and for their companies/organizations purposes), who is to day it's not OK? Perhaps they are professionals doing a job, not dilettante nerds trying different languages and idioms for fun...
- HelloNurse 6y agoThe rules for var and "hoisting" are so horrible that let and const are a justified language complication; now JavaScript variable scoping is decently usable. On the other hand, Python can afford to spend its language complication budget on something more useful than specialized mechanisms to end variable scope. Since JavaScript tends to have many more unnamed functions defined in the middle of long functions, compared to Python (which tends towards named functions, classes, or comprehensions), block scoped variables (or more precisely simple and rigorous rules about scoping) are much more useful and important in JavaScript than they would be in Python, since if there is a part of a Python function where some variable shouldn't be visible it's probably a long and complex function which can and should have its variable scopes refactored apart.