Tuesday, February 27, 2007

Jeff Atwood posted a great article talking about programmers that can't actually program.

I've been thinking about this a lot lately. Actually, lately is probably the wrong word, because I really started thinking about this way back when Joel Spolsky posted his infamous article on why he believes that colleges should teach C instead of Java. When that article came out, I had only been out of college for about a couple of years, but during that time, I had already seen my share of examples of programmers who couldn't program. Joel's article couldn't solve this problem for me, though, because these programmers would have had just as much trouble developing in Java as in C.

For many (non-)programmers, there seems to be a fundamental misunderstanding about programming in general, particularly with the ability to formulate basic algorithms to solve simple tasks. One example involved a programmer that had trouble with anything beyond placing formatted data to an HTML form. This programmer was tasked with moving through a DOM table to highlight cells that had certain values in them. In programming terms, he basically had to traverse an array checking for conditions - a very simple algorithm. However, he froze when he got to that part of his project, because he hadn't been trained in thinking about problems and how to solve them.

The examples that Jeff notes are just as much or more appalling and also show that these aren't isolated incidents.

What do we do about this problem?

At the end of his post, Jeff notes Steve McConnell's book on the profession of software development. It is an interesting concept and reminds me of a conversation I had with a pharmacist I met in my MBA program. He noted that some professions, such as pharmacy, have certifications to let the rest of us know that an individual actually knows what he or she is talking about regarding their profession while there are other professions that don't provide any sort of guarantee as to the actual knowledge someone possesses. I'm reminded of my wife in this case, because she has certifications for speech and language pathology. One of the requirements for her to keep her certifications is that she must have X number of hours of continuing education each year.

Could something like this work with software development?

There are obviously already many different certifications that exist (Microsoft certifications, Sun certifications, Oracle certifications, the list goes on), but that really brings out one of the problems with certifications in software development. I don't want to be a good developer with just Microsoft tools - I want to be a good developer period. If a software development certification existed that could ensure that someone was a competent developer and had a good knowledge of programming in general, it might work, but then again, the field changes constantly.

"OOP all the way!"

"No! TDD all the way!"

"Oh yeah, well, what about functional programming?"

"But... you can have functional and TDD at the same time!"

"You guys are all morons, QUANTUM programming is the way to go!"

It would be nigh impossible to have a certification that would be relevant and, more importantly, STAY relevant.

I'm sure I'm not adding anything new to this subject, but it has been on my mind for a while. I think I like the idea of a certification that requires continuing education - that almost seems like a must with software development. I primarily work with .NET 2.0 right now but it almost feels like what I'm working on isn't even relevant because of all the talk about .NET 3.0 (I know, just an extension of .NET 2.0) and LINQ, DLINQ, etc (actually coming from the upcoming new version of the framework.... 3.5?).

How would continuing education be defined in software development? Is it conferences? Reading blogs or books? Working on a variety of different projects so that you gain experience with different technologies?

Can the problem of programmers who can't program even be solved?

(By the way, before someone starts griping, I'm not advocating certifications... at least I don't think I am. I just want to see this problem fixed. Isn't that what all programmers want to do? Solve problems?)

...

I think this might be one of the longest posts I've ever written.

NOTE: This post was NOT inspired by anyone in particular... don't worry. Don't go thinking you're an awful programmer and I hate you.  :-)

posted on Tuesday, February 27, 2007 12:53:07 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Monday, February 26, 2007

I guess Worse Than Failure fits a little better than what I had resorted to calling it on my own: "Where's the Function?"

It didn't communicate the same feeling of horror and disbelief as the actual, intended acronym, but it was cleaner and easier to speak openly about among the cubicle farm :-)

Now to get used to the new name.

posted on Monday, February 26, 2007 7:18:23 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Tuesday, February 20, 2007

Check this out...

My Vista stability score was well on its way back to 10 when I got hammered with some hard crashes in Internet Explorer. It took me a while to figure out what the problem was, but then I noticed the Sun Java icon in the toolbar and the Data Execution Protection message...

I had recently enabled DEP with Internet Explorer via the Internet Options menu (you'll have to run Internet Explorer as an Administrator before you can change this option). I was sort of curious about it and wanted to check it out.

I discovered about DEP and Internet Explorer 7 via Michael Howard's blog and I also verified from a comment to his post that (as of the writing of this post), the Sun JVM does not work with DEP in Internet Explorer.

So, if you're getting a lot of random crashes in IE, don't stress out. It might be DEP.

Too bad my stability score had to drop so low, though.

posted on Tuesday, February 20, 2007 8:05:41 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Monday, February 12, 2007

Lately, I've been doing some work with the WebBrowser control (new in the 2.0 framework). It really does offer a lot of benefits over directly using the underlying ActiveX web browser control. And when the new functionality doesn't cover a need you may have, you can always get at the ActiveX control (though you'll need plenty of COM interface definitions - hello pinvoke.net!).

The typical usage scenario with the WebBrowser control is that, if you want more than just a basic control, you're going to inherit from it. I was wanting to be able to provide a custom context menu instead of using the default IE one. Here comes MSDN documentation to the rescue! According to the documentation on the protected CreateWebBrowserSiteBase method, the method can be overridden to provide a custom WebBrowser.WebBrowserSite object. Here's the quote from the documentation:

To use this feature, implement classes that inherit from the WebBrowser and WebBrowser.WebBrowserSite classes. The unmanaged WebBrowser ActiveX control uses the protected CreateWebBrowserSiteBase method to retrieve extensibility interfaces implemented by the WebBrowser.WebBrowserSite class. Override the CreateWebBrowserSiteBase method to return an instance of your own class that inherits from the WebBrowser.WebBrowserSite class. The WebBrowser.WebBrowserSite class provides default implementations of the OLE IDocHostUIHandler. You can provide your own implementation of this interface or implement any other WebBrowser ActiveX control interface in order to customize the behavior of the control.

Super!

Because the WebBrowserSite class is protected and internal to the WebBrowser, your implementation must be internal to your inherited WebBrowser class to have access to it. Like so:

public class CustomWebBrowser : WebBrowser
{
	private class CustomBrowserSite : WebBrowserSite
	{
		// Your implementation
	}
}

So, I happily pulled up the interface definition for IDocHostUIHandler, coded it up and made my custom WebBrowserSite implement it. To verify that it was working, I just stuck a message box to tell me hello in the ShowContextMenu method. When I ran my test, I right clicked and saw a context menu... the default context menu! Huh?!?

I was positive I must have missed something, because the documentation is CLEAR on the fact that this scenario is possible.

And yet... and yet... WHAT IS THIS?!?

More searching and I find that there is a bug reported for this exact scenario on Microsoft Connect! And what's more, it has been closed because it has been postponed!!!

This wouldn't really irk me so much except that the documentation specifically says that it can be done. Here is a snippet of the reasoning behind closing the bug:

... The bug you entered has been reproduced, but our evaluation determined that it does not meet the criteria to be addressed in this release. The main reason for this is that in this release, our webBrowser control is tightly tied to the IDocHostUIHandler not leaving much room for such customization. ...

Why, oh why wasn't this tested? The documentation says THAT THIS CAN BE DONE! Don't post documentation that says that you can do this and then tell us that you can't because your implementation won't allow it!

Luckily, there are 2 workarounds listed that let you hook your own IDocHostUIHandler implementation in (it involves implementing ICustomDoc and calling the SetUIHandler method, see this CodeProject article for more details). Tightly tied my butt... the workaround gets the same results just fine.

posted on Monday, February 12, 2007 1:01:36 PM (Central Standard Time, UTC-06:00)  #    Comments [1]
 Monday, January 29, 2007

Windows Vista has been released for public consumption! That makes it sound like Vista is some sort of sandwich or something...

I thought that the official release date was going to be tomorrow (1/30), but you can download the Ultimate Extras now. So far, the BitLocker stuff and the Hold 'Em game are out there. In other news, you can get the 1.5 version of Windows OneCare, which supports Vista. It's not even beta!

Now all I need is the full release of PowerShell for Vista and I'll be set (check, PowerShell for Vista has been released)!

(and the update for Visual Studio 2005 to run on Vista)

(and updated drivers/software for my HP printer)

(and updated drivers/software for my Logitech MX1000 mouse (check!))

(and updated drivers/software for my Logitech 880 remote)

(and a pony)

posted on Monday, January 29, 2007 6:36:40 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Thursday, January 18, 2007

I probably should have just submitted this one to Overheard at the Office, but I'd rather post it here.

"It's not that I'm lazy, it's just that I want to be thorough."

This was from one of my coworkers who was speaking to a user upstairs.

I found it hilarious.

posted on Thursday, January 18, 2007 1:20:52 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Tuesday, January 16, 2007

I recently moved my RSS reading habits over to Google Reader, primarily because I read feeds at work and home both and I'd rather not have to keep my feeds synchronized in both places. The new design is a million times better than the old design, too.

Anyway, a feature that Google Reader provides is a location to view "Shared" items. I've started sharing items that I find interesting from my daily feed reading. So far, it is mainly some cool Engadget posts and some deals, but if anyone is interested, you can view my Google Reader Shared items here.

So now, you can see my blogroll (at the right side of the screen), my bookmarks (thank you del.icio.us!), and feed items I find interesting.

Just wait untill I post a public calendar! Hah!

posted on Tuesday, January 16, 2007 1:03:08 PM (Central Standard Time, UTC-06:00)  #    Comments [0]

We're in the process of migrating to .NET 2.0 at work and one of the the things we've encountered is a problem with remoting between .NET 1.1 and 2.0 frameworks.

This is our scenario in a nutshell.

An application is upgraded to 2.0 but is still referencing a 1.1 component. This works fine until the 1.1 component remotes to a 1.1 server. The client is running under the 2.0 framework while the server is running under the 1.1 framework. We can't upgrade the server because there are still other 1.1 clients out there as well.

What's funny about this is that it will work sometimes. Interoperability between 1.1 and 2.0 is actually fairly solid... unless you're serializing a DateTime across the wire. If you're sending a DateTime between the two frameworks, you'll see this error:

Exception: System.ArgumentOutOfRangeException
Message: Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.
Parameter name: ticks

If you were to change the server side over to run under .NET 2.0, you won't see the problem anymore. On the plus side, Microsoft has released a hotfix to address this issue (and even more information here) that specifically patches the 1.1 framework. The problem is that you've got to contact Microsoft to get the hotfix.

I'm hoping that by posting this, I will let others know about it and maybe even to get Microsoft to release it for download.

Then again, maybe no one else has to deal with this issue :-)

posted on Tuesday, January 16, 2007 12:38:32 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Wednesday, January 10, 2007

A recent post by Lee Holmes on breaking your writer's (blogger's?) block is prompting this post. I recently finished reading Steve McConnell's book, Code Complete*, over the Christmas holidays and the book was amazing. As I read it, I began taking lists of things I wanted to post on that were excellent advice... and ran into a block because there was just so much I wanted to say about. I still plan on writing more detailed posts on the issue but, as Lee suggests, I need to just get out here and post more.

So anyway.

Recently, I posted an entry on calculating file hashes with PowerShell and promptly had to put an update because the PowerShell Community Extensions (PsCx) had provided a better file hash function. The good thing about PsCx is that it really provides a good example of PowerShell code and has a lot of cmdlets that drive home automating PowerShell for your needs.

One of my favorite functions is incredibly simple but it highlights how you can save just a few keystrokes for more productivity. The Edit-File function uses a predefined variable that points to an EXE path and runs the EXE with the specified parameter. There is also an alias for it (e) so you can type something like "e somefile.txt" and it will open. I like this method a little better than actually renaming notepad.exe to n.exe (*cough* Scott Hanselman *cough* :-) ). It actually prompted me to create multiple, similar functions so that I can open files in different editors (I use Ultra-Edit, Notepad2, Notepad++, or who knows what else) without having to respecify the editor variable. Now I type "u somefile.txt" to open a file in Ultra-Edit.

This also prompted me to set up the winmerge function below:

function winmerge ([string]$path1, [string]$path2) {

    $winmergePath = "c:\program files\winmerge\winmerge.exe"
    . $winmergePath $path1 $path2
}

It allows me to quickly see the comparisons between two different files without having to preselect them with the mouse. It is simple, but quite convenient. And I also don't have to go adding all sorts of random directories to my PATH just so I can get to them more quickly.

So there you go: my PowerShell automation.

I also promised some unrelated updates. On Monday, January 8, I had LASIK surgery on both of my eyes to correct my extreme nearsightedness. The whole operation took 15 minutes and the only discomfort I had was a headache and some stinging eyes on the day of the operation. Since that time, my left eye can already see with 20/15 vision. My right eye is still a little fuzzy, but that is supposed to clear up in another day or so - it took the laser twice as long to correct my right eye as it did my left eye!

If anyone is interested in more details on my experiences with LASIK, I'd be happy to provide a follow-up post on it.

* - Jeff Atwood really should get some sort of referral rewards for recommending Code Complete... I mean seriously...

posted on Wednesday, January 10, 2007 9:38:44 PM (Central Standard Time, UTC-06:00)  #    Comments [0]