Steven D'Aprano <[EMAIL PROTECTED]> writes: >> My gut reaction is that it's a wash. The time taken to declare >> variables in well-written code in a well-designed language - meaning >> the declarations and use will be close together - isn't all that >> great, but neither are the savings. > You've gone from thinking about the implementation of the algorithm to > thinking about how to satisfy the requirements of the compiler. As > context switches go, it isn't as big as the edit-compile-make-run > method of testing, but it is still a context switch.
I'm making context switches all the time when programming. I go from thinking about the problem in terms of the problem, to thinking about in terms of programming language objects, to thinking about the syntax for expressing those objects. Adding another one does have a cost - but it's no big deal. > I don't know whether there are languages that will check everything in > that way. If there aren't, then perhaps there should be. But Python > shouldn't be one of them. Right. You're doing different things when you program in a language like Python, vs. Eiffel (which is where I drew most of my checks from). Each does what it does well - but they don't do the same things. > Specifying every last detail about the objects making up the space > shuttle is one of the reasons why it costs umpty-bazillion dollars > to build one, and almost as much to maintain it -- and it still has > a safety record worse than most $10,000 cars. As if a something that's designed to literally blow you off the face of the earth could reasonably be compared with an internal combustion engine that never leaves the ground for safety. The shuttle has one of the best safety records around for vehicles that share it's purpose. It's doing something that's inherently very dangerous, that we are still learning how to do. Overengineering is the only way to get any measure of safety. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list