Brendan Enrick's Blog

Daily Software Development.


13 Comments
Tagged as: ,

Overusing var in C#

With C# 3.0 came one new feature I both love and hate; the implicitly typed local variable: var. I think it is great because it is implicitly typed, but it is still strongly typed. At compile time it will be the explicit type as if you had typed the actual type name. Visual Studio is able to determine during development what the type is, so there isn't much of a downside. However, I believe it gets...

Continue reading “Overusing var in C#

Posted on Monday, 22 June 2009

Daily Dev Speedup - Commenting and Uncommenting Code Quickly

Visual Studio as well as many other applications which know what language you're using are able to do a lot of the little shortcuts for common tasks like commenting and uncommenting code. This can help speed things up a great deal since you can usually do many lines at a time. Also you don't have the context switching to go to a mouse to click the button. Instead of clicking that button just type....

Continue reading “Daily Dev Speedup - Commenting and Uncommenting Code Quickly

Posted on Thursday, 18 June 2009

Moving Away From Large Event Handling Methods

A big issue which can be seen when looking at a lot of ASP.NET code is the classic "do everything" method. This is often some kind of an event handler. It is sometimes one for the page such as with Page Load. Other times it is a control on that page that owns the event. Either way this is a nasty piece of code whether you're testing or not. These dangerous pieces of muck are difficult to work with...

Continue reading “Moving Away From Large Event Handling Methods

Posted on Wednesday, 17 June 2009

Everyone Should Have a Continuous Integration Server

Have you ever heard another developer say, "it works on my machine"? Well I am sure a lot of people have heard that common phrase. Heck I've used it, but a lot of the time I will point out that it also works on the build server . That last part is what really counts in my opinion. Any and all code you write should be checked into a source control repository. I think most people agree with that statement...

Continue reading “Everyone Should Have a Continuous Integration Server

Posted on Friday, 12 June 2009
No Comments
Tagged as:

Looking at Testing in Other Fields

Software development is not alone in the world. Surprised aren't you? There are other fields which exist. Most of these fields have been around much longer than we have, and sadly they tend to do things better than we do in a lot of ways. Heck they're much more mature than we are. I am not saying there is anything wrong with how we are doing things, but I do believe that our field can grow and develop...

Continue reading “Looking at Testing in Other Fields

Posted on Friday, 12 June 2009

Daily Dev Speedup - Use Lightweight Tools for Lightweight Work

Everyone is always trying to use the best possible computers to do their jobs. Developers buy high performance machines so they can write code faster. Some improvements can be made to your development speed without going and spending large sums of money amassing expensive tools and machines. As any craftsman will tell you, "you need to have the right tool for the job". A lot of times there are quick...

Continue reading “Daily Dev Speedup - Use Lightweight Tools for Lightweight Work

Posted on Friday, 12 June 2009
No Comments
Tagged as: ,

Time-Tested Testing Tips - Part 5

Welcome back for another exciting tip for those developers writing unit tests. Today we will be looking at assertions in unit tests. Only Assert On One Case Per Test When people start writing unit tests they do the natural thing with their Assert statements; they write a bunch of them in the test. This makes a bunch of sense, because you don't want to repeat yourself in your tests. This is not bad...

Continue reading “Time-Tested Testing Tips - Part 5

Posted on Monday, 08 June 2009

Daily Dev Speedup - Using Visual Studio Snippets

In Visual Studio there are code snippets which can be used with auto-completion. These are a lot of the common structures used by developers when writing code. They are customizable using Visual Studio, but I find it much easier to use editors like Snippy . So if you were not using snippets because one of them was not exactly the way you wanted it to be, give a snippet editor a shot. I highly recommend...

Continue reading “Daily Dev Speedup - Using Visual Studio Snippets

Posted on Monday, 08 June 2009

Writing Testable, Maintainable Code

At our company we’ve had a few interns start this summer, so we ran a little workshop with the development team to help teach the team a few things about writing tests before writing other code. In our test driven workshop we did some simple problems in teams. We looked at different problems from Project Euler , and solved them in pairs. We all worked out our own tested solutions to the problems and...

Continue reading “Writing Testable, Maintainable Code

Posted on Thursday, 04 June 2009

Daily Dev Speedup - Working With Words

A lot of applications allow you to work with a group of text at a time. For the purposes of this post I'll call them "words". When I say a lot of applications this includes the powerful IDE called Notepad. This cool trick can be applied in a lot of different places. I am sure you'll figure out some interesting uses for this. The key (literally) to achieving this productivity from working...

Continue reading “Daily Dev Speedup - Working With Words

Posted on Wednesday, 03 June 2009