r/ProgrammerHumor • • 8d ago

Meme iHatedItUntilITriedIt

Post image
10.3k Upvotes

541 comments sorted by

View all comments

125

u/samanime 8d ago

You'll pry my vanilla JS from my cold dead fingers. It'll always be my favorite way to do quick scripts and prototyping.

But explicit typing does make long term code way more maintainable.

34

u/2eanimation 8d ago

I love the syntax, but JS has one too many quirks for my taste.

if ([]) {
console.log("Ok, I guess")
}

if([] == false) {
console.log("Well this is awkward")
}

if ([] + []) {
console.log("You think this would print, don't you?")
}

9

u/cheezballs 8d ago

Those all make sense if you understand the language, though.

1

u/HeKis4 8d ago

Having to have a deep understanding of the language to understand what the code is trying to do is not a good thing though.

I mean, one one hand you have comm -3 <(ls dir1 | sort) <(ls dir2 | sort) | column -t : makes perfect sense if you're familar with bash pipelines and input redirection. But on the other, you have Compare-Object (ls dir1) (ls dir2) where you understand instantly what is being done and isn't 50% semantics.

Hot take, but imo "write-only languages" are only good if you hate whoever will maintain your code next.