Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Argument starter - The roots of all evil
Message
De
02/09/2004 09:41:18
 
 
À
02/09/2004 08:46:40
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00938079
Message ID:
00938724
Vues:
41
Hi, Mike

I'm coming to realise that this argument really is a case of personal taste, when it comes to readability. I suppose I was weaned on JSP, Yourdon/deMarco et al, structured techniques, back in the 80's, back in pure dBASE times, learning Fortran, PLAN, COBOL, Pascal, Basic, a little C, Intel's PLM86, et al. Correct me if I'm wrong but I don't recall the equivalent of LOOP and EXIT (at least in the sense of escaping or short-circuiting a loop). i.e. a lot of lang's got on quite well without, thanks very much.

Whereas many of Foxpro's innovations and additions to the original xBase have been admirable I just don't see the need for these. Esp. when one is scanning some code to get the gist of the flow, these little blighters are snuck into the odd little nook and crany of the code and, to me, don't help one bit.

It's a bit like the current proliferation of mobile (cell) phones. Time was people were happy to walk the streets and keep their own company. Now the young cannot bear to walk without yapping to someone on the mobile ("I've just left work - I'll be home in 5 minutes"), even to ignore the person accompanying them for real. Everyone got on fine without them and, if they really needed to speak to someone, then a public phone box sufficed.

Similarly with LOOP/EXIT, we programmed fine in old xBase and other languages without them, now they're ubiquitous. And to top it all, when someone finds his code isn't doing the job correctly, he throws one of these in - somewhere - to fix it. Whereas for time-critical quick fixes or for throw-away code, this is OK, once they're "liberally scattered" throughout the code, to fix other bugs, they tend to break the structure and the later maintainer needs to have "eyes in his back-side" to catch them all.

Finally, I don't know how the odd person has got the idea that I'm trying to "force" others into programming my way - I know that's impossible anyway and I'd get short shrift if I tried it on, on the UT. My starter was that these are a pain in the parse - discuss (and it worked, eh? :-) )

As for your last paragraph, it's a case of you like loop - I don't. I'd suggest putting the meat indented in an If is no less transparent then as in-line code, as your example. In fact, my example, to me reads like "The essential condition is met so let's do the meat" whereas yours reads like "Oh, there was a possible reason for not going on there - never mind, get on with the meat". It's all a case of taste and perception apparently.

Now, any more of this and I'll be calling at your office with a matched pair next time I'm in Toronto! ;-)

Cheers

Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform