Why I Choose To Be Lazy

Posted by Chris Shorrock Tue, 22 Aug 2006 04:35:00 GMT

A recent article over at Software By Rob has illustrated a very interesting point regarding common attributes that he finds if skilled programmers. It's a good read for anybody in the industry, but I thought I'd throw my own 2 cents in the direction of the topic, so without further ado, here's my brief list of Things Required To Not Suck At Programming.

Laziness
While it sounds crazy, all great programmers must be lazy to some degree. A lazy programmer will go to great lengths in order to abstract out ideas and concepts into small manageable and (key word here) removable pieces which can then be used in other places. It's their desire to only ever do something once, this will generally cause their architecture to be such that repetition will not be seen anywhere . Everyone has ran into a small piece of logic has 300 if statements in a row each testing for a different condition, and you can bet it was a very eager programmer who did this - as a lazy person would take the time and figure out how they could avoid typing out all of these 300 lines.

Anal Retentiveness
Have you ever jumped into a project half way through development and thrown up on your keyboard (repeatedly) due to hap-hazard nature the authors of said project had taken towards code cleanliness. A mixture of tabs and spaces, different variable naming constructs in every other class, so you go through and take a considerable amount of time reformatting everything for consistencies sake? After which the code runs no different than it did before, but at least this way you can look at it without having to reach for the pepto-bismol. Similarly in real life, these programmers, also have minor OCD tendencies where their desk must have a sense of symmetry before they can work. It may seems (because it probably is) that these people are a little crazy but their desire need to have everything just so, in every circumstance, is a testament to their attention to detail and their unrelenting approach they take to software quality.

Artistic
Anyone who said that programming isn't art is either not a programmer, or not a very good programmer. Great programmers relish in beautiful designs that solve multifaceted problems using very simple abstractions. They have an innate ability to make things "as simple as possible, but no simpler", that is, they can do something in a small amount of time that will address all of their requirements. They are able to take a problem and construct a solution out of thin air that takes a tenth of the time and will often operate several magnitudes faster than a solution crafted by a less skilled programmer. Art, at it's core, is taking things and putting those things together to make something beautiful; those programmers who approach code from a perspective of creating elegance, opposed to gettin'er done are often the ones you want on your team.

From a personality perspective we've painted a picture of some lazy hippy living alone in a loft with his 300 paintings (well.. 1 painting and 299 photocopies) organized on the floor with exactly 3cm's separating all of them. Find this person, teach him what an if statement is, and you have your next team lead (providing you can get rid of that hippy smell).

Posted in  | Tags , , , ,  | 1 comment | 1 trackback

The Youth Of Today

Posted by Chris Shorrock Fri, 11 Aug 2006 15:20:00 GMT

As someone who is probably still considered a youth by most of the general public (26), or at least I can fool myself into thinking that until I hit 30, I can't help but wonder what the current state of the programming world is doing to the kids just coming up in the world.

I'll probably receive some email from someone stating since I've never worked with punch cards I have no idea what I'm talking about, but I'll ignore that for now. In the good'ole days there were no fancy IDE's and there certainly wasn't any fancy programming concepts like agile development processes or extreme programming(whether or not I buy into these is another issue). I'm a strong believer that this type of environment fostered some very valuable skills.

Now don't get me wrong, I work with an IDE and it does save me a bunch of time, but the time I put in with a text editor and a command line taught me more than I can imagine. Failure is the best teacher, and if we're not allowed to fail because our IDE picks it up right away, or we have someone sitting behind us watching every character we type how much are we really learning? Is this process efficient? Of course is isn't, but the time spent struggling with a stupid problem will pay of later when you're getting paid to work and you avoid that problem all together. So am I suggesting that people just starting out programming should avoid automated tools all together? Well, yes, until you're getting paid the process is more important than the end result, allow yourself to fail.

I had a friend (sorry Dan) who I started my first job with who literally spent about 3 hours trying to debug the following piece of code (simplified in Java for presentation purposes):

	while(expression.is_valid() && null != name); {
		Log.info( "Why doesn't this work" );
	}

The astute (or even half-asleep) reader will see the extra semicolon and pick up why the log statement was never reached. But the time spent solving this problem taught him a valuable lesson that wouldn't of been learned had he been doing this in today's modern IDEs.

That's my message for the younger generation. Give a man an automation tools and you'll feed him for a day, teach a man how to write automation tools and you'll feed him for life. And with all that said I'll leave you with some humorous images of todays generation (my wife is a teacher):




Posted in  | Tags , , , , ,  | 4 comments | 1 trackback

Do You Know Where YOUR Credit Card Number Is?

Posted by Chris Shorrock Wed, 09 Aug 2006 19:50:00 GMT

Now I’m not here to name names, or call people out on their bad designs, but there is something very scary about how credit card processing works. As someone who has had to implement credit card processing using a variety of different processors for a variety of different companies I’m always amazed by the amateur status of almost (as their are a few rare exceptions) all credit card APIs.

For those of you who are wondering what the problem is, let me enlighten you, these APIs seem to have been designed by monkeys. It’s my belief that these companies have employed the infinite monkey theorem to get things done. I can’t speak to what happens after you send you’re information to these companies as the process is (as it should be) a black box, but if the client interface is any example you should be afraid, very very afraid.

Now considering that my monkey theorem presented above is correct, I have to applaud the monkeys for at least getting the documentation correct some monkey needs to be spanked for the awful documentation that is presented to developers of almost every system. Let’s take a peek at an the XML structure for an unnamed payment processor.

<auth> 
  <order> 
    <orderDescription>order12312323</orderDescription> 
    <customerPaymentPageText>M123456789</customerPaymentPageText> 
    <currencyText>USD</currencyText> 
    <amount>100.00</amount>     
  </order> 
  <card> 
    <cardHolderName>Steve Smith</cardHolderName> 
    <cardNo>8005787962</cardNo> 
    <securityCode>123456789</securityCode> 
    <cardTypeText>BLAH</cardTypeText> 
    <ipaddress>192.168.1.1</ipaddress> 
  </card> 
  <option> 
    <useroption>100000000000000000000000000000</useroption> 
  </option> 
</auth>

Looks good? Sure it looks ok, until you start looking at the description for each of these fields:

cardNo: you would expect this to the card number of the card. However, the monkeys thought differently, this is actually a 1-800 number. Yes, that’s right, a phone number is stored in the cardNo field.

useroption: What’s this happy little fella? Most processors give you some level of customizability, this is this processors attempt at this. The problem lies in that if you omit this field or if it does not equal 100000000000000000000000000000 you will get an error which reads Request Timed Out from Processor - Connect switch. So there’s a field that is required that is meant to provide customizability, yet can only contain 1 value or else you get an error that reads like it was a configuration problem? Yes - thank you monkey, thank you for the for the 4 hour headache this caused as I worked out the problem with your technical support monkey who I’m sure was reading answers out of a book.

Does it work? Yes, eventually, after costing more development money than it should.
Is it scary? YES^2.

Why is it what should be an uber-professional API is almost always is a gong show? Marketing - because these processors have a nice looking website, with flashy buzzwords, the powers that be, WOW’d by the shiny objects, will always go with the service thats has the most shine. What they neglect to realize is that the company has thrown the monkeys in the back room while they smear their poo on the wall. Not so shiny in that room…

Posted in  | Tags , , , ,  | 23 comments | 2 trackbacks

At Least Its Not Myspace...

Posted by Chris Shorrock Wed, 09 Aug 2006 13:51:00 GMT

I had said for some time that I would never do THIS. I would never jump on this whole blog thing as my interests don’t often mesh with the rest of the worlds. But here I am, writing about how I never intended to write.

Why did I start? Peer pressure, plain and simple. My wife was harassing me to, friends said I would be good at it - so here I am - giving into peer pressure - like a girl on a prom date.

A brief introduction is in order, I’m a programmer living out of Vancouver Canada, with a wife of 5 years and a screaming little thing that is hurting my head daughter. Currently working as a pseudo-freelance programmer specializing in all things Java while I enjoy dabbling in Ruby and other things in my spare time. I’m also play more video games than I should and enjoy rolling around and trying to submit other men Brazilian Jiu Jitsu, and mixed martial arts. People often think I’m grumpy but I’m really just shy, which is good cause I’m not often in the mood to talk…. Maybe I ought to re-evaluate that statement.

As I said, my interest are diverse but if there are any programming fathers who like to play games and get in the occasional fight, I suppose you’re my demographic.

I’m an awful speller, so if you feel the need to point it out, I’ll ignore you take very careful note of it. I also need a better title for this whole blog, so any suggestions are appreciated.

Posted in  | Tags , , , , , , , , ,  | 6 comments | 25 trackbacks