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 ... 209 210 211 212 213 214 215 216 217 ... 371  | » ]
Achilleas Margaritis

Posts: 674
Nickname: achilleas
Registered: Feb, 2005

Re: Programming with "Duh" Typing Posted: Jul 20, 2007 8:00 AM
Reply to this message Reply
Advertisement
> > 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.
>
> I see the documentation burden on dynamic languages being
> much higher because the variable declarations in a static
> language are a form of automatic documentation. For
> example, in java, if I'm looking at someone else's code
> and I see
>
> Map<URI, Date> dates = someObject.getSomething();
>
> I immediately know that the dates variable is a Map of
> Dates with URI as the key. If I haven't forgotten what
> the usual methods are on a Map I immediately know what
> methods I can use if I need to modify the code.
>
> With a dynamic language I'd have to trace back through the
> code to find what methods I can use on that object.

But what kind of dates does the variable 'dates' represent? it's not visible from the code you posted. Perhaps you meant to write it like this:

//dates that the products were shipped
Map<URI, Date> dates = someObject.getSomething();


But then you placed a comment in it! if that is not documentation, I don't know what it is.

Flat View: This topic has 370 replies on 371 pages [ « | 209  210  211  212  213  214  215  216  217 | » ]
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