In article <
6cec4e97-6f5b-4edf...@googlegroups.com>,
Howerd <
how...@yahoo.co.uk> wrote:
>Hi Mark,
>
>> Why do you need to work out what is going on?
>I have the type of personality that needs to know how everything works.
>
>> If you know that the code works, just use it.
>That's a big "if". The best way to see if the code works is to read it.
>I think this is circular logic...
Read all code? No, impossible. Have you ever been on a 1M+ code base?
Most starting points for reading someone else's code is that it doesn't
work. And you can't just read "it". You first have to find the code
you should read for insight on the problem.
>
>> This does seem to be an issue amongst Forth coders
>Yes - it is a different mindset.
>
>> The problem with ESC as posted above is not the complexity. It's that
>> it's not documented. Not even a stack comment.
>I think there are two problems - the code should be documented, but also it is too complicated.
>Its level of complexity is such that it requires complex documentation.
Right! I guess the writer tried to document it, discovered that that was very
painful and thought "the hell with it! It works!" But in fact it doesn't work
for me. If I don't know what it is supposed to do, it doesn't work for me.
>A simpler implementation requires simpler documentation, is easier to understand, and perhaps
>most importantly does not put up a barrier to changes in the future.
>
>Making a fancy compiling word, ESC , makes it very difficult (for me at least) to focus on what
>the problem really is.
>Say you document ESC - "takes a space delimited string to send, preceded by an escape
>character, can be followed by [#] which sends a number followed by the next space delimited
>string".
>Once you've got that in your mind you are no longer in a position to question whether the
>escape sequences that Hewlett Packard chose could be any better.
>After all, you have got your ESC word to handle the complexity.
>This is an example of the way in which complexity encourages more complexity.
>
>Simplicity is difficult, complexity is easy. To quote Chuck Moore in his book
>
http://www.colorforth.com/POL.htm :
So far I agree.
>
>"So to offer guidance when the trade-offs become obscure, I am going to define the Basic Principle:
>
>Keep it Simple
>
>As the number of capabilities you add to a program increases, the complexity of the program
>increases exponentially. The problem of maintaining compatibility among these capabilities, to
>say nothing of some sort of internal consistency in the program, can easily get out of hand.
>You can avoid this if you apply the Basic Principle. You may be acquainted with an operating
>system that ignored the Basic Principle.
This is simply not true. I'm currently working on the organ interface for manx.
Manx plays a number of notes together and with independant start and stop times on
metallophones, an internal speaker or any other instrument I come up with.
This problem has been solved.
Adding the organ means that I only need to solve the problem of starting and stopping
one note on the organ. (And then it can play notes together on the organ
as the piece requires).
This interface is pretty hard. The 24 magnets are in serial, bitbanging over a
clock and a data bit. But a magnet that must play a tone, must first be activated for a
certain period and then it must remain activated by a pulse width modulation.
Note, those 24 magnets each for a tone are quasi independant.
Meanwhile the other instruments are playing their part.
But in this well designed (ahem!) program it is not hard at all. I can concentrate on
this aspect, and discover it is even much less code then expected. Without the PWM
it would even be trivial.
I can (and will in due time) add playing over a midi interface and the
interference with other stuff will be zilch.
In a well designed program the complexity goes linear with the features, and the possibilities
go exponential in the features.
>
>It is very hard to apply. All the pressures, internal and external, conspire to add features to
>your program. After all, it only takes a half-dozen instructions; so why not? The only opposing
>pressure is the Basic Principle, and if you ignore it, there is no opposing pressure".
You must resist adding useless features. But in the end a program is not much more than
a conglomerate of features, so resisting features per se is pointless.
Oh, and you must keep balance and consistency in features, that too of course.
>
>I love this quote :-)
>
>Best regards,
>Howerd
>
>On Thursday, 4 September 2014 09:20:02 UTC+1, Mark Wills wrote:
>> <snip>It is too hard to work out what is going on. </snip>
>>
>>
>>
>> Why do you need to work out what is going on? If you know that the
>>
>> code works, just use it. This does seem to be an issue amongst Forth
>>
>> coders, much so than, say, Java or C programmers. If I download a Java
>>
>> library to do something, I don't perform an autopsy on the code. I use
>>
>> it, and if it works as advertised, great. If not, I curse the programmer
>>
>> and move on!
>>
>>
>>
>> The problem with ESC as posted above is not the complexity. It's that
>>
>> it's not documented. Not even a stack comment. Fire the programmer :-)
>>
>>
>>
>> Forth programmers just don't "do" libraries, do they? I think it has
>>
>> something to do with forever trying to one-up other Forth coders.
>>
>>
>>
>> 1st Forth guy: "Hey, here's my library to do fixed point trig!"
>>
>> 2nd Forth guy: "Ugh! What ugly code. I wouldn't do it like *that*!"
>>
>> 1st Forth guy: "Have you ever written a fixed point trig library?"
>>
>> 2nd Forth guy: "Well, no, but if I did I wouldn't do.."
>>
>> 1st Forth guy: "Well STFU then!"