Hacker News new | ask | show | jobs
by dkarl 2052 days ago
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.