Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Thundering Train Programming
Message
From
19/01/2006 12:14:26
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01088463
Message ID:
01088501
Views:
15
Peter,

If that was ALL the code it would be very bad indeed.
But if it was deeper in some process it is of course legitimate to presume that any required editing (called validation today) has been done and dealt with.

Two comments about the concept:

1) I've heard of (but never seen) a manager seeing a prototype, which is normally written using this "concept" saying 'that's good enough as-is. Put it into production'.
2) A high percentage of programming involves editing (now called validation) of input. One could surely cut programming time dramatically using this 'technique' but I dare say users would tar-and-feather him pretty soon.

cheers


>'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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform