Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: "wooks" <wookiz@xxxxxxxxxxx>
- Date: 9 Jan 2006 07:43:01 -0800
Gerry Quinn wrote:
> In article <1136648171.253255.116760@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
> wookiz@xxxxxxxxxxx says...
> > Gerry Quinn wrote:
>
> > > > Most Java(any imperative language) programmers will instinctively opt
> > > > for an iterative solution and will only use recursion when they are
> > > > forced to.
>
> > > If that's the point, it's not a very good one. A language that allows
> > > you to pick appropriate solutions is better than one that forces you
> > > into unsuitable ones.
>
> > The problem is with your conception of "appropriate" and unsuitable.
> >
> > Lists (or some derivative thereof so that includes arrays, stacks,
> > queues) are just about the most common and useful data structure in
> > computer science. How can you possibly class a recursive solution to
> > processing a list as unsuitable and inappropriate. It actually is the
> > best and most natural fit for the processing lists like structures for
> > the simple reason that a list is in fact a recursively defined data
> > structure.
>
> Complete nonsense.
>A list is a data structure, and different means can
> be used to define it.
The floor is yours. Give us your definition.
> Recursion is useful in mathematical definitions,
> but programming is not math. But even if there is no better way than
> recursion to define an ordered set, that does not imply (as you imply
> above) that recursion is in every possibly situation the best way to
> process it.
Of course a variety of hacks are at your disposal especially if you are
programming in something like Java.
> Many languages are suitable for the implementation of both
> recursive and iterative methods.
>
> > There is nothing suitable or appropriate about stating
> >
> > y = y + 1
> >
> > because it quite obviously isn't true. It makes no mathematical sense
> > nor would it make sense to the man in the street. It's just the
> > perverted way in which many programmers go about effecting iteration.
> > Just because thats the way they easily understand whats going on
> > doesn't mean there's anything suitable or appropriate about it.
>
> Actually it is an example of recursion. A function (+1) is called
> repeatedly to modify y.
>
no it's not.
> Iteration usually looks like:
> for( int i = 0; i < maxVal; i++ ) {}
>
> ..or
>
> for ( iterator i = begin(); i != end(); i++ ) {}
>
Right now tell me the difference between i++ and i=i+1?
BTW none of these techniques are available in XSLT. What then?
> The above succintly indicate that all elements of a set are to be
> processed, and the sequence in which this will occur. The first
> includes a counter, which is often very useful.
>
But it isn't so succint when some of the elements of the sets are sets
themselves. And supposing this nesting could be n levels deep. What
then?
> > The fact is the mental model humans adopt to doing iterative things is
> > a recursive one.
> >
> > Whether it's a 2 year old toddler, middle aged man or 90 year old
> > woman, if you put them at the bottom of the steps and ask them to climb
> > to the top they do they
> >
> > start by counting the number of steps,
> > climb a step,
> > then say steps climbed = steps climbed + 1,
> > then compare steps climbed to the total number of steps.
> >
> > or do they
> >
> > climb(steps)
> > if no more steps stop
> > go up the first step
> > climb (rest of steps).
>
> Once they have learned to walk and count, they do what is best in a
> given situation. But I would say that they normally do:
>
> go to bottom of stairs
> if ( at top ) stop
> climb next step
> repeat
>
> This corresponds best to my second example of iteration.
>
Whats the difference between your "repeat" and my clim(rest of steps).
> > > Then the solution is to practice the techniques, but there's no need to
> > > abandon Java in favour of a toy language that is limited to them and no
> > > other.
>
> > You are confusing popularity with capability and power!! Just because
> > Java gives you 3 different ways of writing loops in addition to
> > recursion do you think that makes it more powerful.
>
> Yes. And it's nothing to do with popularity.
>
> > Lets not even talk
> > about things like higher order functions that Java doesn't even
> > support.
>
> If functional languages were so great, people would use them. That is
> the 'popularity' argument, and it is quite a valid one.
>
It's got alot to do with the same reasons why there isn't a
Lisp/Scheme/Haskell/ML for Dummies/Idiots etc. They require a fair
degree of mathematical sophistication.
Nevertheless here is an opportunity to better inform yourself.
http://portal.acm.org/citation.cfm?id=286387
> > The main reasons why imperative programming languages are in more
> > widespread use have nothing to do with them being better suited for
> > "real work", or being "serious languages". It's because they are
> > accessible to the mathematically unsophisticated which is a
> > description that probably applies to the majority of people employed
> > as programmers today.
>
> In other words, they are suited to real work by real people. And
> frankly, if a language is easier to use for ordinary folks, it is
> probably easier to use for everyone.
>
Can you drop the "real" nonsense.
There are alot of ordinary folk writing crappy buggy software that
keeps crashing.
The ordinary "real" arguments are fine if you are solving a genuinely
simple problem.
Ordinary "real" folk didn't create the language that enables you to
come here and say what you are saying today. Check out the role that
Guy Steele had in inventing Java. Steele was an MIT student and one of
the inventors of Scheme.
> > The whole point Spolsky is making is that teaching people in Java means
> > that the odds are they won't practice these techniques in the first
> > place.
>
> And it's the same half-baked point that has been made for millennia,
> when those who consider themselves as members of an intellectual elite
> get worried that their inferiors are achieving much the same things as
> they can, without having bothered with the elaborate membership
> initiations. "They must be stopped", they wail. "How can the sacred
> work be left in the hands of ignorami?".
>
What has that got to do with whether Java programmers are well
practised in recursion.
> > > > Misses the point again.
> > > > The ability to think recursively is an important skill for a programmer
> > > > and indeed problem solvers at large.
> > >
> > > Yes, it's very useful. And you can learn it from Java, or Basic for
> > > that matter.
>
> > But the fact is your average Java programmer can't parse an abritarily
> > nested regular expression and can't grok XSLT because they ain't used
> > to thinking recursively. Why. Because they work in languages that lets
> > them work around having to.
>
> When they need to learn it, they will.
What you really mean is that they'll continue with their buggy
iterative hacks.
How can you know when it is appropriate to apply a technique that you
haven't even learnt.
> Hopefully employers will choose
> to hire staff capable of doing or learning to do what they need,
> whether that includes the above things or not.
>
Thats why Spolsky wants to hire people that can write Scheme/Lisp,
because he can be assured they have the necessary capabilities.
.
- Follow-Ups:
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Gerry Quinn
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Chris Dams
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- References:
- Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Casey Hawthorne
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Gerry Quinn
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: wooks
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Gerry Quinn
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: wooks
- Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- From: Gerry Quinn
- Interesting article by Joel Spolsky: The Perils of JavaSchools
- Prev by Date: Re: which PC for software development?
- Next by Date: Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- Previous by thread: Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- Next by thread: Re: Interesting article by Joel Spolsky: The Perils of JavaSchools
- Index(es):
Relevant Pages
|