Am 04.07.2008 um 18:16 Uhr schrieb Gary L. Wade:

For example, this kind of code just bugs me when I'm balancing braces back-and-forth:

Well, I find *this* one preferable:

#if WE_WANT_TO_ADD_THIS_FEATURE_IN_FINAL_BUILDS
   if (thisTestIsTrue && newFunctionalityIsAvailable) {
#else
   if (thisTestIsTrue) {
#endif
       ...
   }
   else
   {
       ...
   }

Removing the redundant comments helps readability a lot more, than shifting a brace, IMHO. :)

Actually, in my code it'd probably look like this:


#if WE_WANT_TO_ADD_THIS_FEATURE_IN_FINAL_BUILDS

   if (thisTestIsTrue && newFunctionalityIsAvailable) {

#else

   if (thisTestIsTrue) {

#endif
       ...
   } else {
       ...
   }

Because I try to make stand out things that are *important*.

but when you're talking about thousands or millions of lines of code (as this guy unnecessarily touched) to go through, it's probably more trouble than it's worth,

Obviously.

and it's an easy way to anger people when something that had been working perfectly well is now broken.

Well, just reformatting really shouldn't be able break the build.

Since it's easier for me to read code that is formatted the way *I* like it, I would be happy if the editor was able to reformat everything on the fly. That would save me time not only because I didn't need to reformat by hand but also because it'd speed up my reading/understanding. Should be possible, no?


Andreas
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to