Sign In

Navigation

On This Page

Got a new PC
Unit Testing for the first time
Project Documenting under a deadline
Updates
The blog hath arrived

Archive

<July 2008>
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

Categories

Blogroll

Contact

Send mail to the author(s) Email Me
MCPD
MCTS

Disclaimer

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


Copyright ©  2010
 Creative Commons License
This work by Jeff Klawiter is, unless explicitly stated in the article,  available under the Creative Commons Attribution 3.0 United States License.

Pick a theme:
# Friday, July 04, 2008
by Jeff Klawiter - Friday, July 04, 2008 7:43:41 AM (Central Standard Time, UTC-06:00)
I did a bit of impulse shopping yesterday. I had $15 in reward zone coupons. So I went to Best Buy after work to see if I could find a new mouse to replace my broken MX Revolution. To my dismay they had it for $20 more than what I paid for it at the same store a year ago. I started looking at wireless keyboards as well since my current set up involves a ps2 extender cable and a ps2 to usb converter. After finding the Logitech LX 710 keyboard/mouse combo was pretty nifty I went browsing the PC section. Low and behold I found in the back of the section that have one aisle end with clearance PC's. I have no idea why I haven't noticed this before but I haven't. Most of the PC's there were unboxed due to them being display models.
Comments [0] #      HTPC  |  kick it on DotNetKicks.com Shout it
# Sunday, June 29, 2008
by Jeff Klawiter - Sunday, June 29, 2008 8:14:50 PM (Central Standard Time, UTC-06:00)
While I've heard lots about Unit Testing for years now I've never been able to force myself to implement them. I've always thought it'd take too much time. Time I could have spent writing code, getting work done. Then I go the project I am on now. It is a large project with a very tight deadline. A project that needs to marry different back end sources.

I've been put in charge of architecting the SQL Server back end and the entire middle layer for data access and business objects. I'm using many things I've not had a chance to use before at this scale (LINQ being the largest) in this project so there were many unknowns. The front end may not been done for a bit and I needed to test my data access functions. I decided to bite the bullet and write unit tests.

Normally I would write a small WinForms app to test the most important pieces. This is a dirty approach but it's fast. The biggest hurdle in my mind for Unit Testing was there was no quick way for me to implement and run the tests. Nunit is out there and has some VS integration but whenever I tried it I got confused of where I needed to go to get things done.

Now we have VS 2008 Pro with built in unit testing. While the testing framework included I'm told is decent it's not as good as Nunit. I personally don't care about that. The ability to go to the menu and create unit tests for methods or entire projects on the fly is a godsend for me. VS will create a project for you, include tests for any classes/methods you've selected out of all the projects in your solutions and then do it's best to create close to complete tests.

You can easily step into debug any test and run one or many tests. All the results are saved so they can be examined and compared. While the auto created tests need to be completed I am starting to find that writing to test my code interface is getting cleaner and more too the point. It's much more annoying to pass an object into a method that may only need one or two properties on the object. It's better to make the parameters basic types instead of complex.

The tests have to run against 2 different backends. While one of them will probably not change (the SQL Server) the webservice may end up being replaced. These tests will be invaluable for when that happens. We can then check to see if the new service is acting correctly and if not pinpoint the issues.

by Jeff Klawiter - Sunday, June 29, 2008 7:57:50 PM (Central Standard Time, UTC-06:00)
Documenting code is one of those things that programmers tend to leave out while under a tight dealine or just building a new project. It's one of those things we tend to say, if we have time when we're done we can do it. It can be time consuming and sometimes hard to see the benefit up front. I'm very guilty of poor documentation and commenting. I rarely get to work in a team so I always end up relying on my own memory for what does what and where. Then two years go by and I forget it all.
Comments [0] #      C# | Documentation  |  kick it on DotNetKicks.com Shout it
# Friday, June 27, 2008
by Jeff Klawiter - Friday, June 27, 2008 6:58:48 AM (Central Standard Time, UTC-06:00)
Well I've been working on the new theme for the blog. I have been co-opting the theme from j-maxx.net since it's about the only decent theme I've ever done before. It looks bad in IE due to dashed borders having white space inbetween the dashes instead of the background color.

For some background on the blog. I chose dasBlog as my software due to it having web services built in and has a user base of programmers I look up to. That being said it was originally .NET 1.1 software and the design is getting a bit annoying in some aspects. I'm looking at adding a better syntax highlighter, but adding it so it shows up in all the themes is not straightforward. I may just remove the other themes and only allow this one to simplify things.

I've also noticed that blogs edited after the date they were posted do not show up when you click on the date their were posted in the calendar. I'll have to track that bug down.

All in all it was pretty quick and easy to get the blog up and running. Designing the theme was very easy as well. They did a great job at allowing users to separate design from logic. I'm going to delve more into the templating system to figure out how they did it.

Comments [0] #      blog  |  kick it on DotNetKicks.com Shout it
# Tuesday, June 24, 2008
by Jeff Klawiter - Tuesday, June 24, 2008 6:25:49 PM (Central Standard Time, UTC-06:00)
Well I'm finally opening a real blog. Not sure how much I will be updating this but hey I have a real online presence again. The old J-Maxx Net will stay as it is. Still get a decent amount of traffic on there (kicking myself for not installing adsense years ago).

To start off with.. I love LINQ. I've been looking into it for over a year now but finally have a project where I get to use it fully. C# 3.0 has added so many features I no longer pine for PHP as I once did. Here's a sample below of something I wrote the other day.

            var result = from c in CurrentDataContext.Categories
                         join localinfo in CurrentDataContext.CategoryLocalizationInfos
                            on c.CategoryID equals localinfo.CategoryID
                         where c.CategoryID == CategoryID
                         && localinfo.Language == Language
                         select new Business.Data.Category()
                         {
                             ID = c.CategoryID,
                             Description = localinfo.Description,
                             Languages = GetLanguagesForCategory(c.CategoryID),
                             Name = c.Name,
                             SortOrder = c.SortOrder,
                             Title = localinfo.Title,
                             NavImage = c.NavImage,
                             Language = localinfo.Language,
                             Links = GetLinksForCategory(c.CategoryID, Language),
                             IsDataLoadedFromSql = true
                         };

Comments [0] #      C# | LINQ  |  kick it on DotNetKicks.com Shout it