Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Thundering Train Programming
Message
De
19/01/2006 11:26:39
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Thundering Train Programming
Divers
Thread ID:
01088463
Message ID:
01088463
Vues:
82
'Thundering Train Programming' is the phrase that came to my mind when trying to characterize a certain way of programming. It is typical for the programmer who is allowed to assume, or assuming, that certain preconditions are always fulfilled according to the functional design and that therefore no checks for those preconditions are required in code. If a precondition is not fulfilled, then the application will simply crash. Such crashes are not the responsibility of the programmer, but of the functional designer.

Why I named it 'Thundering Train Programming'? The train driver pays attention to a lot of things during the trip, but he won't bother about the rails. He assumes the rails exist all along the route. That assumption allows him to speed up the train and pay attention to other things.

Here's a piece of Thundering Train coding:
lparameter tcEmpno
local ln
select empname from employees where empno = m.tcEmpno into array laEmpname
for ln = 1 to alen( laEmpname )
   do someroutine with laEmpname[ m.ln ]
next
It contains no checks at all:
- It assumes a chartype parameter is indeed passed.
- The existence of the table is assumed.
- The existence of the field empname is assumed.
- It is also assumed that there actually is at least one record found.

Is it bad code? Not as I see it. But the programmer should make clear in the documentation why there are no, or only so little, checks.
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform