|
When I first picked up programming it was in a language called scheme (one of the several flavors of Lisp). In scheme there are no types, in fact there are no variables. Everything is a function, so you really didn't have to worry about what type of data you were feeding it. You could make a function that could take in a single element, a list of elements, a list of lists of element, all in a single pass.
During my second quarter of college, I was force fed java. Suddenly everything has a type. Methods have return types and input types, variables had to be declared as either int, boolean, long, short, tall, red, white, whatever. I despised it at first.
Now I seem to like it so much that I don't really like it when a language lets you get away with not stating your intent immediatly. PHP for example will let you assign just about anything to a variable without declaring anything. $x could hold the int value 1 at one point then hold a string value or point to an object. When I see code that takes advantage of this feature I feel the need to say thats wrong, or at the very least not good coding.
Which do you guys prefer, strong or weak type checking.
|