Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GLGDW 2006 - April 21-24, Milwaukee
Message
De
11/01/2006 15:53:11
 
 
À
11/01/2006 12:14:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Conférences & événements
Divers
Thread ID:
01078694
Message ID:
01085845
Vues:
31
>>>I can't tell you how often I've heard people, referring to code they didn't write, say that it is spaghetti code written by a non-programmer.... It remains my opinion that, generally, such statements are self-serving and usually don't reflect reality.
>>
>>I'm curious. How much of your work involves working with existing code? A lot of mine does, and most of what I run into is badly written and even more badly documented, where it was written by a programmer or a power user. Sometimes, the code is bad enough that I walk away from the job; sometimes, I just know that I have to walk with care. Occasionally, I'm dealing with an app that's well-constructed even if it isn't the way that I would have done it, but that's the exception, not the rule.

>In fact I'd say over 50% of things I've worked on (mainframe, AS/400, VFP) in the last 10 years has been "maintenance", typically enhancements to existing systems.
I've never done a re-write, though at times I'd have liked to.

>It took some time, but I've come to learn in this business that "beauty is in the eye of the beholder" applies especially strongly when it comes to code and it is immediately ugly if it ain't written the way the current beholder does their code.
>Of course I prefer my own style too. But I am not going to re-write working code, and often business-critical, just because my style is different.

>I have had occasions (well, 1 comes to mind) where an enhancement radically changed the "focus" of the application and so it was re-written.

>Some people believe writing minimal code is "good code" and they take pride in writing on 1 line what I believe is clearer in even 5 or 10 lines.
Some people hate (with a capital H) nesting of IFs simply because they can't stand the indenting. I don't worry about how much indenting is done.
Some people (likely to keep their typing down) rely totally on VFP (for example) to do it's default behaviour and so save additional line by letting VFP do it for them. My preference is to (virtually) always code things like "ALL" after SCAN or "USE IN..." for tables/cursors regardless, SELECT after a CREATE CURSOR, etc. I use "m." where it should be used and some people detest that.

>I see little value in wholesale re-writing of code just for the sake of my personal style when I know full well that the next person is going to declare it crappy anyways because it isn't in their own style.

>cheers

I concur -- writing code is more of an art form. Some coders are careful and provide very detailed code and is easy to follow; others may not or to other degrees. But each person understands their intentions when writing the code and to them "it makes senses". To another it is always subjective as to how "good" it is. I have had others tell me they like my style and still others that didn't as much -- each to his/her own.

I find that in judging my own coding is best accomplished 6 months or longer after having completed the job. To the extent that I can Pick up where I left off to add/modifiy features and the ease to which this is done gages my code. Sometimes I look at it and think "what was I thinking", other times I can pick it up and continue on. It doesn't seem to matter how much time was spent to "pretty" the code. I have also found that after I have a solution, it is always easier to say "I should have done it this or that way" -- hind sight is always better than 20/20!!! But you don't have the time to go back and re-design it (and who knows 6 months later the redesigned may be just the same as the current!!).
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform