|
Re: Programming with "Duh" Typing
|
Posted: Jul 30, 2007 9:24 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. > > > > Here's to hoping that you never have the job of writing > > the software that runs an autopilot for an airplane. Or > a > > pacemaker. > > I actually am involved in defense programming (for > THALES). The customer does not accept the code unless it > is accompanied by a receipt that 100% of it has been > tested functionally. > > I know it's boring to write test cases, and I can tell you > I have been caught tearing my fleshes many times over test > documents 100s of pages long (even documents split in > several parts!). And let me say it again: it's boring! > > But big companies like THALES, Raytheon etc do not accept > code that has not been fully tested and for all cases and > possible values. You can't release C++, Java or ADA code > that has not been fully tested beforehand (and in many > cases, tested by two or three individual teams). > > I think the above fact speaks for itself about the value > of static type systems vs functional testing!
It speaks nothing of the value of static type systems over functional testing.
If you've paid attention, the primary arguments, at least as posed by myself and James Watson, have been centered around how static typing saves time by: (1) Catching typos (2) Automating Refactoring (3) Increasing code clarity
If I mispell a function name in a dynamic language, I have to wait until something causes that codepath to be executed before I find that error. Yes, eventually it will be found. But it can take a long time to do it.
Also, you have to remember that a lot of programming may go into a piece of software during system concept development before it becomes millions of lines of Ada.
So let's say a systems engineer thinks he has a brilliant new nueral network architecture to use to distinguish troop transports from school buses. Long term the NN may be in software, an FPGA, an ASIC, or even some hybrid approach. But for now the engineer wants to figure out if it will actually work, so he codes it up in his favorite language and sets it to work on training data.
A day and a half later the thing bombs out because in a rarely executed branch he typed inptu_vector instead of input_vector.
That's not exactly fun...
In a statically typed language the error would have been caught. Any decent Java IDE would have underlined it as soon as it was typed.
|
|