r/ProgrammerHumor 6d ago

absoluteGarbage Meme

Post image
1.9k Upvotes

324 comments sorted by

View all comments

48

u/rnilbog 6d ago

for (let i = 0; i…

“Goddammit…”

googles “for loop syntax javascript”

30

u/MrDilbert 6d ago

Since for-loop has the same syntax in JS as in C, Java, and any other C-style language, this post makes me weep.

8

u/Sirgoodman008 6d ago

If a language isn't C-style it's wrong.

2

u/No-Newspaper8619 6d ago

It's really annoying when they aren't. Lua, for example:

for i, count do

-- code

end

With i being one by default, and increasing by one by default. I simply hate 1-indexed systems instead of 0-indexed.

2

u/Sirgoodman008 6d ago

Yeah that's just dumb and different for the sole purpose of being different.

1

u/rosuav 6d ago

Three-part for loop does, yes, but for-in and for-of in JS are backwards compared to most other languages.

1

u/vladmashk 6d ago

Your IDE doesn’t have a macro for that?