Tuesday, June 19, 2007

On the difference between knowing syntax, and understanding a language

I think some readers missed a subtly embedded point near the heart of my last post, that by elucidating, only further goes to demonstrate the difference between knowing something and understanding it.

C++ is strongly typed language. This I understand. It means its the job of the compiler to track the types of variables, and refuse to compile statements that violate the declared types, and thus possibly do something dangerous. In fact this is the entire purpose of the const keyword: "this data should never change, so please don't compile any other statements that may change it".

Code refusing to compile due to incorrect syntax is exactly the required behavior. The purpose is to inform the programmer that they are doing something wrong. (Read closely now.) Even if one is entirely, completely, and utterly ignorant of the correct answer to the below question, the compiler will always give you the right answer, by design, while you are working.

So tell me what the point of the question was??

1 comment:

OJ said...

I think that in the case of the company who interviewed you, they were probably testing your knowledge of C++. Sure, it's not an ideal question, and one that I don't feel would give you assurance of the person's ability as a programmer if they got the question right.

I thought your post was focussed more on your view of frustrating and unnecessary questions rather than demonstrating that knowing and understanding are two different things.

For the record, I do agree. A syntax regurgitator isn't a programmer. But syntax, and knowledge thereof, is an important element of a programmer's toolbox.

Also, thanks for teaching me a new word: elucidating :)