set theory add up to a strikingly practical, and quite positive, reason
it on something useful to computer science, like linear algebra.
Well … maybe “Computer Science” students don’t need to know
trigonometry, but I doubt very seriously a trig-impaired person could
get an Electrical Engineering degree. Hell, if they didn’t have trig and
calculus and analytic geometry under their belts on the SAT, they
couldn’t get into a EE program!
I was actually one of the first students in the USA to get calculus and
analytic geometry in high school. This was right after Sputnik and I
lived in a town full of scientists and engineers. I was also fortunate
to have graduated before the “New Math”, which was mostly set theory.
So … would you say queuing theory is useful to computer science? I
certainly would. Well, it turns out, as we mathematicians like to say,
that you can use a Fast Fourier Transform to solve some queuing theory
problems that are more or less intractable otherwise. Can you do a Fast
Fourier Transform without sines and cosines?
Interesting. This is wild speculation of course, but I imagine you are
probably atypical as far as always using explicit stacks. (Since I get the
impression from your post history that you are heavily focused on
performance.). I would guess (more speculation ;)) that if someone were to
grab a set of programs that for instance walked an XML DOM (or a similar
day to day tree structure, like a nested directory) that the vast majority of
those programs would use recursion with implicit stacks. Now that I’ve
contributed that bit of unsubstantiated nonsense, I’ll resume eating my
dinner.
I am the very model of premature optimization. Unless the underlying
run-time has made a great effort to make (tail) recursion efficient,
like most Lisps, Schemes, and the core of Derive, it’s usually less
efficient than iteration and harder for other programmers to understand.
I’ve been quite fortunate in avoiding XML so far. I like my trees
with squirrels and blue jays in them, thankyouverymuch.
Perhaps Charles Nutter would comment on how efficient jRuby on the
JVM is at recursive code compared to MRI Ruby. I’d expect it to be
better, given that some Schemers were involved in the creation of Java.
On Sat, Jul 21, 2007 at 01:11:30PM +0900, M. Edward (Ed) Borasky wrote:
the in-built compatibility of zero-based arrays with certain concepts of
wasn’t 100% certain of your intent, based on what you said.
to CS students wasting time on trigonometry when they could be spending
it on something useful to computer science, like linear algebra.
Well … maybe “Computer Science” students don’t need to know
trigonometry, but I doubt very seriously a trig-impaired person could
get an Electrical Engineering degree. Hell, if they didn’t have trig and
calculus and analytic geometry under their belts on the SAT, they
couldn’t get into a EE program!
There’s a pretty big difference between “electrical engineering” and
“computer science”.
Fourier Transform without sines and cosines?
Maybe not – but my objection is more to the saddling of CS students
with
several years of trig and calculus classes than with the imparting of
any of the basics that are related to those subjects. The basics of
trigonometry as taught in a trig class, in fact, can be imparted to a
student quite thoroughly in about two class sessions – and it usually
is, in a preceding geometry or algebra course. Meanwhile, the rest of
what’s “taught” in typical college trig courses can be easily derived
from the basics, and is just rote memorization for the purpose of
passing
tests, to be forgotten immediately after the test in time to memorize
for
the next exam.
Meh. I have traumatic experiences of almost being entirely turned off
of
“higher education” by the stupidities of a computer science curriculum.
Your mileage may vary.
and recursion with an implicit stack. I’ve done a lot of explicit stack
probably atypical as far as always using explicit stacks. (Since I get the
impression from your post history that you are heavily focused on
performance.). I would guess (more speculation ;)) that if someone were to
grab a set of programs that for instance walked an XML DOM (or a similar day
to day tree structure, like a nested directory) that the vast majority of
those programs would use recursion with implicit stacks. Now that I’ve
contributed that bit of unsubstantiated nonsense, I’ll resume eating my
dinner.
I remember a funny use case of explicit stack handling now.
About 4 years ago I was writing an XML wrapper around the Python
tupleparser.
I started recursively, of course and very soon got completely lost, I
tried to undo the recursion so that I had full control over some
details on the call stack (things like cheating by examining the call
stack) never got anywhere but I have to admit it was good to have that
technique at my disposal.
If I recall correctly I would probably have used a recursive approach
with yield in Ruby…
But I agree these are rare exceptions and no reason at all not to use
recursion, a better design might have allowed for a recursive solution
too
I stand by my claim in spite of a pair of anecdotal reports. Don’t
make me survey your papers. (Actually, I can’t find many, if any,
publications for either of you. I’m not saying that means anything.)
On Jul 18, 10:44 pm, “M. Edward (Ed) Borasky” [email protected]
wrote:
Well … they are talking seriously about dumping Call/CC. How many
Ruby programmers, or, for that matter, C programmers, actually use
recursion, even tail recursion? Recursion has been mainstream in
programming languages since Algol 60, but how many people actually use
it outside of Lisp/Scheme and other functional languages?
I haven’t had /that many/ opportunities to use recursion, but I tend
to use it wherever it is both applicable and not prohibitively
resource intensive. The latter is a valid concern when choosing how to
solve a given problem, but for cases in which recursion won’t blow the
stack or drastically affect performance, I like to use it. Not because
it’s /better/, per se…just because it’s more fun and often a bit
more challenging.
Granted, I’m still a student in the early part of my education, so I
don’t know how viable recursion will be for me in “the real world”, in
consumer apps and the like, but I’ll still use it when I see an
opportunity.