this post was submitted on 27 Jul 2026
1125 points (99.2% liked)
Fediverse
43141 readers
1970 users here now
A community to talk about the Fediverse and all it's related services using ActivityPub (Mastodon, Lemmy, Mbin, etc).
If you wanted to get help with moderating your own community then head over to !moderators@lemmy.world!
Rules
- Posts must be on topic.
- Be respectful of others.
- Cite the sources used for graphs and other statistics.
- Follow the general Lemmy.world rules.
Learn more at these websites: Join The Fediverse Wiki, Fediverse.info, Wikipedia Page, The Federation Info (Stats), FediDB (Stats), Sub Rehab (Reddit Migration)
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Expert dev. Doesn't even know the attribute for setting the language in the script tag is
type, notlang. Not to mention that you are encouraged to omit the attribute altogether if the script tag contains JavaScript...Petty, and a bad dev. Big yikes.
The random strikes me as curious too. I don't see the point in doing
(100 - 1 + 1), you could express a random number between 1 and 100 in a simpler manner. Then he gets another random number and reuses that three times, for whatever reason.Then again, none of his other decisions make much sense to me so why would this?
Yeah the
- 1 + 1was weird to me too, serves no purpose.I can see how choosing a new random number for each fetch would prevent the server from caching the response, I suppose.
I can't imagine this code was written in any other fashion than completely rage-induced, with shaking fingers and high blood pressure. 😂 What a putz.
lmfao
I've drunk coded before (gotta hit the Ballmer Peak) but I don't know if I've ever rage coded before.
I guess it's just a pattern to easily get a number between
aandb, going(b - a + 1). Or maybe this is just vibecoded lolSeeing
(100 - 1 + 1)definitely bothers my brain lmaoLooking closer, the whole calculation bothers me now. Why do
floor() + 1instead of just usingceil... arghhhhWell the
scripttag has a deprecated attribute calledlanguage, so in older code and media you will see<script language="javascript">a bunch. The weird thing is they instead used thelangattribute which just doesn't exist.Uh huh. Exactly.
To be fair, it's not as if it supports languages other than fucking Javascript anyway, so it mostly doesn't matter.
Edit: I don't want to split hairs about modules or json or whatever; I just want to be salty about how we could've had Scheme or Python in the browser.
We could have had VM languages also like C# and Java and had web that was actually fast.
The
typeattribute is not only to specify the language. It's like one case out of several. It definitely matters in those contexts where you want to do the other things you can do with thetypeattribute.Actually some sites do. Instagram uses
type=application/jsonto store preloaded data.There used to be a
languageattribute, but I don't think I've ever seenlangbefore.The lang attribute exists for other elements, but not on the script tag. 👍