this post was submitted on 01 Oct 2023
476 points (96.7% liked)

Programmer Humor

32464 readers
518 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 

The audacity to do such a thing…

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 23 points 1 year ago (2 children)

The reason I hate HTML: I've seen smart, reasonable people do this with IDs, and I'm not 100% sure they're wrong.

[–] jvisick 33 points 1 year ago (1 children)

That’s because it makes sense when dynamically creating HTML. HTML is not a programming language, it’s simply markup - so if you want to generate some block of HTML in a loop and later access that block of HTML in JS (e.g. to interact with the UI separate from creating it in the first place), it’s a completely reasonable thing to do.

[–] [email protected] 4 points 1 year ago

Agreed.

Also, HTML is only meant to be read by a browser's interpreter which has no problem keeping track of variable names.

[–] [email protected] 5 points 1 year ago

So long as the ID never repeats, it's cool