A Day At The Visual Studio 2008 Launch Event

12 April 2008

So this last Tuesday I was able to go the local incarnation of the Visual Studio/Windows Server/SQL Server 2008 product launch. It was moderately fun and free. The training in the Dev track was pretty basic, so I didn't learn much except in the session on developing Office Business Applications with Visual Studio. I didn't know anything about that, so I learned some new stuff there. However, I don't ever do that kind of development (and don't really want to), so I'm not sure I'll be able to use much of what I learned. I should have taken a non-developer track. I probably would have learned more.

The greatest thing about going was the free software. I got a free copy of Visual Studio 2008, Windows Server 2008, a voucher for a copy of SQL Server 2008 (not finished yet), and a copy of Vista with SP1 integrated. Getting the first three was the main reason I signed up. The last I didn't know about, so it was a pleasant surprise. Of course, at this point I don't have any hardware that will run it, so I need to find the cash to buy a new computer...

I think there are still some launch events happening around the country. So if you need the software, I recommend finding one near you if you can.

Comments:0

Listen To Dot Net Rocks

19 February 2008

If you are not a regular listener of .NET Rocks!, you should checkout the recent episode done (in part) with Scott Guthrie. He discusses a lot of the very interesting things coming down the pipeline for .NET developers.

Comments:0

On Removing HttpContext Dependencies

23 August 2007

A faithful reader of the blog commented on my post the other day about using HttpRuntime vs HttpContext. Anderson's main point is absolutely right, and worth repeating. Here's what he said:


"You might consider refactoring your methods so that they don't have dependencies on context. If you have methods that depend on context to execute, you are not 'Unit' testing them, you are performing a functional test.
"It's a thin line and hard to keep straight, but basically your methods should be refactored to accept information that your presentation tier passes to them, rather than having them pull it straight out. Once you have done this, you can perform a "real" unit test that only tests that one unit of code, without dependencies on your presentation tier."

Having a dependency on the HttpContext in anything other than the UI makes the code much more difficult to test. There are ways of doing this by spinning up Cassini or even IIS in the background (ouch), but in general just keep HttpContext out of your BL and it will make testing a lot easier.

Of course there are two things I want to throw in here. First, we're doing this on an existing application. This is the second application I've worked on where we tried to retrofit the app for easy testing. At another job we failed to get adequate testing done on an application because of complete lack of support from upper management and whatnot. Fortunately at the current locale, we've got this being pushed by someone both smarter than me and with more clout than me, so we have a better chance of success :). Not only do we have HttpContext in our BL that we need to get out, we've got DL code in our UI code that bypasses the BL layer that we need to purge! If it was a new application, and we were building it for testability from the ground up, as I bet you know Anderson, it's a lot easier to build in looser coupling! It's refactor time...

Second, I would say that just about everything that you could get from HttpContext.Current via property should stop at the UI layer, with one exception: caching. It's made more sense to me to have the BL layer know caching and not the UI layer, so you need to be able to test the caching as a part of the BL testing. Even if one wants to make a strong distinction between "unit tests" and "functional tests", if you switch to HttpRuntime.Cache, you no longer have an external dependency (technically you do because it's in another dll, but you can depend on it being there, so it's not really a big dependency). In our case specifically (not to go into the details of how the guts of this application works), the BL has to know about the caching. So I think it makes sense here.
Comments:3

Real Technology Heroes

21 August 2007

It's sad, but I've met a number of these guys. I've even been some of them at one time :)

Real Technology Heroes

Thanks for the link, Robert!

Comments:2

Visual Studio 2008, Beta 2...Installed!

31 July 2007

I'm not generally averse to trying out beta, or even alpha software. On something as big as VS I am. With beta 1 I went the virtual machine route, which worked great. But for beta 2 I decided to actually install the thing on my dev machine at home. I was a little worried, but here in the next few months I'm due for a rebuild anyway.

I did a full install minus Crystal Reports (because I firmly believe that Satan invented and continues to develop it) and Sql Server 2005 Express (already have that). The install took about 40 minutes, with no issues.

I upgraded a WPF project with no negative ramifications. Did the same with one web project. All seems to be working well. I also made your my VS 2005 projects still worked, and they do.

So, in my experience, everything is peachy.

Comments:0

ALT.NET - Some Great Ideas Guys, But Get Over It

05 June 2007

I have to agree with Jason on this one. A lot of the ALT.NET stuff I am seeing in the blogs and whatnot just seems foolish to me. There are a number of great tools or ideas in the list, but the approach is just silly. Roy gives a disclaimer of "I don't necessarily agree with the list here" and says he will post his thoughts later, but either way he is fanning the flames of thinking in trends and not thinking of what is actually best. I get this same feeling all the time when I listen to agile people. I usually end up agreeing with most of what they say, but they are so often too filled with zealousy that they have forgotten that you can still complete projects just fine without agile. Though I do think a more agile approach would often work great in development work, it is the attitude that is annoying.

Problem two with this list: who considers all this "hot". The bloggers? They make up a very small percentage of the programmers out there. Most of the programmers I run into are completely oblivious to what is happening in the .NET blogosphere. Even if that list is representative of the .NET blogging community (and I think only partially so), we are still dealing with a small minority of the population.

We are supposedly an industry of intelligent people. We have to be smart to deal with all this programming stuff, right? At least semi-smart? If so, let us pick technologies and practices with our head. Let us be able to look through the popular, the trendy, and whatnot, and apply all this in a much more sane manner. That's what they pay us the big bucks to do.

Comments:0

MIX Thoughts

30 April 2007

No, I'm not there. But I just watched the keynote live :). I must say, Microsoft continues to blow the developer in me away...

  1.  Silverlight video streaming. They're starting to roll out a new server for streaming video for you. And it will be free... That's awesome.
  2. Expression studio is now out. Cool. I need to get me a copy of that...
  3. Silverlight 1.0 is now officially in beta. Woohoo!
  4. Silverlight 1.1 is now officially in alpha. Man this is going to get confusing...
  5. They just can't seem to rest. Blend 2 already has a previous out.
  6. So Silverlight WILL be distributed as a miniature .NET Framework install. That's right. .NET running on a Mac. But that doesn't come with 1.0. It comes with 1.1.
  7. Silverlight 1.1 will have linq. That is as surprising as it is cool.
  8. In Silverlight 1.1, the xaml files will have a code-behind. That's a very familiar metaphor, and a good idea for us dev types.
  9. So Scott Guthrie did a demo of a Silverlight app running on a Mac. He then set a breakpoint in Visual Studio on his windows machine. Then the Silverlight app running on the Mac hit that breakpoint. He then proceeded to interactively debug. That is FREAKY COOL.
  10. They announced a dynamic language runtime and that they'll be supporting"Iron Ruby", Ruby for .NET.

Man these guys just don't know how to quite. I've really got to get my day job to upgrade...

Also, Silverlight has its own site now, http://silverlight.net/. I tried to leave a message in the forums and it broke. Oops :). Apparently they have some bugs to fix!

Comments:3

Code Thought of the Day

27 February 2007

Last week the guest on DotNetRocks was Steve McConnell, author of Code Complete. I had read about 2/3 of the first edition and liked it, so I wanted to get the new edition and read it. My team lead was nice enough to buy it for me and expense it, so I am reading it now. Here's a thought that is often so true. Many businesses Every business I've worked at since my foray into full-time software development could learn from this:

"In many projects, the only documentation available to programmers is the code itself. Requirements specifications and design documents can go out of date, but the source code is always up to date. Consequently, it's imperative that the source code be of the highest possible quality."

Alas, will the world ever learn? Surely some of you have been somewhere that doesn't have this problem :) 

Comments:0

A Few Notes on the Logging Application Block

05 December 2006
We are switching a project I'm working on from a custom logging solution to the one built into the Enterprise Library, the "Logging Application Block". This is nice, because it means we can get rid of quite a bit of custom code (that's code we no longer have to debug or maintain). The logging application block is very well done as far as I can tell thus far. It makes it very easy to configure logging without having to change code.

Because we do have a particular way of logging that doesn't fit exactly into what the app block does, I did have to create a custom trace listener. But even with that I was able to remove several hundred lines of unnecessary code.

I think there are really three main advantages for going this route. First, the logging is completely configuration file based, and in the app.config. This is excellent, because QA and our deployment team to change the logging for debugging's sake without having to have development mess with it.

Second, when you use a solution like this you have a much better chance of pulling off consistency across groups. If everyone is using the same logging solution, then everyone knows what to expect and what to do when they need to deal with any aspect of logging.

Third, as it was said above, it requires less code. Granted, it is probable that the enterprise library team did not write the application blocks without defects. There may be some bugs in the logging application block. But I can guarantee that their code was more extensively tested than our internal code. I trust it quite a bit more.

A temptation that we programmers can easily fall into is the desire to over-architect and write code we don't really need to write. I have that same temptation. I like programming. I like flexing my programming muscles. And sure, we all program extraneous things to learn more about our craft. That's very important. But as professionals, we need to think about what needs to be created, not necessarily what we want to create. We're lucky when those are the same. But when they are not, we shouldn't pretend that they are.

Now, a little nitty-gritty. There are a few important sections in the configuration of the logging application block. <listeners /> is the section where you define what listeners you want to use, whether that is a built in listener like the file or event log listener, or a custom listener. These are the things that "listen" for logging requests, and log appropriately.

The <formatters /> section is a little more boring, but can be useful for formatting the log messages.

The use of the <specialSources /> section is not immediately obvious, and took a little digging, and this posting was helpful. Essentially, the listeners listed here are used when the typical logging fails, and something needs to be logged about that.

The most important section is the <categorySources /> section. That is where you route different categories of log messages to different sources. For example, you can log "information" log requests to the event log, and "errors" to a database log. You can route things to email, a message queue, a text file, or a custom trace listener. If you want to go the custom route, you can maybe send an instant message or an sms message.

It is the last bit that I find most useful. Because it is configuration file based, anybody can change what goes to where anytime they want to, and no code needs to be touched. What a good idea that was...

If you want more information, I recommend reading the documentation and checking out this series of posts. That link is to part 4 in a 4-part series since it is only the last part that has links to all the other parts in the series.
Comments:0

Jury Duty, Lean Software Development, and Getting Things Done

07 September 2006
One of the best things about getting called for jury duty is that you get lots of time to read. Yesterday, during my wait at the Crowley court building in Dallas, I was able to finish two books. The first was "Lean Software Development" by Mary and Tom Poppendieck. The second was "Getting Things Done" by David Allen.

I've been toying with agile concepts for a while in my mind and in my personal development time. I've thought for a while that there were lots of good ideas there, but have been pretty happy with the ideas of more typical, classical approaches to development as well. This book was definitely the most convincing thing I've ever read on agile development principles. It was often just ruthless in its common sense and logic, and I found many times that as they described a problem with typical software development processes I would go "Yeah, that IS a problem." So many things that some corner of my mind knew but refused to acknowledge, they brought out to light and exposed. I can't think of a software development book that has affected me quite the way this one has. I'm about to start my second read just so I can really get it.

The other book was pretty good. I'm currently trying to put his process in place. I really do have lots of things going on and have a hard time managing them. Not so much because the amount of stuff is insurmountable, but because my organization system just doesn't help me remember to do things on time and well. So, I'm trying what he says. We'll see if it works.

As for jury duty, during the actual jury selection process the prosecution and defence kissed and made up, so we were dismissed right before the jury was to be selected.
Comments:0

The Development Abstraction Layer

12 April 2006
Interesting article by Joel.

I think this article is basically saying the following: 1) every distraction that programmers have that they do not need to have needs to go away, 2) they should be catered to, and 3) everybody else in the organization exists for the purpose of supporting the programmers, either by doing 1 and two above or by being the machine to sell and support what the programmers make.

I love it. Love it, love it, love it. After all, I am a programmer! In some kinds of companies there is some validity here. Let's say you have a company that makes is money on selling software. In this case those things really are true. If you have a company, however, where IT is just a small part, a sort of infrastructure, then not everything there applies.

The unfortunate thing about these ideas, especially number 2, is that it is easy to get the idea that programmers are just a bunch of babies. Some are, of course, but I don't think that is the case usually. This is assuming, of course, that we're talking about good programmers. Bad programmers may or may not be babies, but they should be fired and replaced anyway. Anyway, I digress. I don't think it's lack of maturity or a sense of entitlement, but that there is a programmer culture that is radically different from that found in other groups such as sales, accounting, support, management, etc. ALL of these groups have different cultures, and development's culture is radically different from the others. Take, for example, the idea of giving developers their own offices. This actually makes a great deal of sense for programmers. Distractions are very costly to development. It's just disastrous when a developer gets "in the zone" and is then distracted by some pesky manager about this or that project. Granted, developers have to be distracted sometimes (yes, it is ok to talk to developers), but as a general rule they should not be. When developers are "in the zone" they get a lot more and better work done. That's what you want, right?

And its not that programmers should be catered to and no one else. Every group needs to have their needs met and be satisfied at their job, because you'll get a higher retention rate and satisfaction level, which will greatly affect the effectiveness of your company. And one of the important points that can be drawn from Joel's article is that when any group is cental to the company, it SHOULD be catered to, whether that's sales, support, or development. For ISV's this often, if not always, is development.

Make a truly good development environment and you'd be surprised what you can get out of your programmers.
Comments:0