[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: The no goto religion
From:       Ian Wadham <ianw2 () optusnet ! com ! au>
Date:       2007-08-04 7:52:59
Message-ID: 200708041753.00890.ianw2 () optusnet ! com ! au
[Download RAW message or body]

On Sat, 4 Aug 2007 12:54 am, Aaron J. Seigo wrote:
> On Friday 03 August 2007, James Richard Tyrer wrote:
> > What I am saying is that if he is correct and KDE consistently uses the
> > "no-goto-allowed" style of coding that this will result in a significant
>
> for the record, so that people don't get the wrong idea here: there are
> places in kde where goto *is* used, and for good reasons. it's not "no goto
> allowed" it's "use goto only where it makes a real difference".
>
It's true.  I found *hundreds* of files in the KDE codebase that contain
the string "goto", including many in kdelibs itself ... !!!

And until James RT started this threat I had never even known there
*is* a "goto" statement in C++.  You learn something new every day.

Aaaarrrggghhh!!!  I am fallen among sinners.  Ye should all do penance.
Ten lashes and peruse three chapters of Dijkstra's "A Discipline of
Programming" [1] at dawn each day.  Avast and shiver me timbers!
Away ter the brig, with ye.  Ahaarrr!

Woi am oi speaking loike a poirate?  'Tis the Great Spaghetti Monster
come from the skoi to take me down ter Davy Jones's locker!  Oi
feel his noodly tendrils wrapping me round ... Richard Dawkins save
me ... have I been guilty of a-goto-ism (not believing in goto's)?

Disappearing dinosaurially into a burning lake of goot [2], Ian W.

[1] "A Discipline of Programming", by Edsger W. Dijkstra, Prentice-Hall
     1976 - a facsimile is at http://www.walenz.org/Dijkstra/index.html

     One of the most obscure books on programming theory ever written.
     It is interesting for introducing an unnamed programming language
     with "guarded" statements and compound statements.  In effect every
     block is conditional on some predicate.  More readable is "Structured
     Programming" [3].

[2] goot - A thick, sticky, intractable substance, composed of long-chain
     goto's.  It is something like the La Brea tar which is dragging down the
     dinosaurs on the cover of FP Brookes' "The Mythical Man Month".

[3] "Structured Programming", by O-J Dahl, EW Dijkstra and CAR Hoare,
     Academic Press, 1972.  There is a review (dated 2002) at
          http://i.f.alexander.users.btopenworld.com/reviews/dijkstra.htm

     Memorable is Dijkstra's image of a beach at sunset with a lone
     horseman galloping towards you.  What a beautiful scene!  Now,
     Dijkstra says, picture the same scene with a thousand horsemen ...

     That is the difference between writing and analysing snippets of code,
     as James RT has been doing, and writing/maintaining some large
     body of code such as kdelibs or one of the KDE applications.

     O-J Dahl, one of the authors of "Structured Programming", was also a
     founding father of Object-Oriented Programming, with the language
     Simula and the book "Simula Begin".  Structured programming and
     OOP, rather than abstinence from goto's, are what have made possible
     the size, complexity and overall reliability of today's software.  In the
     1970s, I remember, we had compilers that could mis-compile your
     source code and O/S's that might crash once an hour or more.



 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic