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 ... 187 188 189 190 191 192 193 194 195 ... 371  | » ]
James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: Programming with "Duh" Typing Posted: Jul 18, 2007 7:24 AM
Reply to this message Reply
Advertisement
> > > > I make those mistakes a lot. Maybe it comes from
> > having
> > > a
> > > > compiler yell at me for them, and having IDEs
> > underline
> > > > them, so I'm just sloppy in my typing.
> > >
> > > You are going to run that code once, aren't you?
> >
> > This takes time. I've had a simple change take me 30
> > minutes to make in Python because I had to keep running
> > the code and find errors. It's much quicker to see the
> > error instantaneously and fix it.
>
> But you are going to run it afterwards, aren't you?

Yes. What's your point?

> >
> > I recently had a bug where one out of every few lines
> was
> > being iterated over as a sequence. This took me quite
> a
> > while to locate because I had added a faux-object in a
> > corner case. In a static language, It takes a few
> moments
> > to select all the references. I basically stumbled
> over
> > this by accident after about an error of looking in the
> > wrong places for the error. The error turned out to be
> > that I had declared one of the arguments to a method as
> > field instead of *fields. In a static language I would
> > know about this way ahead of time.
>
> Can you elaborate on the error?

The star means that the input is a sequence. I was passing a single string to the method. The method iterates over the field parameter. By removing the star, my string became the sequence that was being iterated over. If I were doing this in something where I could declare the type of field as a sequence of strings, a single string would not be an acceptable parameter.

> >
> > You are focusing on the quality of the finished
> product.
> > The point that I am trying to make is that dynamic
> > c languages can actually slow down development in the
> long
> > term.
>
> Not really. It is your approach that slows it down. The
> correct approach in dynamic languages is to run the
> program and correct it while it is running. Interactive
> development is way much faster than anything else.

It doesn't seem feasible for the program I am running. Could I stop it and back up the recursion to the point where I saw the problem?

Can I ask how much programming you have done in static languages?

Flat View: This topic has 370 replies on 371 pages [ « | 187  188  189  190  191  192  193  194  195 | » ]
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