Tuesday, April 26, 2005

Hansleman's List: Strong Versus Weak Typing

More from Scott Hansleman's list of what great developers should know: "What is strong-typing versus weak-typing? Which is preferred? Why?" Weakly typed languages allow assignment and comparison between different types of variables, say between a short int and char or byte and char in C. Strongly typed languages don't allow such loose play. You have to either recast items, convert, or implement specific code to do such things. Which is preferred? Heh. Which is preferred in what context? would be the far better question. Developers working on operating system calls or embedded systems would most likely tell you they don't want the overhead associated with strong type checking because they're doing fine-tuning of some complex code. Hansleman's question here is obviously (to my view) biased in wanting the interviewee to take the side that strong-typing is best. That may be the case in some instances, but not all. Strong typing certainly helps to cut down the number of bugs due to its restrictive nature, but it's not the right answer in all cases. See the terrific discussion on this topic by the driving force behind Python. There's some great discussion in the interview. Pay close attention to the portion about rapid prototyping. Very interesting...

No comments:

Subscribe (RSS)

The Leadership Journey