If Only This Were a Joke

by Nick Thursday, November 13, 2008 9:41 PM

This was the Dilbert in my daily pull off calendar yesterday:


King of Useless Comments

by Nick Thursday, October 09, 2008 10:02 PM

There is a lot of debate among programmers about the proper way to comment your code.  One type of commenting that is sometimes more difficult, is how to comment code that is related to a bug fix.  We've all encountered the types of comments where the programmer states the obvious:

int i = 0;  // Initialize an integer to 0

But "bug fix comments" can sometimes really be longer than necessary.  Here is a typical example of what I'm talking about:

//# Bug #: 1234
//# Date:  10/2/2006
//# Name:  John Smith

This type of commenting drives me nuts for a couple different reasons.  For one, it takes up a huge amount of screen space, which breaks up the flow of the rest of the function, and makes it hard to understand.  Can you imagine if a single method had 3 or 4 of these "bug fixes" in them?

Secondly, for all that space taken up on screen, what information did we get?  We got a name, a date, and a number.  What was the defect?  How did this method call actually fix the defect?  We don't know.  Now, if you feel the need to add a comment when you insert code to fix a bug (and I can be convinced pretty easily that there is value to doing that), why not this?

// JS 10/2/2006 - Added call to fix Bug 1234.  This method includs missing validation logic that was causing exception
Was that so hard?

You Can Also Find Me On StackOverflow

by Nick Monday, October 06, 2008 10:28 AM

Like most of the engaged developer community, I have discovered StackOverflow, the marvelous creation of Jeff Atwood and Joel Spolsky.  You can see my profile here.  So far I like the site.  The purpose of the site is to be the anti-Experts Exchange.  We all know Experts Exchange, and we all hate it's existance with a vengence.  It's the ultimate Walled Garden, and it sucks in Google furiously, so that its hard to actually find the answer to a question.  StackOverflow looks to succeed with developers where Experts Exchange has frustrated us all greatly.

I've yet to ask a question on StackOverflow, but I have spent a little time answering some questions, and even earned myself some of the easy badges.  It's a nice little ego stroke.  And overall, I really like the site.  It it easy to use, uncomplicated, and rewards people nicely, and at the same time seems to get the best answers to float to the top.  But it's also my nature to criticize a bit, and so here are the things I don't like about StackOverflow so far:

No Way to Link Duplicate Questions:  StackOverflow is sort of like a big Forum from the 1990's, but with extra "social networking" and "web 2.0" juju sprinkled in.  What that really means is that the user habits of a forum are likely to emerge very quickly, but that the site itself is just easier to use.  Because really... web 2.0 really just translates to good usability... not necessarily good user habits.

Probably the largest problem faced by a Forum moderator is the need to post a big post at the top of the forum that is called "FAQ - Read this First Before Posting" which is then largely ignored by everyone who goes on the forum so they can re-ask the question that was already answered in the FAQ.  In fact, odds are pretty much guaranteed that someone has complained about this already in the StackOverflow feedback area, but I'm too lazy to find it.  And there in lies the problem.  Once someone finds it, it would be nice if there was easy web 2.0 juju to link those together.

You can't prevent people from submitting duplicate questions because people are inherently lazy.  They don't want to go to the trouble of actually searching before asking, and maybe that's ok.  But by the same token, if someone is active in the community, they will eventually notice the same questions popping up again and again that they have already answered.  It would be nice to give them the ability to link questions together, rather than simply copying the same answer again... or worse, not bothering to answer the question again, because that gets frustrating, and in the end it doesn't serve the person asking.

How Many Profiles Do I Need?  StackOverflow is still in beta, and they are requesting input into new features, and also help with bugs.  They also have a nice blog where you can read up on the latest news.  But you'll notice that those two sites use different engines to run them.  That means that if I want to fully participate in the StackOverflow community, I need to not only register with the main site (using OpenID - YEAH!) but also with UserVoice for their bug/feature too (which doesn't use OpenID).  And since their blog is not linked into main site either, if I leave a comment on a blog post it doesn't connect up with my main profile.  This seems very strange to me for a site that is encouraging feedback by giving you points for helping.  No points for commenting on the blog?  No points for giving feedback on the site itself through UserVoice?

I understand the desire to not re-invent the wheel for a feature that is not core to your site.  After all, they went about the task of creating a site for answering questions, not blogging or bug tracking.  But at the same time, it would have been nice if they could have at least picked 3rd party software that adhered to the same principles as their core site... one of which being ease of sign up (though OpenID).  I don't know of a bug/feature site that use OpenID off hand, but I do know that DasBlog now supports OpenID.

And really, how much different is a blog post from a question?  And how much different is a feature request from a function?  I would think that they could have fairly easily incorporated all those features together, and encouraged even more feedback.  As it is, I don't want to post on their feedback site because I don't want to have to re-register again.

I'm sure more will come to me as I use the site more, but those two things jumped out at me almost immediately.

Codeapalooza Coverage

by Nick Saturday, September 06, 2008 10:10 AM

I drove down to Wheaton, IL for the Chicago .NET User Group's Codeapalooza.  They have a lot of sessions, and its impossible to see all them, here is the coverage of the ones I chose to go to.  I'll be updating this post after every session, so feel free to check back throughout the day.

SQL Server 2008 for Developers by Sam Nasr:  Best Quote - "I drank the punch a long time ago, so I only really know Microsoft stuff."  Covered quite a lot from platform features, to T-SQL, data types and reporting services.

Talked about new data auditing features, but then mentioned the four common fields that everyone adds to a table (CreatedBy, CreatedDate, ModifiedBy, ModifiedDate) but didn't really talk about how the two work together, or if the new data auditing features is a standardization of that classic DBA paradigm.  Auto Synchronization of data with a SQL Server Compact Edition database.  Cool!

Definitely some cool new T-SQL features, like the ability to pass in an entire table into a stored procedure.  Would that really simplify writing bad code?  FileStream Object Storage looks cool as a good alternative to binary blobs, with better management than just storing a path as a string in a table.  Finally you can create and initialize a variable in one statement!  Plus some new operators like +=, and the ability to insert multiple rows in one statement.  Both of those are a long time coming.  Intellisense!!!  Thankfully the Intellisense improvements are with SQL Server Management Studio 2008, even if you're connecting to a 2005 Server.  Very nice.  There is of course more (like grouping sets), but some of that stuff is beyond me since SQL is not exactly my forte.

HierarchyID looks very much like an XML Data Document (especially with the methods), but it doesn't support moving to XML built in.  Very strange.  But for creating tree structures in your data, it looks very cool.  Nasr concentrated on using it for organizational charts, but tree structures are a very common solution to a lot of programming problems.  This simply creates first class support within T-SQL for a common database paradigm for a parent child relationship with an ParentID field.

WPF Demystified by Dave BostBest Quote - "Where are the designers?  It's hard to tell, I don't see a turtleneck or a beret."

WPF in and of itself is a huge topic, so you're not going to cover it in an hour.  So this was treated more as a showcase of what WPF can do.  He interestingly focused on developer vs. designer, and how that is handled by WPF and new technologies (no more battleship gray).  Focused, once again, on the fact that .NET 3.0 runs off of the .NET 2.0 runtime (in other words... there were additions... but not changes).  Important note... the .NET 3.5 SP1 requires .NET 2.0 SP1 runtime.  You cannot run 3.5 SP1 applications on the 2.0 standard runtime (without the service pack).

Unfortunately... this talk wasn't as in depth as I'd hoped.  It really was the same overview presentation I'd seen many times.  Here's XAML... Windows Forms isn't dead... etc.  There is Expression Design, Blend and Web (which replaces Frontpage... Frontpage is Dead!).  There is also Expression Media.  Lots more tools in that family than I was aware of (with virtualization so they can run on Mac).  Best question:  "Is this Standards Based, or Standards Compliant?"  Excellent spin!  I always ask about SVG because XAML looks so similar to SVG.  Not surprisingly, nobody at Microsoft seems to realize (or is willing to admit) that XAML was invented 10 years ago and was called SVG.

He shows some cool sample XBAP applications on the internet that demonstrate the power of XAML.  The coolest was the British Library's "Turning the Pages".  You can use it to virtually read their collection of precious old books which are normally under glass and unavailable to regular library visitors.  There is also Vertigo's Family.Show which is a XAML application to visually represent a family tree.  And of course, don't forget Scott Hanselman's Baby Smash which is great for keeping your kids out of trouble when they start pounding on your keyboard.

So how do you start?  Learn XAML first, and then find out what parts of XAML work in WPF and in Silverlight.  The goal by Microsoft is to make Silverlight and WPF more similar.  Its not always possible because the browser environment restricts us in many ways.  Then he worked through one of MSDN's Virtual Labs, which you can do to also.

Of course, Expression Blend doesn't have built in integration with source code control.  Supposedly it's coming, but I consider that a must have if you want designers and developers to work together well.  I also don't like how the XAML designer in Visual Studio is so pared down.  It forces developers (who don't have a designer on staff) to buy two applications.  Doesn't Microsoft realize that developers are cheap?!

ADO.NET Entity Framework with Fakher Halim:

This guy has his presentation almost way too prepared.  He might as well have been reading off of a teleprompter.  Maybe not good for this type of group.  Actually, we never really got to see much code at all.  He mostly explained why we should be using something like the Entity Framework.  For God's sake, this guy is drawing a keyboard and mouse on the white board!  I wish they had brought somebody in to actually talk about the Entity Framework.  This dude is a PhD, talking at such a high level that it's useless.  A wasted hour.  I feel sorry for this guy because he's got to watch people file out one by one.

As it turns out, this guy was also sitting in the front row of the WPF talk I mentioned earlier, and he kept on asking questions that were totally off topic and taking us away from what were were all there to talk about.  He kept complaining that forms weren't looking like forms any more, and that we were breaking the old fashioned user experience paradigm.  At some point, old dogs have to learn new tricks.

ADO.NET Data Services with Jim Fiorato:

This is all new to .NET 3.5 SP1 (and used to be called Project Astoria).  It's a pattern to present data on the web in a way much simpler than SOAP.  The results of data calls in web services are definitely not human readable.  So web services are great, but they're not easy to consume unless you're in Visual Studio and possibly Java.  This fits really well with the new MVC and JSON technologies coming around.

Data Services can either return data in an ATOM format or in a JSON format for use in Javascript.  I'd never really seen JSON before, but he had an example of a data structure in JSON... and it's super readable.  This all fits very well with the newer paradigm of RESTful services coming around.  I'm going to the REST presentation later, so this will bookend very well with that.

This has not been a good afternoon for presentations.  This guy has a Mac Book, and for some reason couldn't get it to work with the projector.  So they had to bring in another laptop, and get Virtual PC installed... and well... the presentation isn't as good as it could have been.

Once he finally got everything up and running, he basically created an Entity Framework project and exposed it value a WCF service using ADO.NET Data Services.  Essentially all this does it allows you to translate a URL into a LINQ query seamlessly.  He spent half the time just typing URL's into a web browser and showing the results.  No code for parsing the URL, or any code written.  All that query string functionality comes built in out of the box.

The idea of a query interceptor was pretty cool, in that you can now perform extra logic before the query takes place and then modify the query based on that logic.  For instance, you can modify a GET to only return data based on someone's permissions.  There was an excellent question on Transaction support.  For this model, there is no real support for Transactions.  At that point, you are best going to full blown Web Services.  This is great really only for fast read only data access.

Rest and JSON using WCF and ADO.NET Data Services with Larry ClarkinBest Quote - "You can explain any software concept using Star Trek.  After all, Capt. Kirk was the first blogger."  It's tied with "The new Hello World is - Let's build a blog!"

We had low expectations to begin with since he came into the room and said "Well, I haven't finished my presentation yet."  Way to represent Microsoft Larry!  And true to form, he actually started out by not talking about REST and JSON, but instead started talking about photography... specifically showing Sea Dragon.  Looked pretty cool.  Deep Zoom is actually part of this, and is built into Silverlight.  It is similar to Google Maps in that it delivers the different pieces of resolution in tiles, but it is much smoother.  It might actually use the new JPEG 2000 in order to do part of the render.  He also showed Photosynth (which I hadn't heard about).  It allows you to splice together different angles of a location, and using the EXIF data out of the picture along with spatial recognition, it creates a 3D scene.  One note that Larry mentioned is that you shouldn't use cropped photos, because the focal length is not synced with the result of the crop, and that screws up the software.  Finally he showed AutoCollage, which loads a whole slew of photos and tries to auto create a collage based on what the software thinks is interesting.

So this ended up being a much more overview look at REST (Representational State Transfer) and JSON (Javascript Object Notation), and even some old school (at least in the .NET time frame) serialization.  Of course, I remember writing MFC serialization code in C++.  He started by showing what the XML Serializer will do for you out of the box... which has been available since .NET 1.0.  I do think he spent too much time talking about existing technologies, when the topic was supposed to be REST and JSON.  Though the attributes you can apply to the classes to control XML Serialization also apply to REST serialization since REST is still XML, though much simpler than SOAP.  Is REST better than SOAP?  REST is much simpler than SOAP, but SOAP has more features for transactions and such.

Why JSON?  Well for one, it avoids the angle bracket tax.  However, its also great for use with Javascript since all parsers know how to deal with JSON.  After all, it's called Javascript Object Notation.  So there is no need to parse the data on the client side, so application development is faster and easier.  It's also faster to run on the client running Javascript.  But don't use JSON for a thick client or for Server-Server communication.  For that, you ought to be using XML (through SOAP or REST).

Then he showed some code on how to deliver JSON through a WCF service.  Overall though, he gave a great overview presentation.

Email Problems

by Nick Thursday, September 04, 2008 6:22 AM

My hosting provider is having email issues right now.  Any email sent since last night to nick-at-nickschweitzer-dot-net has not gotten to me, and may be lost.  I still don't appear to be getting any email sent to that address.  If you're trying to get a hold of me, try sending to schweitn-at-gmail-dot-com.  I'll update this post as the situation changes.

Update:  Email is being delivered to my normal email addresses again, but I'm afraid anything sent last night until mid morning today was more than likely lost.  If you emailed me something during that time frame, please send it again.

Google Chrome - Fail

by Nick Wednesday, September 03, 2008 7:13 PM

Everyone seemed to be pretty excited about Google Chrome yesterday.  I consider it to be a massive failure.  On my desktop machine running Vista, I decided to set it up with security in mind, among other things.  So I created two accounts.  The first is an Administrative account which I rarely use.  The second account is a lower privilege account.  If I want to install any software, I want I log in as the Administrator, install and get out.  My day to day usage takes place on my standard account.

Google Chrome however installs to App Data.  So when I install as an Administrator, it is only usable in the account that did the installation.  My normal day to day account can't run it.  So do I now have to install the software for every user on the machine that wants to run it?  Where's the security there?


Have You Hugged a Developer Today?

by Nick Friday, August 29, 2008 9:11 PM

Great video by the folks at Devshop.

Via Max Pool.

Be Back Later

by Nick Thursday, July 24, 2008 10:19 PM

Well folks... I'm off to the west coast for a little while.  Blogging will be intermittent at best.  Stay well, and leave the light on for me.

Computer Bugs According to Sesame Street

by Nick Monday, July 21, 2008 9:09 PM

I'm waiting for someone at work to blame aliens...

Useful, to a Point

by Nick Friday, July 11, 2008 5:25 PM

Scott Hanselman is working on a new project for parents out there called Baby Smash:

As babies smash on the keyboard, colored shapes, letters and numbers appear on the screen. Baby Smash will lock out the Windows Key, as well as Ctrl-Esc and Alt-Tab so your baby can't get out of the application. Pressing ALT-F4 will exit the application and Shift-Ctrl-Alt-O brings up the options dialog.

Its written with WPF, and looks pretty cool, as well as pretty useful.  I don't have kids, but a coworker of mine just recently had his second child, and his first is 2 and pretty rambunctious from what I understand.  So I sent him a link to the program.  Here was his response:

Does he have any programs that will prevent my kid from drawing on the walls? :)

Hey... computers can't do everything you know.

About Me

Nick Schweitzer Nick Schweitzer
Wauwatosa, WI

Contact Me
I'm a Software Consultant in the Milwaukee area. Among various geeky pursuits, I'm also an amateur triathlete, and enjoy rock climbing. I also like to think I'm a political pundit. ... Full Bio

Community Involvement



Flickr Photos

This is a Flickr badge showing public photos and videos from Nick_Schweitzer. Make your own badge here.

Standard Disclaimers

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

© Copyright 2017 Nick Schweitzer