[Oberon] a module a page (keeps the mind sane)?
Frans-Pieter Vonck
fp at vonck.nl
Mon Nov 5 21:32:16 CET 2018
Hi Bob and Paul,
maybe I've read about the "one page rule" in the introduction of a
modula-2 book.
> When you originally asked this (on this list in December 2015, can't
>> believe it was that long ago!) :)
Ha, should have looked in the archive.
>> There was a very practical reason for a 'one page, one procedure' rule
One page, one procedure. That is a more reasonable rule.
Maybe, one class per page.
Another aspect of the arduino code I looked into. The main event loop is
500 lines.
Mostly timer checks.
I get inspiration from event loop
https://www.inf.ethz.ch/personal/wirth/ProjectOberon/Sources/Oberon.Mod.txt
With this implimentation
https://www.inf.ethz.ch/personal/wirth/ProjectOberon/Sources/Blink.Mod.txt
Greets,
F.P.
Bob Walkden schreef op 2018-11-03 16:42:
>> On 3 Nov 2018, at 14:55, Paul Reed <paulreed at paddedcell.com> wrote:
>>
>> Hi Frans-Pieter,
>>
>>> Does anyone remember where Niklaus mentions the ' one page of code,
>>> one
>>> module ' rule?
>>
>> When you originally asked this (on this list in December 2015, can't
>> believe it was that long ago!) :) I asked a colleague and he couldn't
>> remember where he had read it either.
>>
>> But asked again and intrigued, he embarked on a browse of his
>> dead-tree
>> library and eventually conceded that what he had probably remembered,
>> or
>> at least the closest thing he could find, was
>>
>> "The Elements of Programming Style", 2nd Edition (Kernighan and
>> Plauger),
>> page 150, bottom two lines:-
>>
>> "The modularization would have the advantage that each part of the
>> program
>> would fit comfortably on one page."
>>
>
> There was a very practical reason for a 'one page, one procedure' rule
> when I started programming in the early 1980s.
>
> I was a COBOL programmer and we did not have terminals or such
> luxuries. Instead we wrote our code in pencil on coding sheets
> (paper), submitted it to the data prep women (always women) and a few
> days later received the sheets back with a paper tape version of the
> source code which we could then attempt to compile.
>
> Because we practised Jackson Structured Programming we could write
> subroutines which fit on one coding sheet and re-use the coding sheets
> for other programs, or shuffle them, insert other code on separate
> sheets etc as needed. Only for short, simple edits and quick compiler
> turnaround when we had the machine to ourselves on a Tuesday evening
> did we need to cut and paste, quite literally, the paper tape.
>
> Anything involving a new coding sheet would take a week, but that was
> much easier than dealing with something monolithic which involve
> re-pencilling numerous sheets from scratch.
>
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related
> systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
More information about the Oberon
mailing list