Is it common? Does it happen to you too? Share your most embarrassing story.
I've been programming for four decades, and after all that time I still say the #1 skill good programmers have is the ability to research, looking stuff up as they need it.
You cannot possibly remember every little bit of minutia, and as Dean Witcraft said the more languages you know the more this is true.
There is no shame in having to look something up. That's just part or the trade. Same as how there's no shame in asking questions. As I said recently in another thread smart people go look things up or ask for help when they don't know something.
"Ignorant" isn't an insult, it just means you don't know. You can fix ignorant.
A month or so ago, I was trying to split a string, but no matter what that string had in it, the split method just returned
undefined. I spent 2 hours trying to figure out why I couldn't get it to work. I finally posted on a Slack team asking why it wasn't working. Turns out, I was using square brackets instead of parentheses for no discernible reason. It was pretty embarrassing, especially considering how long I've been writing JS.
The more languages you know the more often you will refer to documentation for syntax. Very few people have the opportunity to code constantly enough to hold syntactical differences in their minds. As you start to take on broader responsibilities for solving problems outside of the code, you will write less of that code and use documentation more.
I couldn't agree more with Dean Witcraft. I have been writing styles using less for last 1-2 years. Recently, someone asked me the syntax of calc in vanilla CSS and I had no clue. Here's why:
width: calc(~"100% - 200px");
width: calc(100% - 200px);
I think it's absolutely OK to blackout and there's nothing embarrassing here. 😀
This is very common from what I've observed. The more experience you get, the more you learn, the more there is to do, the less you will care about remembering every last bit of syntax 100% of the time ;)
Most embarrassing story: under live-coding interview stress, I was trying to update an attribute and forgot the name of jQuery's
.attr(). Very embarrassing! I got the job though. A related take-away is that a job interview is a really bad place to pair program for the first time in your life.