4 ms·
There exists a couple of mainstream languages that are full of these sorts of interesting behavior, one of them is supposedly cool and productive and the other
by eitland 6y ago
There exists a couple of mainstream languages that are full of these sorts of interesting behavior, one of them is supposedly cool and productive and the other is supposedly ugly and evil.
- drno123 6y agoPython vs JavaScript?
- speedgoose 6y agoPython vs PHP also.
- pansa2 6y ago> full of these sorts of interesting behavior I don’t think that applies to Python - it’s quite strongly (although not statically) typed. I agree that it does apply to JavaScript and PHP.
- eitland 6y agoJavascript and PHP is correct.
- exyi 6y agoI think this applies to Python pretty well. Although certainly not as bad as PHP, most JS traps also exist in Python (falsy values, optional glitchy semicolons, function scoped variables, mutable closure). There is many JS specific traps like this and also other Python specific ones (like static fields are also instance fields, Python versions and library dependency hell). However I find it easier to avoid them in JS than in Python with TypeScript, avoiding classes, ...
- lunfard00 6y agoand yet I don't see anyone complain about bash which is arguably far worse than those 2. When things get hard on bash, you will start to see python scripts on CI and whole thing is complete unreadable mess
- masklinn 6y ago> I don't see anyone complain about bash You're not looking really hard then, but really > When things get hard on bash, you will start to see python scripts That's kinda the thing innit? Unless the system specifically only allows shell scripts (something I don't think I've ever encountered though I'm sure it exists) it's quite easy to just use something else when bash sucks, so while people will absolutely complain about it they also have an escape: don't use bash. When a piece of software uses YAML for its configuration though, you don't really have such an option. Furthermore, bash being a relatively old technology people know to avoid it, or what the most common pitfalls are. Though they'll still fall into these pitfalls regularly.
- lunfard00 6y agoThere is a lot of elitism around bash, like the "Arch btw" thing but far worse because a lot of important things depends on it. Powershell has been working on linux for quite a while now and doesnt seem get any attention even when it has a nice IDE support and copy the good things about bash.
- lokedhs 6y agoIt doesn't copy all the good things about the Unix shell though. The reason people are comfortable with the POSIX shell is because you use the same syntax for typing commands manually as you do for scripts. But, you're going to have a hard time finding people who prefers writing: Remove-Item some/directory -recursive Rather than rm -fr some/directory People who write shellscripts are often not seeing themselves writing a "program". They are just automating things they would do manually. Going to an IDE in this case is not something you'd consider. I happen to be very aware of all the pitfalls in POSIX shell, and it's rare that I see a shellscript where I cannot immediately point out multiple potential problems, and I definitely agree that most scripts should probably be written in a language that doesn't contain so many guns aimed at the user's feet. I'm just pointing out a likely reason why people are not adopting powershell in the huge numbers that Microsoft may have hoped for.
- brohee 6y agoThe "Wat?" Talk got quite a few example and is hilarious. https://www.destroyallsoftware.com/talks/wat https://www.destroyallsoftware.com/talks/wat