From: Borislav I. <bor...@ko...> - 2004-07-05 18:23:10
|
The core argument for dynamic typing is actually one that I used to convince myself to rely on dynamically typed languages more and more: we need to test anyway so sacrificing expressiveness, readability and development speed for the illusionary safety of static type checking is simply not worth it. But he misses two important (related) points in favor of static typing: 1) When a mistake is detected "statically", at compile time, not only is a programmer informed about it, but the information is much more useful - you know where it is in the code, you can more easily associate it with a mistaken/misunderstood intent, program design/structure etc. In a sense, a semantic constraint is really reduced to syntactic one which is one level down in terms tractability by both humans and machines. 2) The rigor and expliciteness required by statically typed languages become increasingly important with program size. This is a consequence of the previous point: it is easy to track down a run-time exception when the program is small and the behavior can be easily localized within the code. For large systems, maintained and evolving over years by many programmers, the extra fingering and design contraints enforced by static typing can be life savers - ok, a test may detect that something is wrong, but how long before the programmer goes from the error produced by the test to the real problem? And what (how many?) changes to the code would that prompt? A problem I often have when programming with Jscheme is the error: "Expected pair or '(), but found blabla....". I know in what function this happens, I know where is the code expected the list, but god know where I put the blabla instead of it. The positive aspect is that this forces me to be much more attentive to the type of data I'm passing around, a habit I'd lost (or probably never really aquired) with languages like Java and C++. Cheers, Boris | -----Original Message----- | From: jsc...@li... | [mailto:jsc...@li...] On Behalf | Of Ken Anderson | Sent: Friday, July 02, 2004 4:43 PM | To: Jscheme Users | Subject: [Jscheme-user] Thinking about computing | | | This is Bruce Eckel's weblog: | http://www.mindview.net/WebLog | | He's written books on C++ and Java and now he's writing | Python, hates Java's checked exceptions, and likes dynamic typing! | | We should be able to make good use of his aguments. | | k | | | | ------------------------------------------------------- | This SF.Net email sponsored by Black Hat Briefings & | Training. Attend Black Hat Briefings & Training, Las Vegas | July 24-29 - | digital self defense, top technical experts, no vendor pitches, | unmatched networking opportunities. Visit www.blackhat.com | _______________________________________________ | Jscheme-user mailing list | Jsc...@li... | https://lists.sourceforge.net/lists/listinfo/jscheme-user | |