Presentations on SlideShare.com

May 24, 2009 by gregsohl

I’ve recently uploaded some of my presentations on SlideShare.com. It has a very nice way of handling and displaying slide decks. You can find the 4 I uploaded on my space there http://www.slideshare.net/gregsohl.

The presentations are:

  • Analyzing .NET Memory Usage
  • Application Security Part I
  • .NET Recommended Resources
  • Object Oriented Programming in .NET

The recommended resources presentation is a bit outdated now. I’m hoping to update it soon, and am also working on a “tools I use” page for my blog site.

Gateway support snubs me, then comes through

May 14, 2009 by gregsohl

I had a simple question. I couldn’t find in my owners manual or on the Gateway web site what the maximum memory (or any memory specs for that matter) are for my laptop (a Gateway MX6961, which I’m very happy with).  So I clicked on the link that allowed me to email support and filled in the form with all my details and my question. What followed was interesting, it went like this:

Me

Subject:  What is the max memory supported in my MX6961 laptop?

Can you tell me what the max memory supported by my laptop is?  The hardware manual doesn’t seem to list it. Your specs page lists:

2048 MB 533 MHz DDR2 Dual Channel memory (2 × 1024 MB)
Total slots: 2 DDR2 slots | Available slots: 0 DDR2 slots

Is this what it comes with or what the max is? I’m interested in upgrading it to 4GB if it supports it.

Gateway

Thank you for contacting Gateway.I would be happy to assist you with the

However, with the serial number RL1014081R7050104. We are unable to pull up the system details.  Please send the correct serial number. The serial number is a 22 or 13 character alphanumeric or 11 digit SNID number which you could find next to or under a bar code in several locations.

On the bottom of a notebook

On the back or side of a desktop

Under the front sliding door on a desktop

On the original computer box

Me

Thanks for the quick reply. About the serial number – I’m not sure what else to give you. That is what it says on the sticker next to the S/N marking on the bottom of the laptop (model MX6961 – refurbished). It is under a barcode.

Can you tell me based on the model number?

Gateway

Thank you for contacting Gateway.I would be happy to assist you with the memory issue

Please note that as per your information your system is a refurbished system. Please call 1-866-xxx-xxxx for support.

Me

Thank you.

You know, whether or not you are supposed to provide me with support on my refurbished system, I’ll bet that in less time than you spent on the two responses to me you could have answered my simple question and had a MUCH HAPPIER Gateway customer.

Gateway

Thank you for contacting Gateway. I’ll be happy to assist you with the memory upgrade issue.
The maximum memory up to which you can expand is 4 GB. Total slots available: 2 DDR2 slots.

How important is customer support today – or in any time period for that matter? The competition in our comoditized industry is such that you must differentiate yourself by your service. Glad Gateway came through end the end.

In retrospect, I should have just gone to Crucial’s great site and searched out the memory specs there.

Self Documenting Code?

May 13, 2009 by gregsohl

I often hear arguments against code commenting. The opponents frequently say that code should be self documenting. That variable names, method names, etc. should be such that anyone reading the code can tell what is going on. To a degree, they are right of course – about the emphasis on good naming – not about code not needing to be commented because it is self documenting. I’ve written about this before in my short blogging career.

I did a code review today for a developer who was adding some functionality to a preexisting method. The method already had a good “self documenting” name that described its simple, single purpose. However the new code added “broke” that name by having the method do something else. He was aware of this, but the cost of refactoring required to break it out further, in this case, outweighed the benefit of doing so – it was that simple. So instead I had to call him on the now “broken” method name.

We pondered for a few moments, trying to cleverly come up with an appropriately descriptive name. We failed – at the cleverly part. Instead the new name that is fully self-documenting is:

RemoveFootnoteAreasAndOnlyUseFirstColumnHeaders

Maybe they were right? Of course, it still doesn’t tell you “WHY” the footnotes are being removed and “WHY” we would only use the first column headers.

JetBrains support for ReSharper helps me out

April 18, 2009 by gregsohl

This last week we upgraded our team to ReSharper 4.5. We’d been on 3.1 since about the time it came out, which was last 2007 or so. So far we’re enjoying the enhancements and speed improvements. I’ve had several positive comments from our developers.

I wanted to point out to our developers all the cool new features since 3.1, since we skipped the 4.0 and 4.1 releases. I couldn’t find the old release notes on their site so I submitted a support request asking for them. They wrote back and the support rep said he didn’t have them handy but would work on it. The next day another rep replied to me and had updated the web site republishing the former release notes. So now you can find all the release notes from 2.0 on at http://www.jetbrains.com/resharper/features/newfeatures.html. Thanks JetBrains – ReSharper rocks!.

Azure at CRineta

February 5, 2009 by gregsohl

I spoke at CRineta Monday night, using materials provided by Jeff Brand one of our Microsoft evangalists. This was basically a repeat of a session from the PDC aptly presented by Steve Marx. The talk covered creating basic Azure services and using the built-in storage mechanisms – blobs, tables and queues.

Azure is an interesting hosting platform. I dare say there’s not been anything like it available before, providing a familiar, consistent and integrated programming environment with an advanced hosting environment with built in scalability and failover. I definitely think it is worth watching as it matures. I’m anxious to see the pricing model when it is available, which is a sentiment echoed by several folks at the talk.

Now with that done, on to spring Iowa Code Camp!

Why you should comment the “Why”

February 4, 2009 by gregsohl

We’d been having a discussion about code commenting on our CRineta.org discussion group. I’d been asserting that we need to comment “WHY” a piece of code is in place more so that “WHAT” it does. Chris requested for me to show what “WHYcomments would look like on a specific piece of code. I thought about it for awhile but soon was distracted by real life. I continued to think about it and realized why I was unable to easily come up with a “WHY” comment for it. The reason is exactly the reason I’ve been asserting the need to write theWHYcomments along with the code … because by the time I read this piece of code (the one Chris asked me to demonstrate on) theWHY” information wasn’t available to me. I could have made something up, but in truth, the person who wrote the block of code is the one who knew why it was written, its purpose for being.

While doing a code review today, I found a good example. Here’s the original code as I reviewed it – with the comments from a guy who generally does a good job of commenting his code.

// Retrieve the statement info so we have it.
StatementInfoCache.Instance.GetStatementInfo(statementID);

// Start the delete statement job on the server.
Guid jobID = Guid.NewGuid();

StatementUsageResponse response =
StatementListModelHelper.DeleteStatement(
this, statementID, jobID);

if (response.RequestResult == StatementUsageResponseResult.Successful)
JobManager.JobManager.Instance.AddJob(jobID);

return response;

Focus on the first line. I asked about it during the code review. I asked WHY do you have to get the statement info? Knowing what I did at the time, I already knew what “so we have it” meant. But why did we need it, and would we remember why we had to have it one month from now? How about 6 months from now?

So the developer revised the comment as follows:

Version 2:

// Retrieve the statement info because we can’t after the delete.

Ah – true. That is a reason we have to get it now, because we are doing a DeleteStatement operation and the Statement Info won’t be available after the delete. But still I asked – WHY do you need to have the statement info? The line isn’t just there for our health? So he modified the comment again with a bit more prompting.

Version 3:

// Retrieve the statement info because we can’t after the delete.
// This is so the notification box and job monitor can show the statement description.

Wonderful. Now I know WHY we are getting the Statement Info AND I know WHY we are getting it now.

This is the kind of information that one would have to do significant searching for at a later date when trying to understand the code, which was originally:

// Retrieve the statement info so we have it.
StatementInfoCache.Instance.GetStatementInfo(statementID);

I’ve read others opinions on code commenting such as Jeffery Palermo’s.  I think that many peoples perspective on commenting code, especially those that say that code should be written to be self documenting, aren’t necessarily wrong, they are just focused on the wrong nature of how comments should be applied.

So I say, “Tell me WHY“.

XAML Compilation?

December 16, 2008 by gregsohl

The most interesting thing I learned in chapter 1 and 2 of Windows Presentation Foundation Unleashed yesterday was about how XAML is handled during compilation. Don’t tell your designers, but XAML is as much a programming language as it is simple markup. During compilation of a WPF application XAML is compiled and a BAML file is output. The closest corollary to BAML in the .NET world I see is IL, but clearly it is NOT IL.  BAML is a tokenized version of the original XAML file that is optimized for loading during runtime. So XAML is, at least partially, interpreted at runtime. The BAML file is eventually brought in as a resource file to your DLL or EXE, as can be seen here in Reflector for a simple WPF app’s EXE:

WPF App BAML Resource

WPF App BAML Resource

Also output is a corresponding VB or C# file with a partial class that contains the framework code to use the XAML file and member variables (internal visibility) for each named element.

So if someone asks you – “Is XAML compiled or interpreted?”, you can just respond with a simple, “Yes”.

Additional References:

http://msdn.microsoft.com/en-us/library/aa970678.aspx
http://www.microsoft.com/emea/msdn/thepanel/en/articles/introduction_wpf.aspx

Learning WPF, XAML and Silverlight

December 15, 2008 by gregsohl

I’ve decided to embark on the process of learning Microsoft’s new presentation technologies. I’ve done lots of web apps and windows apps in the past and so have pretty deep UI programming skills. Walking into this though, it has the appearance of being a bit different than other technologies I’ve used. I’m not quite sure why I have that impression. Perhaps its just the scale of the feature set, which is vast.

I’ve decided to learn from a book for once. I’ve rarely, if ever, done this before, choosing instead to learn by example, exploration and persistence. I’ve chosen the book “Windows Presentation Foundation Unleashed” (by Adam Nathan and Daniel Lehenbauer), published by Sams. This was at the recommendation of a CRineta friend Randy Scott, who is with Microsoft and has spent the last year writing WPF code. I’m reading it through Safari Books Online, which I love, which I subscribe to via DevX. Over the last couple of years of subscribing to Safari, I’ve mostly used it for reference. Reading a whole book (okay I won’t read the WHOLE book) online will be a new experience.Today I got through the first 2 chapters. This is basically an intro to XAML and its relationship to WPF. Pretty cool and nothing unexpected.

I was fortunate that our last CRineta presentation was “WPF Demystified” by Mike Benkovich. You can find a recorded version of it here. The intro gave me a good heads up on what to expect as I dove in.

I’ll post on my progress. Hopefully someone will gain something from it.