Cedric Beust
Posts: 140
Nickname: cbeust
Registered: Feb, 2004
|
|
Re: Programming with "Duh" Typing
|
Posted: Jul 26, 2007 10:01 AM
|
|
> But it does not mean anything that the code passed > compiling. You have to run it afterwards, haven't you? and > that's my point: since you are going to run it, why bother > with static typing and even compilation? just run the > program and correct it as you go. It's a much more > rewarding experience.
Achilleas, I mean no offense, but at this point, it just seems like there is an uncrossable gap between you and people who are trying to show you the benefits of statically typed languages. I'm seriously running out of ways to phrase my arguments, but I'll try one more:
Statically typed languages allow you to write less tests.
Surely, that's something that you can see value in?
When you rename a function in a dynamically typed language, you'd better hope that all your existing tests exercise all the possible code paths that might invoke that function, or you just broke your code in ways that might not be apparent for months (or even after shipping).
Not only is writing these tests extra work for you, it's also error prone since it requires human intervention: you need to understand the code you are refactoring.
Renaming a method in a statically typed language requires zero tests. Once the refactoring is over, you know for sure that your code is just as correct as it was before, and that's a certainty you can never have with a dynamically typed language.
As much as I enjoy writing tests for my code and thereby guaranteeing that my program is working as intended, the less tests I write, the more time I have to write code that might benefit my users more directly (or play World of Warcraft).
-- Cedric http://testng.org
|
|