[Oberon] Use of resources.

Chris Burrows chris at cfbsoftware.com
Tue Dec 15 22:40:27 CET 2015


'One page per procedure' possibly but definitely not 'one page per module'.
I don't recall seeing a quote but I have always used a *rule of thumb* that
if you can't see all of a procedure at once then you should *consider*
refactoring it. Hence what might have been 'a page' in the past might now be
'a screenful'. This is deliberately vague e.g. if I regularly use one of my
widescreen monitors in portrait orientation with a relatively small font I
can see a lot more than otherwise might be posible.

However, you should be very careful when communicating guidelines of this
sort to inexperienced programmers to make sure they they don't interpret
them as commandments set in stone. Otherwise they might arbitrarily break up
large procedures into smaller illogical chunks just because they have been
given a rule to follow. You should give some examples of horror cases that
obviously need splitting up and other examples of procedures that are large
for a good reason (e.g. a case statement with many cases),

Regards,
Chris Burrows
http://www.cfbsoftware.com
 

> -----Original Message-----
> From: Oberon [mailto:oberon-bounces at lists.inf.ethz.ch] On Behalf Of
> Frans-Pieter Vonck
> Sent: Wednesday, 16 December 2015 7:09 AM
> To: oberon at lists.inf.ethz.ch
> Subject: Re: [Oberon] Use of resources.
> 
> Hello Paul, Peter and all other oberonneurs,
> 
> one of my former highschool students is writing a Python programmes
> that have very long listings. Despite the structured nature of Python
> his programmes become to complex to explain to me.
> Now I think I remember a quote from Niklaus Wirth where he states
> that every module that is longer than one page should be rewritten in
> separate modules.
> Did anyone remember this quote? And, do you think this adagium is
> only valid for the Main Module or is it also applicable for, say math
> library modules?
> 
> Greets,
> Frans-Pieter
> 




More information about the Oberon mailing list