Author Archives: bill

Writing Reusable Code

Recently for our YumDrop.com site, I was asked to put together a new page that we could use to sell products that we still had in stock which were discontinued. We wanted to be able to display only those items on the page to promote their sale. The obvious goal was to get rid of the inventory.

So as usual, I fire up Visual Studio 2005 (our web application is written in C#) and get to work. As soon as I get started putting the page together I had the following thought:

“Man, I’m glad I wrote that thumb item control to display any product item.”

What I was thinking of is a .NET control I built to display any given product on our site. This consists of the product thumb image, a link, its name, and price. All you have to do is tell the control what size image you want to display. The cool thing is this can be used ANYWHERE on our site. It can accept data from any source (database call, xml, etc.) and display it. Having such a gem saves me a lot of development time basically piecing the same code that appears on 5-6 different sections of our site.

I know what your saying now though. Everyone knows about writing reusable code. What I’m saying is that I don’t think enough developers actually do it. I think many times, as developers up against deadlines, are just trying to get our projects completed (which is an admirable goal, one I strive for every day), thus we sometimes write non-reusable code. Don’t forget to ask yourself the following each time you write some new snippet of code:

“Am I going to need this functionality somewhere else in my application or even another application tomorrow, the next day, or 5 months from now?”

I think you’d be surprised that a lot of times, the answer is yes. If you write your code so you can reuse it later, you’ll thank yourself, like I did, months later when you find yourself needing that functionality again.

Converting Ecometry EDI Files

A while back, we started having to deal with EDI files in Ecometry for Fright Catalog. We started charging for our catalog and wanted a third party to ship them for us. Unfortunately, the third party couldn’t handle EDI files, they needed a CSV file and annoyingly, Ecometry’s software couldn’t do it for us. Not wanting to create a CSV file for this by hand, I created a C# console application (requires the Microsoft .NET 2.0 Framework) to parse these EDI files for me into a CSV file. It will output the following:

  • Customer Number
  • Company Name
  • Title
  • First Name
  • Middle Initial
  • Last Name
  • Address 1, Address 2, Address 3
  • City
  • State
  • Postal Code
  • Country

This was great, until it came time to processes these orders. Now I needed to generate a ship confirm batch file as specified in the Ecometry 7.x documentation. Not wanting to do this by hand either (especially since I’d need to do this on a regular basis) and being a fan of the DRY (Dont’ Repeat Yourself) principal, I extended my little utility to create Ship Confirm Batch files for Format 256. Other formats might be supported later, contact me if you need them, maybe I can help.

So now I have a cool application that will parse these EDI files for me in the formats I need. If you’re interested in getting your hands on it for your own use, I have a download available with the executable. Let me know if you have any issues with it or want to see some new features.

Why Can’t Programmers Read?

I just read a post linked from Reddit about why programmers can’t read. It was in response to the FizzBuzz problem that is used to measure a programmer’s basic competency during an interview (I was able to complete my solution in C in about 3 minutes, including ssh’ing into my linux box and opening vi). The issue is that so many programmers get the solution wrong is because they can’t read, i.e. they don’t read the problem correctly, thus get it wrong. So, what exactly is the problem here?

The author said, “Perhaps it’s time to bring back more word problems in our curriculum”. This is good, but I think we need to go beyond that statement. A lot of schools at all levels (grade school through college) don’t teach reading and writing properly or put enough emphasis on it (especially at a technical school) . I went to WPI and as part of our education we were required to complete three major projects, all three of which included writing a paper.

I was told several times by my professors that I wrote well compared to my peers, which I found odd because my mother always complained about how I didn’t write all that well (she blamed it on my grade school and high school education…i.e. not learning to diagram sentences until I took French in 7th grade). But we weren’t required to take a literature class at all in the 4 years we were there to make sure we wrote these papers properly. Not a single one.

I’m not sure about other technical driven schools, but I really think we need to spend more time on language and writing than we do. Its not enough to learn the math and science skills to be a successful engineer, but you need to know how to communicate well, both on paper and orally. Let’s start teaching how to read and write properly (like our parents and our grandparents were taught) starting in grade school and continue to do it until you graduate college. Make sure our students continue to take literature courses in college to support the technical papers (and later on technical specifications) that they have to write.

Movie Review: The Departed

Like Borat, I was probably the last to see The Departed and I wish I could have seen it when it was in the theater. But, I had some gift certificates to Best Buy and went to pick up a copy of the DVD this past Sunday. Even with all of the hype that was out there (and the Oscar wins), I’d have to say it lived up to its billing. Jack Nicholson, Matt Damon, and Leo were all incredible. And the twists and turns kept me on the edge of my seat, especially at the end. If you haven’t seen it, go get it. If you’re a fan of The Boondock Saints, which I thought was the best Boston based movie ever, you’ll be a fan of this one. The Departed definitely gives it a run for its money!. Its worth the $24.95 Best Buy rapes you for it. You’ll watch it more than once, I guarantee it!

Mega Millions – $355 million

$355 million dollars. Wow, that’s a lot of cash. If you won the jackpot, I think you’d get somewhere around $140 million (before you pay Uncle Sam). Not bad. The odds of you winning the whole thing are 1:175,711,536, that is if nobody else wins the jackpot. You have a better chance of getting struck by lightning.

I normally don’t play the lottery, but $355 million is a lot of cake, so I’ll take my chances. For my 10 “Quick Picks”, I have a 1:4 chance of winning $1 and 1:17,571,153.6 of winning the whole shebang. Wish me luck!

The Beatles Love

Shannan, my fiancee, and I recently took a vacation to Las Vegas. While we were there, we were fortunate enough to catch the Cirque Du Soleil show The Beatles Love. Even though tickets were about $110 each after fees, etc. it was well worth it. To hear all of your favorite Beatles music put to a show with high flying acrobatics was just amazing. If you ever get out to Vegas, I highly recommend seeing the show. Songs used:

  • Get Back
  • I Am The Walrus
  • Strawberry Fields
  • Lucy In The Sky With Diamonds
  • Octopus’s Garden
  • Back In The U.S.S.R.
  • Hey Jude
  • All You Need Is Love

and many many more. There are a total of 26 tracks on the album.

Date Set!

So as many of my friends already know, I got engaged February 16th, 2007. Well, as of today, we have a wedding date set. Saturday, June 21st, 2008 will be the big day. Should be quite the party!

Bookmarking Icons

In redesigning my blog, I was going to include bookmark icons for digg, reddit, del.icio.us, etc. under each blog post (I actually had them in the code at one point). Then I read an article over at 37signals that changed my mind.

What Matt has to say about these icons caused the proverbial “light bulb” to go off in my head. I’ve got a new blog and I’d love to get noticed. Write cranked content about stuff that I’m passionate about and knowledgeable on. If the content is good, like Matt says, then people will come. People will notice. My stuff will end up on digg, reddit, and all those other “news” sites out there. So why push the issue?

New Blog Design

So I finally took it upon myself to create my own WordPress template. I’m fairly inexperienced with CSS, but with a little help and having looked at what other people have done, I don’t think I did that bad with it. Hope everyone enjoys it!

Generating Leads and Closing Deals

I’ve recently been trying to get some additional income by doing additional web development projects on the side. The first thing I’ve noticed is it’s tough to generate leads, especially when it’s not your full time job. I have learned that you basically just need to keep your eyes and ears open and to also stick to stuff you know and try to leverage what you already do well to your advantage. Being in the right place at the right time is usually the name of the game, especially when you’re getting started.

Secondly, I’ve learned its hard to close deals once you’ve generated a lead. A lot of people (mostly the non-web savy ones it seems) don’t appear to know what it takes to build a quality web site. Nor do they value what your talents are. In the end though, I think it maybe just has more to do with people wanting something for the least amount of money than anything else. The key will be to be fair and upfront with people and hopefully work out the details and build great applications!

One thing I’ve tried to not do is just drive leads away. I try hard to work with them on the feature set and the price. So far, nothing bad has happened. Things just don’t move quickly.