cover image by Libertinus Yomango
also despite writing Markdown every day for the last three years, I messed up the link above in v1 of this article
So, I'll admit it: sometimes I forget basic syntax. I think what gets me is the semicolons inside the parentheses. I feel like they should be commas? I don't know.
The point is that when I write for loops:
let str = '';
for (let i = 0; i < 9; i++) {
str = str + i;
}
I always manage to mess up just enough that it's better to grab the syntax from the MDN than it is to write over again.
And really, it feels like a shameful admission but I don't feel embarrassed. H*ck I do stuff like this on my livestream and I don't think there's any reason that we shouldn't copy and paste basic syntax.
This is a place of honesty, take a moment to admit your not-so-shameful 'shameful secrets' about the reality of working in tech.
Oldest comments (29)
Hey, where is the content?
This is a discussion post! I'm asking you and other readers to comment back :)
Ok, sorry for the comments. I was hoping for an article about this, I would be interesting!
Proud of you lol
I keep the syntax for C# and VB for each loops on a post-it on my monitor!
SAME. I have to google it for JS and Ruby because there are different forms and they are similar, but just different enough that I get them all mixed up between the two languages. 🤦♀️
yeah I think this is what gets me: I write a little bit of Ruby, Python, and JS. It's that language confusion that gets me. When I write C# for games I'm much more confident since the syntax is so different!
I would always delete robots.txt from whatever web boilerplate I was using. I didn’t know what it did and thought it was creepy
This is a real one
technabob.com/blog/wp-content/uplo...
I usually let my IDE do that for me nowadays. typing "for" brings up an autofill for all the different ways to type a
forloop, it saves a trip to my browser and back. No guarantees if I could type it from memory..!how do you that hehehe
It depends on which editor you're using. for webstorm (IntelliJ), by default can type
fori:for (let i = 0; i < ; i++) { }forin:for (const item in arr)for (const item of array) { }typing "for" for brings up this tooltip, I can select with arrows and press tab for it to autocomplete. if you remember which template you want, you can just type eg "fori" + tab without waiting for the tooltip to show up.

It's also similar in vscode. iirc, typing
forwill give you a bunch of options for the different iterators.nice thanks man! awesome
your IDE will have a bunch of different ones. worth having a look wherever they're located in for other useful ones :)
I write SQL, VBA, js, python and c#. Remembering the syntax difference is not worth the mental overhead when the internet will give you a copy paste answer in 30 seconds. What does wind me up though is the lack of wildcard consistency in the Microsoft stack.
Anyone got any other wildcards?
I keep learning and relearning javascript over and over and over. I remember one time, it was a simple integration of a theme we bought for our dashboard. I was assigned the task of modifying one css class and ... it became the next three days css-ing. Respect to frontend developers.
So don't use explicit loops 😅
The best part of using this instead of a for loop: you'll never remember what you're supposed to search for on Google, so you'll be forced to memorize the pattern!
Maybe this way of doing could seem a little overkill but has advantages :
Not overkill in my book. I'm a fan of Elm and F# and Haskell. I think this kind of FP approach will supplant OO in time.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.