this post was submitted on 16 Jul 2023
474 points (100.0% liked)
Programmer Humor
854 readers
9 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Come on, Javascript is pretty nasty. Trying to read that shit always gives me brain tumors. Why do they need to wrap every fucking thing in a function inside a function inside a function that is passed as a parameter to a function inside another function?
Like, bro, you know people are meant to understand what you just wrote?
It just gives too much freedom and people forget they need to write code that is easy to read for people who aren't totally familiar with the code base.
They even bring that shit into typescript. Like they are already using a language that is meant to fix that shit and they are like, nope, let me create 5 nested functions just because.
Can you give an example of the multi nested functions? I was a TS dev for a while and don't remember anything like that. Unless you mean the promise callback functions. Those were a mess but luckily we've mostly moved away from those
People creating functions as objects inside of other functions. A few days ago saw a person create a function with two object functions inside, then passed one of the functions as an argument to the other function. Then returned the second function.
It's hard to find such a mess in other languages. Yeha, functions as objects are cool. Closures are also cool... But why abuse that shit?
Ahh I remember that sort of JS programming from way back. Do people still do that?? You can just create a class now