Comment on Pure Evil
seitanic@lemmy.sdf.org 1 year agoProgrammers who care about best practices. Here are a couple of scenarios where not using a semicolon will bite you in the ass.
Comment on Pure Evil
seitanic@lemmy.sdf.org 1 year agoProgrammers who care about best practices. Here are a couple of scenarios where not using a semicolon will bite you in the ass.
newIdentity@sh.itjust.works 1 year ago
seitanic@lemmy.sdf.org 1 year ago
~95% of the JS code you see on the Web has semicolons. Apparently, a lot of programmers think it’s worth that extra keystroke to avoid these types of bugs. I agree with them. The difficulty with programming isn’t “Arrgh, there are too many keystrokes, my hands are tired!” It’s “Arrgh, HTF did this bug get in here?!?”
rockSlayer@lemmy.world 1 year ago
They made it a named function, but this is literally how you format anonymous functions in js, a key feature that usually gets called with an
onclick
call in the html domain.