Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code Standards
Message
From
01/10/2003 11:21:09
Walter Meester
HoogkarspelNetherlands
 
 
General information
Forum:
Visual FoxPro
Category:
COMCodebook
Title:
Miscellaneous
Thread ID:
00832733
Message ID:
00833861
Views:
38
Hi Peter,

>>I believe that procedures, methods and functions should be compact. If you end up writing methods of several hundred lines of code, you should seriously wonder if that is correct. I know this behavious is just an inheritance from the JSP times and widely used in clipper and foxbase programs, but this is really a bad habit.

>Don't get me wrong, I propagate the writing of subroutines. However, there's no gain in writing a subroutine that's called only once, solely for the purpose of preventing long procedures/functions. I prefer one big 300-lines procedure with 4 40-lines functions over 100 small 10-lines functions. The latter kind of code I call macaroni code!

I guess it really depends on the situation. However, I do want to propagate writing procedures for the sake of abstraction. If I need to calculate the number of working days between to dates and I only use it ones in my application, I'd still write a function because it abstracts the routine complexity of the algorithm and takes away the need in the calling program to comment what the GetNumberOfWorkingDays does do.

BTW isn't it called spagethi code ?

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform