> I am assuming that you had a compiler or IDE in this situation providing a useful error message.
Yup. I prefer to give candidates compilers/IDEs and even access to google if they ask about it. Like I said, I'm not trying to trick them or anything, I just want to know if they can code.
> If you were whiteboard coding and you were telling the candidate "you have a syntax error but I won't tell you where"
I'd hate being on the receiving end of that and would never pull that sort of stunt. The software we use allows both sides to edit the code and I pretty regularly will go in and silently fix syntax errors for a candidate so as not to let a compile/refresh loop get in the way of actually solving the problem.
Like, what does "You have a syntax error" even prove? I'd let you write pure pseudo code so long as it makes sense.
I've been writing code for pay for more than 20 years and will forget basic syntax and keywords for a language I wrote hundreds of lines in yesterday without other code to crib off of, IDE assistance, and/or reference material (google, whatever). Like, I'll forget if it's "else if" or "elsif" or "elseif" or "elif" or whatever. Or I'll mix up how to access hash/list members. How to designate a constructor. Stuff like that.
> I am assuming that you had a compiler or IDE in this situation providing a useful error message.
Yup. I prefer to give candidates compilers/IDEs and even access to google if they ask about it. Like I said, I'm not trying to trick them or anything, I just want to know if they can code.
> If you were whiteboard coding and you were telling the candidate "you have a syntax error but I won't tell you where"
I'd hate being on the receiving end of that and would never pull that sort of stunt. The software we use allows both sides to edit the code and I pretty regularly will go in and silently fix syntax errors for a candidate so as not to let a compile/refresh loop get in the way of actually solving the problem.
Like, what does "You have a syntax error" even prove? I'd let you write pure pseudo code so long as it makes sense.
I just don't like "mind games" in interviews.