Archive for May 6th, 2008

Writing Better Code and Formatting Tip

Tuesday, May 6th, 2008

Sometimes when I work with other developers I inevitably find that all of the code looks different. Some developers like to write really compact code, as if we were still working on cartridges when disk space for the source code really mattered. Some developers also firmly believe that fewer lines of code in C# means it will somehow run faster because doing 5 things on a single unreadable line of code will somehow run in a single instruction in compiled code versus carefully expanded and readable code that performs the same 5 actions. I am not a fan of compact code. I prefer readable and verbose code with the occasional comment to help explain a bit of code that implements some strange business logic that was defined in the specifications but is not obvious from looking at the code.

(more...)