[Oberon] Standalone BlackBox programs was: GUI programming inOberon.

Lars noreply at z505.com
Thu Mar 31 03:25:45 CEST 2016


>> On 23 Mar 2016, at 08:14, John R. Strohm <strohm at airmail.net> wrote:
>>
>>
>> I think it was Tony Hoare who told the story, in his Turing award
>> lecture, of how he once proposed a default type convention to the ALGOL
>> committee, similar to the FORTRAN default conventions, as an
>> alternative to mandatory variable declaration.  The committee very
>> politely boxed his ears.
>>
>> He later realized that mandatory variable declaration was in fact a
>> Very Good Idea, saying something along the lines of Supposed the
>> Good Fairy offered to wave her wand over your code, and eliminate all
>> bugs, and the only price was that you had to key your code in three
>> times.  Would you consider this a reasonable price?
>>

That is why when GoLang came out I was skeptical of their variable
declaration system where you do not have to declare it, you can just infer
it (well it is not the same as Haskell's type inference) without
declaring.

The real issue with GoLang code (and maybe haskell code) is that by not
declaring the variable with a type ahead of time, you don't document the
code as to what you are doing. I find myself looking up functions and what
they return, rather than just seeing the type declared (documented) in the
go code. This is the major thing I miss of Delphi programming (and oberon
programming) when programming in go: the lack of type declarations.

This makes code easier to write, with much less boiler plate nonsense.
However the algol people studied this long ago and Dijkstra and Hoare made
comments (either or both of them) about how people ended up finding that
redundant declarations of variables made the programmers more aware of
what they were doing. I like you remember reading about this, I believe
Dijkstra made some comments, and Hoare, maybe both of them.

However I do find Delphi and Oberon code to get a bit heavy and verbose
with all this up front declaration, and I find Go code much easier to
write. That's a warning since Perl can be easier to write too: which
doesn't make it better necessarily.  But imagine this: you had to declare
every single time, your maximum integer value...

INTEGER  MAX 100

There are some things we do not declare ahead of time. What if you aren't
using the Integer beyond values of 100? should this be in the contract?
standard pascal had ranges to define a min and max. Wirth took this
declaration restriction feature out of the language as he found it wasn't
used, even though it supposedly should make programs safer, as you are
defining a constraint and restriction.

Similarly, I find declaring an ARRAY OF CHAR (1000) obnoxious rather than
just defining an arbitrary length STRING type without knowing exactly how
long the string will be. IF you can't predict exactly what max value your
integer is going to be, (standard pascal ranges) then who says you know
your max string length either.



>> He mentioned that this was before the possibly-apocryphal story of
>> NASA’s lost Venus probe, because of FORTRAN’s lack of mandatory
>> variable declarations.  (Supposedly, the story goes, someone coded a
>> DO-loop, and someone else managed to put a period where the original
>> had a comma.  The result was syntactically legal, but not correct.)
>>
>> From: Aubrey.McIntosh at Alumni.UTexas.Net
>> Sent: Thursday, March 03, 2016 11:40 AM
>> To: ETH Oberon and related systems
>> Subject: Re: [Oberon] Standalone BlackBox programs was: GUI programming
>> inOberon.
>>
>> A strong theme in the Oberon community is documentation in the sense of
>> understanding or having an audit trail.  A command that lists the
>> modules in the order that they are packed is very clearly documented,
>> and valuable for troubleshooting.
>>
>> This is the same thought pattern that believes that variables should be
>> declared, rather than simply having the compiler allocate space, even
>> when spelling errors creep in, or believes that identifiers should have
>> the module name as a part of the identifier.  Yes, it takes more
>> crafting to author the code.  That time is recovered during
>> maintenance.
>>
>>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon
> --
> 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