Archive for January, 2008

Shotgun Debugging

Sunday, January 27th, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

One of the most painful things I experience with the students I tutor is the practice of Shotgun Debugging. The practice will generally give the student horrible, unreadable code. After today’s tutoring, I determined it was time to write about some common debugging practices. So, here are the things I tell my students every week - and they quickly forget.

Only change one thing at a time.

This one is hard for beginning programmers. They get a logic error (or sometimes even a compile error) and then change 5-6 things in their code before they try again. If the changes work, they have no idea why, and will change 5-6 things next time they get a similar error. Which leads me to the next point:

Learn what the common errors mean.

….and how to fix them. When you get the error in Java for “cannot find symbol”, what does that really mean? Look at the text associated with it! It will tell you if it doesn’t understand the class you are looking for, or the variable, or even the method. Got a “null pointer”? That really does mean that something you are referencing is null! The JVM does not lie! Sure, some errors are a little more complicated, for those:

Actually read the error.

The biggest problem I see with students is they simply do not understand the code that they are working with. Reading the errors and understanding what is actually happening when you manipulate a line or two of code is the first step in becoming a better programmer. Every good programmer has spent a significant amount of their time learning how to debug, not just how to code. Lastly, I find myself telling my students:

Make sure you catch every instance of the error.

Let’s face it. We try to teach reusable, generic code, but it just doesn’t happen. I have learned to accept that some students are just going to copy and paste branches of code, over, and over, and over again. So, if you must do this, when you realize there is a logic error in the branch you copied, it will exist in every branch… no matter how much you think you “just fixed it”.

Sometimes tutoring can be very frustrating, but I really do enjoy the moment when a student finally has it click. I suppose there is nothing I can do sometimes, because some students just really hate code, but I hope that they can at least take a little bit back from what I help them with.

Social Bandwagon

Saturday, January 26th, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

It seems that everyone is getting on the social networking and social computing bandwagon. Not sure this will work out for them though, you have to read it within range of a wireless hot spot.

The toughest part of this comic was coming up with the actual fortune. I even had a demotivator one, but I didn’t think I wanted to be that negative. Both fortunes were inspired by Bowling for Soup songs.

Chinese Fortune

Thursday, January 24th, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

I ordered Chinese food today for when I was working in the labs. I finished it off then broke open the fortune cookie.

Be direct, usually one can accomplish more that way.

Now, lately I have been getting some pretty lame fortunes, but for some reason this one didn’t seem too bad. Sure, you can usually get better advice from a good friend then from a cookie (although, that can be iffy!), but sometimes hearing a ‘wise’ saying kinda gets your mind ticking.

Beating around the bush never helped anything. Of course, sometimes it is tactful to be subtle, but usually being direct is an appreciated change to todays really passive, polite culture. I personally can’t think of time where it is truly better to be indirect with someone… short term yes, but nothing really in the long term. Anyone have any ideas?

….and I just got an idea for a comic.. hmmm. Stay tuned!

Design Patterns

Monday, January 21st, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

I think I might file this one under “Bad jokes I should have never drawn”, but I still get a chuckle out of it.

I think this is a sign that I need to stop coding for a few days…

The DreamHost Fubar, and Why I am Not Mad.

Wednesday, January 16th, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

DreamHost fucked up. Big time.

However, I am not nearly as mad as (seemingly) every other customer. Sure, I got the several hundred dollar charge, and yes, I was confused.

What happend:

DreamHost had an automated system that billed customers. A detailed account can be found on the DreamHost blog, but essentially what happened was they had an issue with their billing system. It was not charging customers on recently upgraded servers. While investigating they found the problem to be a 64-bit incompatibility issue and corrected it. They then went back to start billing the accounts. Starting from now backwards. For example, 1-16-2008, 1-15-2008, … 12-31-2008… and there was the problem. The biller, although robust, had the feature/flaw of billing up to future dates. All their customers were then billed for the entire year.

Yeah. Big fuck up.

Why am I not mad?

Well, in my experience as a developer, I have realized that “Shit Happens”. I still remember the feeling of when I accidentally sent out a non-approved blatantly “test” version of an e-mail to all of a Xerox mailing list. Wow. I thought for sure I would be fired. Was I? No. Now, was that a $7.5 million dollar screw up? No. Definitely not.

DreamHost has guaranteed to refund the money (I still can’t see that I have even been charged yet, maybe in a few days), and also requested that anyone who has incurred additional fees contact them, implying they will also refund those. For me, everything is fine. I have a high enough limit on my credit card, and plenty of money in reserve that this does not affect me nearly as much as some.

Others however, are furious. They have sworn to leave DreamHost, and are furious at the ‘mildly comical’ blog entry that DreamHost posted explaining what happened.

For anyone that has been a member of DreamHost for any period of time, you learn quickly that they are light hearted and silly in ALL of their customer correspondence. This is one of the reasons why I like them so much. I know that there is actually human beings that are working there, and chances are I wouldn’t mind having a beer or two with them (Although, I suspect after the other day they are likely going to be ingesting lots of beers). Why was this serious topic presented with a light hearted humor injected? Because that is how they communicate with their customers. It’s that simple.

They strive to be transparent when something goes wrong. I much prefer to read about what happened, and what they have done to fix it over a generic “There has been a billing error, it will be corrected shortly and you will be refunded” that I would expect from other hosts (and companies) that we usually encounter in today’s hush hush business world. Other companies would not tell us what went wrong, and surely would not tell us why it went wrong. They would merely state that a problem occurred and it will be corrected.

I hate companies like that.

So I ask these questions:

Did DreamHost screw up? Yes.
Did DreamHost fess up to the screw up? Yes
Did DreamHost explain what happened to cause the problem? Yes.
Is DreamHost correcting their mistake? Yes.
Is DreamHost going to do their best to make everything right? I believe so.
Is DreamHost going to lose a lot of money in lost customers and bank fees? Oh dear god, Yes.

I feel bad for the situation that DreamHost is in right now. You can not mess with someone’s money and come out unscathed. I can’t imagine the feeling that Josh (the person who hit the button) has. I am not mad at DreamHost for this. I know screw ups like this happen all the time - they just hit the jackpot of when and what to screw up. I am not leaving DreamHost anytime soon… although I do recommend they start putting more sanity checks on their internal software.

Lots more sanity checks.

Family Tech Support

Sunday, January 13th, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

I am sure others out there know the exact feeling I had when drawing this comic. I got a call the other day regarding a family member’s computer - and I knew I just had to draw how I looked and felt.

The call always comes at the worst moment too.

Finding Time to Write is Hard

Wednesday, January 9th, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

Classes here started back up this week, and I have become frustrated at how little time I have to do my side projects. It’s not that I really should be working on these side projects, but it gives me a much needed release from the constant thinking about current classwork that my brain really needs.

I find that in my standard day at school (which is about 10-14 hours a day), I am tutoring about 30-50% of the time - even if I don’t have tutoring hours. The rest of the time is me fighting to try to stay ahead in a course. This is frustrating. Even after getting ‘ahead’, I fall behind in another. This constant back and forth is definitely not good for my stress levels!

Perhaps the bigger problem can be explained by this crappy graph I drew.

Blogging vs Actual Work

As clearly shown, when I get more and more work to do, I have a larger and larger urge to blog. However, since I have less and less time to spend on side projects, I get less blogging done. Shame really. I have a few articles that I really want to write.. particularly about Hyperconnection (that article is about 1/3 done actually) and the differences between Business People and Technology People.

Luckily, this quarter I have a programming class that is letting me get my programming fix out of the way (last quarter was rough without writing any code), so I really just look forward to having time to devote to writing and drawing. We shall see if I am able to find the time to write and draw more though. Even now I am writing this entry while I TA for a class, and have been pulled away several times to help students. I just hope I have some time to sit down and write!

Realization: I AM a Code Monkey

Friday, January 4th, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

Something interesting happened tonight, between the hours of 3:00am and 4:00am (can you tell I haven’t been getting sleep?). The interesting thing that happened is that I trying to find plug-ins for WordPress that would allow easy sharing of articles that I write with facebook, digg, slashdot, etc…

I found one that seemed promising called obsocialbookmarker. He had a new release out, so I figured I would give it a whirl and see if I liked it… because I really didn’t feel like writing something custom that I knew someone out there had already done.

It didn’t work!

I was frustrated to say the least, but I was able to at least get some of the error messages to display to me. The errors were not WordPress errors, but actually PHP errors from the plug-in code. I thought “Damnit this guy must suck”. Then I realized what the error actually meant… The plug-in tries to figure out if it is out of date. Fair enough. The problem is that my server does not take to kindly to PHP trying to call fopen() on a remote server via URL (a security setting I cannot change, since allow_url_fopen is disabled… although this does give me more motivation to try to get around that).

So what was I to do? I suppose anyone that wasn’t a programmer wouldn’t have even got this far and would have moved on to another plug-in, but I saw some of the other ones and I thought they sucked. So, I did was most programmers like to do, and hack. Sure, the hack was only removal of the version checker, but it was still something kind of neat.

  1. Something didn’t work.
  2. I wanted it to.
  3. I made it work.
  4. I posted a comment on his blog to let him know.

Sure. This isn’t anything huge, and I have been a programmer long enough to know that this happens all the time! I think tonight something was just different about it. When I was learning how to code, I used to talk about how being a programmer was akin to being god-like. It kind of motivated me to learn. You can create things, destroy things, do good, do evil. This kinda just touched me again to think about that concept… what kind of power a programmer has.. Sure, for me just now, it is as simple as making something work that will put little icons on every post I make. The bigger thought perhaps, is what makes the idea interesting.

Busy Train

Thursday, January 3rd, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

I really wish I could draw. Going for a slightly different style to push my drawing abilities.

While traveling through Boston, I just had this image burned in my head. Since I got home and had access to my Wacom, I just had to draw it.

Boston: The Experience

Wednesday, January 2nd, 2008

del.icio.us Reddit Slashdot Digg Facebook StumbleUpon

After spending a few days in Boston - and more importantly, spending a few minutes at home resting after the long ride back - it’s time to write about the trip! Overall it was an excellent experience… it was nice to see a few of my friends that are living out in Boston, and it was also nice to bring a few of my friends out there with me to experience First Night!

(more…)