Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programming Style
Message
De
03/07/2002 20:43:58
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
 
 
À
03/07/2002 14:09:12
Stan Vaninger
Mitek Industries, Inc
Missouri, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00675045
Message ID:
00675176
Vues:
10
Hi Stan,

I'm in the middle of Code Complete (finally) in the quest to become a "good" developer. Some of these concepts sound familiar, although the terminology is different. Nevertheless, it sounds like good advice. Thanks for the reference.

The entire article can be read online at: http://www.sdmagazine.com/documents/s=4077/sdm0203c/0203c.htm

>I just read an excellent article on programming style that others may find helpful: "Enlightened Java Style" by Jeff Langr, in the March 2002 issue of Software Development. While written with the Java developer in mind, these XP (Extreme Programming) principles can be applied to any language. The author advocates a style of programming that can be expressed in three simple principles:
>1) Composed Method
>2) Intention-Revealing Name
>3) Comment
>
>Here are a few of the high points of the article:
>
>"Composed Method states that a method should do things at one level of abstraction. It should be highly cohesive. It should do one thing and do it well."
>
>Yeah, yeah. We've heard that before. But there's more.
>
>"Rapid understanding is most important here - it should take me no more than a minute or two to understand what a developer intended the method to do."
>
>"The first key to good naming is thinking in terms of encapsulation. When I name a variable or method, the name never suggests how it is implemented; rather, it indicates what it is or what it is used for."
>
>"Intention-Revealing Name and Composed Method go hand in hand. The smaller a method is and the less it does, the easier it is to come up with a succinct Intention-Revealing Name."
>
>This next one was a shocker for me:
>
>"Strive to eliminate comments in your code."
>
>But Jeff give ample justification for what seems like an outrageous statement:
>
>"Comments indicate that code is not communicating clearly. As others have said, 'Comments are lies.' . . . If I have to explain a method, it's not simple enough."
>
>"Mehods should be a dozen lines or less. Scrolling is bad. . . . Code that forces scrolling might work fine for the fortunate few with photographic memory, but for the rest of us, it is a taxing exercise."
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform