Thursday, May 22, 2008

The Post Office Is Evil

In pretty much any other "business" you go to the employees will have been taught the aged old lesson that "the customer is always right" (even when they are wrong) and the word "service" in "Customer Service" actually means something.

Somehow the US Postal Service gets by with little regard to these age old lessons.

When it comes to sending a package you have several options in the USA:
  • UPS
  • FedEx
  • DHL
  • USPS (US Postal Service)
Of course some are a little more expensive than others but the level of Customer Service and Package Tracking available is usually worth the added expense.

Somehow the US Postal Service "forgets" that there are options for sending packages and relies on the fact that they are the "only" way to send regular "mail".

With that in mind though, lets take a look at how easy it is to replace the US Postal Service:
  • Pretty much all "bills" can be sent electronically
  • Email is much faster
  • UPS, FedEx and DHL all supply better service and better Package Tracking
  • In store Kiosks can easily replace everything else (photo printing, etc)
Think about it, if you went with Electronic Bills and Email as your sole way of communication other than telephone, you could cut down on all of that junk mail that piles up in your mailbox only to be tossed into the garbage and end up in a landfill. Yes, Email has junk mail (spam) too but Junk Mail Filters can handle that.

So then, why is the US Postal Service relevant?

The thing that keeps the US Postal Service going is the fact that it is a government based institution. Our hard earned money is being used via our Tax Dollars to keep this business operating yet every few months they raise their rates and lower their attitude toward the "service" aspect of their name.

Why so bitter about the Post Office today you might ask. Well, I have an important package that was supposed to be delivered yesterday, but since the US Postal Service's "Tracking" system is so horribly bad, I had no idea it was being delivered yesterday. My wife was out walking the dog at the time so she missed the mailman. So, I get home, grab the little pink slip, head over to the Post Office only to be told that they send all packages to a warehouse and thus I can't get it unless I make other arrangements for them to "hold" my package at their location.

You have got to be kidding me.

I asked the guy at the desk if they could just hold it for me to pick up on my way home tomorrow and he tells me that isn't possible and that they would have to make another attempt before I could make such arrangements to pick it up.

You know, we always here about how mailmen go "postal"... wouldn't it be the other way around with "customers" going "postal" :-)

Monday, May 19, 2008

State Troopers Hurting Home Sales?

Okay, this is a weird one. I was out driving this weekend and stopped at a light when I noticed a State Trooper pulled over with his lights flashing. I thought he had pulled somebody over but that wasn't it. The next thing I notice, he is pulling up and stomping down on signs that were posted in the median.

That was weird.

At first I thought maybe they were political signs... maybe a Republican tearing down Democrat signs or a "Billary" fan taking down some Obama signs. Needless to say, I had to drive slow as I passed to see what it was.

Okay, this was really weird. This State Trooper was taking down "Home for Sale" signs. Oddly enough though, he was systematic about it. He didn't take down all of the signs, just the ones he "wanted" to. He left up all of the signs for Ryland Homes and took down everything else.

My wife was with me so I pointed it out and oddly enough she told me that she had seen a State Trooper doing the same thing a week ago.

That was really odd.

I don't know, maybe I am missing something. Do you have to get a permit to post a "For Sale" sign when selling a house? The signs the State Trooper tore down were for other Housing Sub-Divisions (builders) just like Ryland and not for individuals trying to sell their home.

Again, maybe I'm missing something but you should have seen this guy, he stomped down those signs like he was pissed... as if maybe someone in his family worked for Ryland homes.

Very odd... has anyone else seen this or can add anything to this?

Wednesday, May 14, 2008

Misuse of Regions in Code

I am sure a lot of you that program in .NET using Visual Studio have become familiar with the concept of "regions" in your code. A "region" is a way to separate a block of code so that it can be collapsed and expanded as necessary. This can be good when you want to "hide" code that isn't updated often as to not confuse, or annoy any developers that may be working their way through your code.

I'm sure many of you are already familiar with "regions" but here is the obligatory example anyway:


#region
Code I want to Group Together
// Some truly amazing code here
#endregion

Sounds good right? Well, there is a seedy underbelly to this "freedom" in coding. It is nice to be able to "partition" your code out to make it easy to "collapse" code away that you are not interested in to make it easier to navigate your code but when you think about it, if you have so much code in one code file that warrants adding "regions" to "hide" certain code as to get it out of the way doesn't that set off a bell in you that maybe your code file is way too large? Could it be that "regions" are now providing you with an excuse to fall into the old "spaghetti code" mentality?

For me, it is quite annoying when I get into a code file only to find that there it consists of several "regions". Sure it looks neat and tidy but when you open such a file what is your first instinct? You may know exactly what "region" to open and thus you dive directly into that one and continue with your work. However, you may not be too familiar with this code file so you may find yourself hitting the old +"Ctrl+M,L" shortcut to expand everything. But as soon as you do that you find that this innocent looking code file is now thousands and thousands of lines of code including multiple nested "regions" to muddy it up all the more.

So what can you do to make such tasks easier? What can you do to separate related code out to make it easy to find and easy to work with? Two words for your "Partial Classes". With .NET 2.0 and above you have the ability to separate the "guts" of a code file into multiple code files simply by adding the word "partial" to the class definition.

Here is an example:


public partial class
Customer : IPerson

It is important to note that "Partial Class" file can have any File Name but most people use the format: MainFileName.PartialClassName.cs just to make sure the files are grouped together and make sense to other developers.

I know, I know, many of you are saying "big deal, this has been around a long time now". Yes, this capability has been around since 2005 but most people out there only ever use "Partial Classes" when dealing with ASPX and ASCX Files and never consider using this great idea with their regular Class Files.

Usually when you think about an Object you may find yourself breaking out multiple Class Files that all relate to a specific task surrounding your object. This makes perfect sense and so finding several related Class Files that break out functionality is "normal", however, there are times where a single Class File grows quite large and you don't wish to separate its "guts" into different sub-objects but you also want it to be easier to maintain and easier to share in a Team Environment. This is where "Partial Classes" come into play.

If you separate related code in a Class using "regions", that will make it easy to see what code is related to each other (in a sense) but it still goes against Team Coding practices. If Developer A wants to edit Functionality X of this Object, he has to check out the same file that Developer B already is editing. Modern "merge" features are better now than they used to be but this can be a pain. However, if instead you separate such related functionality into "Partial Classes", Developer A can check out just the "Partial Class" he/she needs and thus not disturb the work of Developer B. Oh sure there will be instances where multiple developers will need multiple "Partial Class" files checked out but having these all separated out will ultimately prove to make development and maintenance easier.

Don't get me wrong, I am not suggesting including all functionality into one big Object via "Partial Classes". If you have an Object, lets call it "Customer" and this Object has "Accounts", you would still want to create an "Account" or "CustomerAccount" Object. What I am suggesting is instead of using multiple nested "regions" to partition your code, why not use separate "partial" class files to not only make it easier to understand but easier to maintain and easier to share development work in a Team Environment.

To give an example of how "regions" can be bad, just yesterday I found myself editing a monolithic code file that was not only filled with multiple nested "regions" but it also had an extreme number of unused Compiler Directive #if/else conditions. In this case I simply deleted all the unused Compiler Directive conditions which meant deleting 2,500+ lines of code. This still left an excessive number of nested "regions". Maybe someday when I am feeling brave enough and have the time I will pull those out and create "Partial Classes" for each distinct area of code.

Removing the "dead" code made this Class File easier to navigate, just think how much easier it would be to maintain with all the "regions" pulled out into their own "Partial Class" files.

Tuesday, May 13, 2008

Holy Cow Batman!!!

Okay now, this is just plain ridiculous.


Notice that this is almost 11 gallons of gas and of course I used the Regular old Unleaded ($3.65 / gallon) and it was $40!!!

I know, I know, people outside of the United States have been used to outrageous Gas Prices for a long time and so I shouldn't complain... but of course I will :-)

To make matters worse, we are heading into the "Tourist Season" here in Florida and for some reason every Gas Station in Florida, especially those in Central Florida love to tack on a "screw you tourists, go home tax" to their prices which always makes gas here more expensive.

Honestly, even if there was no "Holy War" going on, Gas would go up by $0.20 every summer in Florida just to gouge the Tourists and piss off the natives.

I feel sorry for the poor people driving those mega huge SUVs and Trucks.... no, on second thought I don't :-)