Friday, January 28, 2005

Under duress, Brad Abrams recently posted a set of internal coding guidelines to his blog, meant mainly to be a "tie-breaker" in the holy war type arguments that result from seasoned developers who love their own coding styles. I'm a big fan of the work Brad and his team have done on the CLR and their focus on consistency in the API. And, even though there are one or two I don't care for, I'm a huge supporter/follower of the design guidelines.  That's why I was surprised at how many of the internal guidelines I disagreed with.  Roughly 50% of them made me recoil in horror.  Of course, now I understand why I don't like the Visual Studio defaults.  I won't get into which ones I like/dislike because that's not a productive area of discussion.

Now that I've had a couple of days to let them sink in, I realize why Brad was reluctant to share them.  I think they may cause more controversy than solve.  The big questions is how useful will these be in helping my team be more productive?  At this point, I don't think much.  I think we'll stick to the public API guidelines and use the somewhat informal guidelines our team has created for the internal stuff.

 

posted on Friday, January 28, 2005 1:37:33 PM (Pacific Standard Time, UTC-08:00)  #    Comments [3]
Related posts:
LinqToStdf now on CodePlex
Image Slicer for Deep Zoom in Silverlight 2
Silverlight limitations and Constrained Callvirt in IL
What are the generic Delegates in the framework for?
What is System.__Canon and why is it on my stack?
Adding support for .ashx-based views in ASP.net MVC
Tracked by:
"Discount Table Linens" (Discount Table Linens) [Trackback]
"nella stanza morsicate" (nella stanza morsicate) [Trackback]
"promotional scarves" (promotional scarves) [Trackback]
"topamax for migraine %2B hypothyroid" (topamax for migraine %2B hypothyroid) [Trackback]
"defense acquisition" (defense acquisition) [Trackback]
"Husky Puppy Picture" (Husky Puppy Picture) [Trackback]
"BABY SHOWER INVITATIONS" (BABY SHOWER INVITATIONS) [Trackback]
"Counterstrike Hacks" (Counterstrike Hacks) [Trackback]
"Free SMS Service UK" (Free SMS Service UK) [Trackback]
"orange county jail" (orange county jail) [Trackback]
"caugh masturbating stories" (caugh masturbating stories) [Trackback]
"enoteche" (enoteche) [Trackback]
"cholesterol in food" (cholesterol in food) [Trackback]
"free bitches" (free bitches) [Trackback]
"panasonic plasma tv" (panasonic plasma tv) [Trackback]
"bakersfeild ca" (bakersfeild ca) [Trackback]
"fictional detectives" (fictional detectives) [Trackback]
"ridiculous infermiera azione" (ridiculous infermiera azione) [Trackback]
"Kawasaki Ninja 250 Performance" (Kawasaki Ninja 250 Performance) [Trackback]
"bitch island" (bitch island) [Trackback]
"chicago bbw escort" (chicago bbw escort) [Trackback]
"print manager software" (print manager software) [Trackback]
"Santa Barbara Collection" (Santa Barbara Collection) [Trackback]
"challenger gate garage door openers" (challenger gate garage door openers) [Trackback]
"building developers IN USA" (building developers IN USA) [Trackback]
"bangkok train schedule" (bangkok train schedule) [Trackback]
"aspirin vs plavix" (aspirin vs plavix) [Trackback]
"velvet hookah carrie" (velvet hookah carrie) [Trackback]
"ford warranty" (ford warranty) [Trackback]
Saturday, January 29, 2005 9:46:33 AM (Pacific Standard Time, UTC-08:00)
I agree, coding guidelines are great, especially as a project gets large, and everyone thinks they've got the best way of doing things.

Naming is a tough thing to change, and the topic where compromise has to happen. I like Brad's naming conventions, he is a bit whitespace happy (ok, I'll stop now before I can't stop) but I think it would be better to keep an existing project consistent, rather than try to redo it all. When I dig into someone else's source code, the most important thing is that the naming is consistent within the project.

Whitespace is the thing I am most picky about, fortunately it is the easiest to fix. astyle (http://astyle.sourceforge.net/) can rearrange code to layout exactly how you like it. (It does support C# code, its just not advertised on the main project page). astyle comes with most Linux distros and Cygwin.

I have long thought about an on-checkin hook for revision control that reformats your code to some standard, so you can edit however feels comfortable without worrying about any standard. This would not only make everyone happy, it would keep your style self-consistent :) and make diffs more effective.
Saturday, January 29, 2005 10:06:33 AM (Pacific Standard Time, UTC-08:00)
Yeah, Casey. I've thought about that kind of thing as well. Especially since the new VS.net is so customizable in that respect. The only issue would be that any file you opened would appear to have been edited...alot. And diffs with the working copy would be difficult to decipher. Perhaps a client-side mechanism could do the normalizing, although that wouldn't protect the repository. I'm just rambling now.
marklio
Tuesday, February 01, 2005 5:16:34 AM (Pacific Standard Time, UTC-08:00)
This is why I use temp1 convention for naming variables, class, and so on. That way I always have consistancy and built in obsfucation.
Mark Leech
Name
E-mail
(will show your gravatar icon)
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):