r/programminghorror • • Jun 12 '25 • This 1

Javascript Javascript is filled with horror

Post image
2.4k Upvotes

337 comments sorted by

View all comments

Show parent comment

1

u/LordFokas Jun 15 '25

Not that kind of prototypes. Object prototypes. You did learn how JS works before shitting on it, right?

... right?

Then maybe you use the time you spend hating on JS to understand it instead.

Also I didn't invalidate your opinion. It's a terrible opinion, but it's yours and you're entitled to have it. I invalidated the argument you used to back that opinion. It's a beyond terrible argument, doesn't have a leg to stand on, and has so many problems I don't even know where to start.

You managed to read what I wrote (maybe) and interpreted it (I hope) all wrong (definitely) and then try to win instead of trying to understand.

You know who also hates things they don't understand instead of trying to understand them? Religious zealots and medieval peasants. I'm not saying you're a medieval peasant, but I find the similarities funny.

(well Apple user probably counts as religious zealot though)

1

u/No_Pen_3825 Jun 16 '25

Yes, but prototypes need methods—as you noted—which have the verbosity issue.

maybe you [should] use the time you spend hating on JS to understand it instead.

I do try, but every-time makes me hate it more ¯_(ツ)_/¯

I don’t believe you have invalidated my argument, though. I argue a language should do the basics for you, not make you implement them yourself. I fail to see how this “doesn’t have a leg to stand on,” and all that. Personally, I don’t find RNG and pulling a random element from a list to be all that rare, and I would prefer not to have to make helper functions every time.

well Apple users probably count as religious zealots.

That’s a Fallacy of Composition

Alright, what else you got? I do ask you be respectful this time, though it’s up to you ¯_(ツ)_/¯

1

u/LordFokas Jun 16 '25

Yes, but prototypes need methods—as you noted—which have the verbosity issue.

I have no idea what you mean by this.

1

u/No_Pen_3825 Jun 16 '25

Do y’all call them something else?

extension Dice {
    // this is a method
    func roll() -> Int {
       return .random(in: 1…self.sides)
    }
}

1

u/LordFokas Jun 16 '25

Right, so you can add methods to your "classes" via the prototypes. Like swift extensions do.

I had to google it because swift syntax is weird af.

You add your method to the prototypes you wish to modify, and it immediately becomes available globally. Even in objects that already exist. That's it.

What part of this is verbose? I don't understand.

1

u/No_Pen_3825 Jun 16 '25

It’s not weird, it’s different (never get the two confused). JS is to me too. Extensions are also available globally, they’re pretty much the same thing (actually, I think ours are a lot more powerful, though I’d have to look at JS equivalents).

Yes, but the methods are written in JS, naturally, which is too verbose for me. Things got lost in translation.

1

u/LordFokas Jun 17 '25

It's the same thing.

If writing and reading a few characters is too much for you, please don't look at stuff like Java or TypeScript

1

u/No_Pen_3825 Jun 17 '25

It’s the same thing

Weird an different you mean? You know, we have a term for the conflation of the two, it’s xenophobia.

1

u/LordFokas Jun 17 '25

Damn you have terrible text comprehension skills.

I meant your extensions and adding things to the JS prototypes. It's the same thing.
You just extend types with the things you need and call it a day. Your chief complaint is easily fixed by something that you use daily on your preferred language. That makes your main argument real squishy btw.

1

u/No_Pen_3825 Jun 17 '25

It’s not my fault for being confused by you missing antecedent.

Also, are they really the same thing?
https://gist.github.com/Kenna-Blackburn/45bd00003ad1e25ef9cdedb1dc64201e
oh no! self doxxed!

→ More replies

1

u/Crafty-Meringue-6101 Jun 18 '25

Even in objects that already exist

I think that’s the most JS thing I’ve ever heard, though I can’t quite explain why.

Also why did you put classes in quotes? Swift does call them classes in pretty sure. Or are you lumping structs and enums (and I guess protocols too) in with ““classes””

By looked it up do you mean ChatGPT? Or no, you’re probably more of a Claude guy. Huh, never stereotyped someone’s LLM choice before, have I. Well you and u/No_Pen_3825 have fun, as it’s all you really can do. Lord knows you won’t come to a consensus. Curious to see who leaves first though.

!remindme 1 day
!remindme 5 day

1

u/RemindMeBot Jun 18 '25

I will be messaging you in 1 day on 2025-06-19 01:25:13 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


InfoCustomYour RemindersFeedback

1

u/LordFokas Jun 18 '25

Because you also can't read. I'm not talking about swift, I'm talking about JS, and JS doesn't have classes. The keyword is just sugar, it's all prototypes all the way down. That's also why changes to prototypes affect existing objects, it's not a JS thing at all, if you could modify methods in runtime in other languages I'm pretty sure existing objects would be modified just as well, because methods don't exist in the objects themselves.

I didn't say I looked it up, I googled it. I don't drink the LLM kool-aid. I can do my own research, thankfully. If you must know I ended up reading the official swift docs on extensions just to make sure I knew what I was talking about, even though I don't know the language. Looking things up is not reading some regurgitated LLM hallucination.

The only thing you're right about is that we're not going to reach a consensus. Mostly because reading is hard. But I'll leave that part, paradoxically, as an exercise for the reader.

1

u/Crafty-Meringue-6101 Jun 18 '25

It’s a JS thing because nobody from another language would point out that it acts globally.

Reading is indeed hard, as proven by me, u/No_Pen_3825, and you. I still don’t think you’ve understood what they’re trying to say. They’re saying they don’t like that JS puts everything on the programmer, to which you insightfully answered it’s not that hard to do everything manually. But that doesn’t mean they’re wrong or their argument/opinion is bad like you say, it just means they don’t like it and you don’t mind much.

Good on you not drinking to kool-aid (aide?), sometimes it’s nice to be wrong. I wonder if this LLM stuff will ever blow over.

1

u/LordFokas Jun 18 '25

Acting globally is a detail I added for completeness, it doesn't make it any more or less JS than anything else.

Ok so you're also not understanding my point, great. I said it's not that hard to extend a prototype, and that it's the same as making an extension in swift, and so if they don't like doing it by hand, they can just do the thing they already do in their choice language, with the same amount of effort.

Thanks for uncorrecting me.
https://en.wikipedia.org/wiki/Kool-Aid#%22Drinking_the_Kool-Aid%22

Perhaps if you didn't have LLMs chew everything for you, you wouldn't have issues understanding things as they're given to you, instead, you half read and half understand things, make up the rest, go out on a limb, and make a fool out of yourself.

Don't bother replying.

1

u/Crafty-Meringue-6101 Jun 18 '25

Don’t bother responding

How sweet. But truly, I don’t mind.

Wow, just as I was starting to like you, you pull something like this. Pardon the ad nauseam, but you’re not understanding mine. They don’t want to write the extensions idiot, they’d prefer the language already have them.

You’ve made the same mistake as I did, assuming the other uses LLMs, only you bet a whole lot harder than I did.

Don’t bother responding; I’ve blocked you. See, if you really want the last laugh, you’ve got to stack the cards ;)