Kinda similar to https://learnxinyminutes.com/
I have the same problem you're describing, but it tends to be with languages I haven't used in a while.
I've also resigned myself to be ok with googling a lot of things:
"list comprehension python"
"typescript generic constraint"
"golang package visibility"
Once I got ok with this approach, I became a much happier and productive developer. Rather than beating myself up that I couldn't remember the details, I just "outsourced" said details to Google/StackOverflow and focused on the big picture.
As long as I grok the semantics, I haven't missed remembering all the syntax and idioms of each and every language.
I'm somewhat envious of my friends who stuck with one language like C, and are super proficient with the one or two languages that they know.
Does your experience confirm or deny this? That is, do you have much more trouble with languages you learned 5/10/25 years ago than ones you were using last month? Or is the process random, and you'll forget features of a language that you were just using?
Alternate hypothesis: you're getting old, and your memory is starting to go - nothing to do with programming languages in particular, the process is just more noticeable there because we have to remember so darn many little things.
Less depressing hypothesis: your brain has gotten out of the habit of remembering those things. I used to be extremely bad at remembering names, until I started paying attention to them because I learned that people really like it when you remember your name. Now I'm great with names without even trying, and I'm convinced that you can also train yourself to be better at remembering other things (i.e. programming stuff) than your natural tendencies.
Like, python oo is perfectly happy with "this" instead of "self".
I am stealing this phrase
In fact, I would happily hire any programmer for, say, a python or a C++ job, that knows nothing about the language in use but knows to ask precisely these questions. Bonus points for questions about function semantics and memory management.
Everything else boils down to syntax and ecosystem/tooling. The former is essentially irrelevant and the latter changes so often and is used differently in different contexts that there is little point in asking about prior experience.
If it's not too unusual, it feels similar to other tools you've picked up before. If it isn't it's interesting.
Something like:
"Oh, OK, Swift has a switch right? Yeah. Does it require me to explicitly break? Yeah. Can I give ranges or patterns?
That's cool, they use named parameters in Smalltalk style, probably comes from Objective C, right?
Nil! charming, like Golang or Pascal.
What do you call these ?. and !. 's? Reminds me a bit of ?. in JavaScript. It's nifty: you can enforce a value not being nil or specify a default..
Hmm, these guards are interesting, how do they work... Etc "
So obviously you need to get someone to check for footguns in your code, but after enough playing with toys you tend to get to a place you can write solid code in a new language very quickly, and where getting to a solid level of competence is relatively quick.
Anyway knowing many languages has some downsides, but in the end if you write the same one for a couple of months the problem of searching disappear. When you switch another couple of months and it's gone again.
I suspect the people watching who thought you didn't know a thing would probably be the ones too inexperienced to recognise what you describe.
I also suspect that every other programmer with 25 years of experience who can be productive using many different programming languages would immediately recognise and empathise with the feeling you describe, and they also have a search window permanently open while working.
> Anyone watching me work would probably think I don't know a damn thing.
I guess looking at the cheat-sheet would only confirm their suspicions. :D
Then we can focus on just one language to master and don’t have to keep in our heads a jumble of languages.
Now "optimally" is an entire can of worms because there are some aspects where you need to make mutually exclusive choices. You can optimize A or B but not A and B for multiple sets of A and B. So you'll end up with multiple languages or multiple flavors of a single language where decisions were made to optimize for varying sets of A and B. A and B can even be simple things like "How easy is it to footgun yourself?". Should you make code that is more boilerplate/difficult to write in order to prevent people from footgunning themselves or do you expect your developers to be more experienced and allow them to write more succinct code but having to be aware of and avoid potential footguns themselves? There are a lot of domain-specific languages for precisely the kinds of trade-offs are made that certain fields want/need. For example, mathematics domain languages tend to be 1-indexed instead of 0-indexed.
By the way that language is LISP.
[0] Just in case anyone is unfamiliar with Allman/K&R styles mentioned you can see examples on Wikipedia: https://en.wikipedia.org/wiki/Indentation_style
Mastering a language means not having to look up language features all 5 minutes.
-> you haven‘t mastered 15 languages.
Does it need parentheses or not?
How are closure variables managed? Do I need to release things?
Do lambdas require scoping braces or not? What's the damn syntax for them again???
Do I need to use case(X), switch(X), when(X), something else?
Do cases fall through or not?
How do I concatenate strings in this language again?
How do I get lengths in this language again?
Is it -> or => or functions? Are functions even first class? Can they be anonymous?
How did this language handle async operations again?
Anyone watching me work would probably think I don't know a damn thing. And after 25 years in the industry, I sometimes wonder the same thing.