The Artima Developer Community
Sponsored Link

Weblogs Forum
Programming with "Duh" Typing

370 replies on 371 pages. Most recent reply: Aug 8, 2007 9:54 AM by James Watson

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 370 replies on 371 pages [ « | 1 ... 207 208 209 210 211 212 213 214 215 ... 371  | » ]
Achilleas Margaritis

Posts: 674
Nickname: achilleas
Registered: Feb, 2005

Re: Programming with "Duh" Typing Posted: Jul 20, 2007 7:51 AM
Reply to this message Reply
Advertisement
> I disagree. There are no perfect tests. I can make
> changes in a static language that require no testing. I
> know they will not break anything and they do not. With a
> static language testing is required mainly at the end of a
> unit of work. With dynamic languages, testing is required
> pretty much after every trivial change. Otherwise, it's
> easy to become hopelessly lost.

The only changes that do not require testing are the very trivial ones, which is a very limited set of changes.

>
> Functional testing is required for any application but I
> am not talking about that. I'm talking about testing just
> to capture typing errors or anything else that a static
> language will tell you you have done wrong. If you are
> waiting until functional testing to verify that you
> haven't fat-fingered anything, then perhaps we have
> different ideas about functional testing.

But you can't be sure, even with a static type system, that your code is correct. For example, an int erroneously converted to short can create great problems. Only functional testing can reveal the problems.

>
> > The documentation burden is also equal in both cases.
> Even
> > with static typing, types do not tell us anything about
> > how the variables are used, so they have to be
> > documented.
>
> The types have to be documented. But I don't need
> documentation to know what the expected types of a given
> methods arguments are.

Actually, you do. Declaring a function to take type 'int' does not say much. You need to document, for example, if that integer is to be used as an index in an array, if negative values are valid, what will happen if I pass 0, etc.

>
> > Personally I document every variable and member
> > attribute/method of my classes either in Java or C++.
> It
> > feels incomplete if I do not do that.
>
> But in a dynamic language you should be documenting every
> variable in addition to the above.

But I already said "I document every variable". I do not see any additional work.

Flat View: This topic has 370 replies on 371 pages [ « | 207  208  209  210  211  212  213  214  215 | » ]
Topic: Programming with "Duh" Typing Previous Topic   Next Topic Topic: Python 3000 Plea for Help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use