Home arrow Home arrow Learning a New Language  
Sunday, 05 February 2012  
Latest Forums
Learning a New Language PDF Print E-mail
(1 vote)
Written by Andreas Haberstroh   
Wednesday, 27 February 2008

"Learning something new will involve using something old."

Over the years, I've been asked some compelling questions in interviews. Questions that required me to think, and think quickly, before I answer. In one interview, I was asked: "If you had to learn a new language, how would you do it?"

Hmm. The clock was ticking. It was an interesting question. Over the years, I've worked with various languages. I've even written my own language. So, where would I start, if I'm going to learn a new language. My first thought was: What do I know about computer languages to start with?

 

So, I listed in my mind what every computer language that I know has:

  • Variables
  • Expression composition
  • Logic statements
  • Loop statements
  • Functions
  • If it's an OOP language, classes
  • Runtime library

So, I started with variables.

“Every language has to have them. Now, the question is, how is the variable expressed. Or, more to the point, what is the value type of a variable. In C / C++, variable types are part of the definition statement. In PHP, variable type is defined by their first usage, whether it's a string or ordinal. Almost all languages use the same expression syntax, coming from the mathematical realm in computers live. Logical statements include the ability for if/else, switch statements.... “

Then, I got cut off in my explanation. Right in mid stroke. The interviewer stated, “Well, you have given this some thought, and your answer seems to reflect that. Now, what do you think about Java?”

Now, that bewildered me. Isn't this a C++ job? Am I interviewing for something else? Hell, for that matter, am I at the wrong place?

So, my explanation for that one was really simple. Knowing a computer language is not just about syntax or semantics. There are also some deeply embedded concepts in a language. These have to do with common definitions of words and how one uses them. Let's take exception handling for example. To me, the word exception means that the event is outside the normal scope of events. It is unexpected behavior. Java deals with error handling via exceptions. In C / C++, errors are passed back by a function. They give a pass or fail code. For instance, opening a file can fail for a number of reasons; file not found, file locked, etc. These are all normal expected failures. But, while reading from the file, something may happen that is totally unexpected. That would be an exception. In Java, everything is an exception. So, what is the true meaning of an exception in Java?

Then, I figured it out. The test was to see if I was really a C++ programmer, or a convert. Touché! The subtleties of a true interviewer.

Comments
Add NewSearch
Write comment
Name:
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
 

Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved.

Last Updated ( Saturday, 14 November 2009 )
 
Top