Re: balanced REDUCE: a challenge for the brave



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.
.



Relevant Pages

  • Re: The Promise of Forth
    ... But that's not the only way to think about programming. ... Factoring is good for people who think. ... they noticed something-- that this kind of higher-level factoring is language independent. ... project management usually degenerates into a series of insults about management. ...
    (comp.lang.forth)
  • Re: Multiple Statements per Line
    ... programming style, but other people have posted such code, too). ... Multiple statements per line have been possible in programming ... Perhaps factoring is just as important; ...
    (alt.lang.asm)
  • Re: Basically a sieve method, relation to quantum
    ... and yours is just the special case of picking j=M (I know James ... he at least has to assume that factoring integers with twice as many ... even I can write a linear-time Python program ... >> we math guys should leave the actual programming to the pros. ...
    (sci.crypt)
  • Re: Basically a sieve method, relation to quantum
    ... and yours is just the special case of picking j=M (I know James ... he at least has to assume that factoring integers with twice as many ... even I can write a linear-time Python program ... >> we math guys should leave the actual programming to the pros. ...
    (sci.math)

Loading