... all I'm offering is the truth. Nothing more. RSS 2.0
# Tuesday, August 15, 2006

"Everything that irritates us about others can lead us to an understanding of ourselves." - Carl Jung

I spent some of last last week pouring over code in C# trying to get to the bottom of Support issue that I was following up on and I found some examples of irritating code that seems to raise the hairs on the back of my neck ... It should not ... when I think rationally it should not bother me at all, but if code is not immediately readable, if the initial form it takes effects the readability then we all need to get on the same page as it effects someone in the software life cycle.

So here is a simple if statement. that I simply do not like:
if (MyShirt == "Long") MyBoots.Height = MyBoots.Height - 20;

I prefer to see this
if (MyShirt == "Long")
    MyBoots.Height = MyBoots.Height - 20;

or, if I am in a particularly verbose mood then the following is preferred.

if (MyShirt == "Long")
{
    MyBoots.Height = MyBoots.Height - 20;
}

The intention just appears to be clearer, a logical statement followed by decision. Are we that interested in saving white space? I know this is really picky hence the title of the post, and I know what your thinking how can everyone I work with account for my neurosis quirks? Not sure but something has got to give!

My Solution:

All permutations on if, while, do while, for, case select etc should be viewable based on the preference. Much like the CLR it should determine the intent and display it based on your preferences. So the three if statements above would actually be rendered when you open the Visual Studio Project based on preference. There is, actually, no difference between them it just a visual cue of the intent of the developer.

This concept is a little avant-garde, so I will start work on this right away ;)

Tuesday, August 15, 2006 11:25:42 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] - Trackback
Programming
# Monday, August 14, 2006

This is my first blog entry using Windows Live Writer, the new blog writer tool from Microsoft. I must admit I like it immediately, but considering that I was using notepad2 as my primary blog writing tool that may not be the most knowledgeable comment.

There are of course many great blog writing tools recommended all across blogville, but I will limit this blog to simply say that this tool has a very simple setup and installation stage, coupled with a WYSIWIG editor that simulates the layout of your blog. There is a cool Insert Map feature that allows Microsoft to show off there Live Local offering too. The thing I love the most , however, is a simple spell checker (not available in notepad2).

p.s. It also compatible with Blogger, LiveJournal, TypePad...

Monday, August 14, 2006 11:14:54 PM (Eastern Daylight Time, UTC-04:00)  #    Comments [0] - Trackback
Blog
Blogroll
Statistics
Total Posts: 330
This Year: 18
This Month: 2
This Week: 0
Comments: 30
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Mark Downie
Sign In
All Content © 2010, Mark Downie
DasBlog theme 'Business' created by Christoph De Baene (delarou)