In 2001 I witnessed five Java devs (all with over a year of experience) huddled around a desk looking at a line of code like this:
int x = foo?bar:baz;
"Question mark and colon aren't legal characters in variable names!"
"They must be. The code compiles!"
"But where is this symbol defined? How can it be in scope here?"
"The code compiles, but it doesn't work, right? It must be a compiler bug!"
That's the risk of learning a language "on the job" or from piecemeal tutorials, instead of reading a book or similar resource from start to end. Sometimes there's a corner of the language that by chance you just haven't seen yet, even after years.
A very junior dev once called me over for help with some JavaScript.
Going through his code, all his numbers were in the form of 1,234,567 with coma place separators. The code worked somewhat purely by accident. It took a surprising amount of convincing on my part to have them understand that wasn’t a thing they could do in JavaScript.
"They must be. The code compiles!"
"But where is this symbol defined? How can it be in scope here?"
"The code compiles, but it doesn't work, right? It must be a compiler bug!"
That's the risk of learning a language "on the job" or from piecemeal tutorials, instead of reading a book or similar resource from start to end. Sometimes there's a corner of the language that by chance you just haven't seen yet, even after years.