Re: balanced REDUCE: a challenge for the brave
- From: "Jeff M." <massung@xxxxxxxxx>
- Date: Wed, 28 May 2008 07:29:26 -0700 (PDT)
So, while I love a good programming challenge, (and no offense is
intended) I find challenges like these to be the very opposite of what
Forth is good at. By that, I don't mean that Forth can't reduce values
in an array, or work on large data sets, or ....
What I mean is that part of the Forth mentality: factoring, is many
times about changing the problem in such a way that it can be
expressed more concisely, tested more thoroughly, and factored into
more finely tuned components.
While many times there is an external force that requires us - as
programmers - to slam our collective heads on our keyboards because of
crazy system, hardware, or managerial requirements placed on us, toy
problems definitely aren't one of them. :)
As an example, aside from intentionally making the problem more
difficult, is there any particular reason to enforce "balanced" vs.
"unbalanced" in this particular case? Maybe. But you are asking for a
more well-factored snippet of code. Factoring (at least for me)
usually involves more than just breaking out snippet A of code into
it's own function. If by allowing for an "unbalanced" solution one
could cut the code in half, make it more readable, more maintainable,
and more extensible, isn't that the end goal? Perhaps instead of
saying that it has to be balanced, you would get better solutions if
you instead stated the problem that being balanced solved, and just
make solving that particular problem a part of the solution. Again,
distill the problem down into it's most fundamental components, and
solve those; don't put arbitrary restrictions on the programmer
because you've already solved portion A with assumption X.
Anyway, I've been working on a solution and I hope to post one today.
It is a fun problem. ;)
Jeff M.
.
- Follow-Ups:
- Re: balanced REDUCE: a challenge for the brave
- From: Anton Ertl
- Re: balanced REDUCE: a challenge for the brave
- From: Jonah Thomas
- Re: balanced REDUCE: a challenge for the brave
- References:
- balanced REDUCE: a challenge for the brave
- From: Anton Ertl
- Re: balanced REDUCE: a challenge for the brave
- From: John Passaniti
- Re: balanced REDUCE: a challenge for the brave
- From: Anton Ertl
- balanced REDUCE: a challenge for the brave
- Prev by Date: Re: balanced REDUCE: a challenge for the brave
- Next by Date: Re: balanced REDUCE: a challenge for the brave
- Previous by thread: Re: balanced REDUCE: a challenge for the brave
- Next by thread: Re: balanced REDUCE: a challenge for the brave
- Index(es):
Relevant Pages
|
Loading