Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 To: Andy Kramek
  Where is Andy Kramek?
 Hot Springs Village
 Arkansas - United States
 Andy Kramek
 Tags
Subject: RE: #define versus assigning value to a public variable
Thread ID: 104562 Message ID: 104617 # Views: 2 # Ratings: 0
Version: Visual FoxPro 6 Category: Other
Date: Friday, August 18, 2006 1:05:49 PM         
   


> > Agree, but imagine if you read someoneelses code and you read:
> >
> > IF thisform.MyProperty = 5
> >
> > I think this is more readable:
> >
> > IF thisform.MyProperty = MY_DEFINE_WANTED_ACTION

>
> Sorry but NO! Absolutely NOT! That is simply bad coding practice.
>
> This is what comments are for and this sort of code should read something like this
>
*** Check the status and act accordingly
> IF thisform.MyProperty = 5
>   *** This means that......
>   [code here]
> ELSE
>   *** Some other condition
>   [Other Code]

> #DEFINE is definitely not a substitute for good practice!
>
> Regards
> Andy Kramek
> Microsoft MVP (Visual FoxPro)
> Tightline Computers Inc, Akron Ohio, USA


I don't deny the value of comments. I just say that #define makes code more redable.

Borislav Borissov



ENTIRE THREAD

#define versus assigning value to a public variable Posted by Dan Roche @ 8/17/2006 4:21:18 PM
RE: #define versus assigning value to a public variable Posted by Jim Winter @ 8/17/2006 4:40:56 PM
RE: #define versus assigning value to a public variable Posted by Brad Schulz @ 8/17/2006 5:53:53 PM
RE: #define versus assigning value to a public variable Posted by Ken Murphy @ 8/17/2006 6:03:43 PM
RE: #define versus assigning value to a public variable Posted by Dan Roche @ 8/17/2006 7:05:45 PM
RE: #define versus assigning value to a public variable Posted by Borislav Borissov @ 8/17/2006 7:40:52 PM
RE: #define versus assigning value to a public variable Posted by Andy Kramek @ 8/18/2006 11:58:15 AM
RE: #define versus assigning value to a public variable Posted by Borislav Borissov @ 8/18/2006 12:12:23 PM
RE: #define versus assigning value to a public variable Posted by Andy Kramek @ 8/18/2006 12:20:07 PM
RE: #define versus assigning value to a public variable Posted by Borislav Borissov @ 8/18/2006 1:05:49 PM
RE: #define versus assigning value to a public variable Posted by Bernard Bout @ 8/19/2006 5:37:30 PM
RE: #define versus assigning value to a public variable Posted by Andy Kramek @ 8/19/2006 8:27:20 PM
RE: #define versus assigning value to a public variable Posted by Ken Murphy @ 8/20/2006 3:48:45 AM
RE: #define versus assigning value to a public variable Posted by Bernard Bout @ 8/20/2006 6:57:01 PM
RE: #define versus assigning value to a public variable Posted by Bernard Bout @ 8/20/2006 6:59:14 PM