Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven!ni.umd.edu!uc780.umd.edu!cs450a03 From: cs450a03@uc780.umd.edu Newsgroups: comp.lang.misc Subject: RE: Dynamic typing (part 3) Message-ID: <21MAR91.23594992@uc780.umd.edu> Date: 21 Mar 91 23:59:49 GMT References: <815@optima.cs.arizona.edu> <20MAR91.08580313@uc780.umd.edu> Sender: usenet@ni.umd.edu (USENET News System) Organization: The University of Maryland University College Lines: 61 Nntp-Posting-Host: uc780.umd.edu Peter da Silva's comments are > and >> > Mine are >> >> >This is fine if the code is: Known to be correct and >> >debugged, and/or Your code, and You wrote it recently, >> >or You just finished tracing it all and thus know it intimately. >> Hmm... I spend a lot of time debugging and upgrading old code. [etc...] >You're over-generalising my response. I am talking about the particular >case where you know what the "type" of a value is because of the immediate >context assuming that the usage is valid. I don't: I have to look at a >declaration or look at more than just the immediate context. Gack! I think I know what you're saying. I think that the types that I deal with are much simpler than the types you deal with. Or maybe I should say that each variable has its own unique type? Essentially, I deal with: character, integer, bit, file, function, and homogenous collections of each, there are also rare hetrogenous collections, and not-so-rare relationships between data of different type in different variables. Generally, each assignment to a variable is unique. (I try not to re-assign, and when I do, I try and make sure re-executing that section of code would not cause a problem). Exception made for loop counters, but not for other assignments made within the loop. So I suppose you could say I'm writing using a static typing style of coding. But if I had to have a separate declaration for each assignment, well, that would increase my code size by 50-70% right off the top (probably more, if I constructed C-like structs for each assignment I make). Not to mention it would probably triple the number of 'library routines' I'd need to deal with. All this for what? To make sure I'm protected from 'making mistakes'? Or, maybe to make my code "more efficient". Or, is someone going to try and claim that my code would become "more understandable"? >> Oddly enough, I rarely have to trace it. >I didn't intend imply that you have to. What I mean here is that >*unless you have* traced it you can't look at a random piece of code >and know the types of all the objects being dealt with. The ones >you're familiar with, yes. If it's being used with addition, it's probably gonna be a number. If it's being used with string search, it's probably a string. If it's being used with logical and it's probably a boolean. If that doesn't apply to your language, then maybe typing isn't strong enough in your language. >[the only useful comments are] >> the ones that identify the purpose of the function, or perhaps the >> purpose of a variable. >That is, type declarations. Hmmmm. Yeah, type declarations. Neither dynamic type declarations nor static type declarations, but descriptive type declarations. A feature supported in every language I've ever heard of (even machine language). Raul Rockwell