---------------------------------------- > Date: Mon, 7 Jan 2008 01:32:51 -0800 > From: [EMAIL PROTECTED] > To: [email protected] > Subject: Re: Introducing Cobra > > Gabriel Sechan wrote: >> ---------------------------------------- >> >>> Date: Mon, 7 Jan 2008 01:16:23 -0800 >>> From: [EMAIL PROTECTED] >>> To: [email protected] >>> Subject: Re: Introducing Cobra >>> >>> Gabriel Sechan wrote: >>> >>>> ---------------------------------------- >>>> >>>> >>>> I could not possibly disagree more. The most important part of an >>>> algorithm is what data it uses. And the *MOST* important feature of a >>>> variable is its type. >>>> >>> Well, the latter is only true in language where variables *have* types, >>> which some would argue is where the mistake lies. ;-) >>> >> In the languages without types? I agree :) >> > No. In the statically typed languages.
Look mommy. There's a joke going by that man's head! >> Seriously, though. A variable *always* has a type, wether the language does >> or not. The type of a variable is the kind of data it holds. This is >> separate from its languae type. For example, lets say we have to store >> today's temperature. Its type is temperature in degree's celsius. Its >> language type may be scalar in perl, int in C++, etc. But its true type is >> still temperature in degrees celsius. Having a language that supports >> typedefs and declarations merely documents that for you, rather than forcing >> you to read the code to figure it out. >> >> You can't get rid of types, they're inherent in the universe- all data has >> a type. All you can do is not tell me wht it is. >> > I'm not talking about getting rid of types. I'm talking about languages > where the *variables* don't have types, which is a pretty common trait > of dynamically typed languages. > > With a dynamically typed language, you tend not to focus on the types of > your variables, but rather their roles (there is a difference), and of > course the role can and should be adequately described by the variable > name. Interestingly, knowing the roles involved in an algorithm is even > more telling than the data types. > Hmm. Did you actually read the paragraph above? I believe you and I are talking about the same thing. I disagree that name is sufficient- it can be shoehorned into being sufficient, but only by carrying far more information than it needs to. A data's type (or role- btw I like that term to distinguish them) tells you one piece of information. Its name tells you another. Its like the difference between a class and an instance of a class. The two facts can be combined in name, but you have an easier to read and more elegant solution by separating them. Then there's the readability concerns, as previously mentioned. Static typing is so much easier to read, maintain, and debug due to having that data expicit. Gabe _________________________________________________________________ Put your friends on the big screen with Windows Vista® + Windows Live™. http://www.microsoft.com/windows/shop/specialoffers.mspx?ocid=TXT_TAGLM_CPC_MediaCtr_bigscreen_012008 -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg
