Smart Code

In this presentation, originally delivered to the Wellington Dot Net User Group in March 2010, I explore the nature of Smart Code.

Smart Code is about writing code that is obviously correct - code that is faster to write and easier to read. While the presentation covers a number of different techniques, the key focus of the presentation is to work on writing code smarter, not harder.

Writing Smart Code might involve eliminating repetitive code with carefully chosen helper methods, making better naming choices, or structuring code to make it easier to read.

Attitude is the most important factor - to keep looking for ways to work smarter instead of mechanically churning out the same old same old.

Presentation

Audience Date
Wellington .NET User Group March 2010
AttachmentSize
Smart Code.pdf466.76 KB
SmartCode.zip64.38 KB

Comments

Hi there

Instead of creating new extensions methods to increase readability I would use the out of the box methods of the .NET framework

Instead of

"Do you want to delete {0}?", count.AsCount("Organisation", "Organisations"));
I would much more prefer to see some detail
"Do you want to delete Organisation: Peter Gfader industries"
specific for both cases

Instead of

TimeSpan span = 15.Minutes();
what about
TimeSpan span = TimeSpan.FromMinutes(15);

Nice presentation!
AND
Nice code samples!

Code readability is the most important aspect of programming

.peter.gfader.
http://blog.gfader.com
http://twitter.com/peitor