Posted on Leave a comment

On programming – how to read other people’s code and why

Programming is an art. I [You] do a lot of business that starts off with "…and my developer just isn’t around anymore…" Dozens of statements could come before or after that but no of those statements change the meaning. Quite simply, you are [I am] about to look at someone else’s code and that person may be an expert programmer or a newbie borrowing snippets from other people’s examples. The code may be documented correct or incorrectly or not at all. Regardless, you [I] have to work with that code no matter its state or quality.

If you are a professional software developer, or aspire to be one, you will need to know a lot of of things. Various maths, stats, languages, frameworks, methodologies, tools, etc. Fads and buzzwords will come and go, all during your career. You’ll master some, ignore some, laugh at some. … You have got to be able to read other people’s code. [Source, Design by Gravity, How to Read Other People’s Code — and Why]

Worthwhile read by Christopher Schanck

Posted on Leave a comment

Love and care of your web developer – For artists

Dear Graphic Designers,
I understand that you are artists and by definition probably a little prone to inconsistencies for the sake of artistic license and creativity. I’m a little artsy fartsy myself so I can appreciate the desire to freehand a stroke rather than pull out a straight edge and right angle; after all this is art, not drafting…or is it. See, a web developer craves and desires regularity. Consistency, predictability, repeatability are programmable. That is, I can write something once and use it over and over with forecastable results. In odd cases, I can program exceptions. Exceptions to rules, much like the real world, are ripe for abuse and unpredictable results.

Consider the job of a doorman at a nightclub. He has been given a procedure. When someone enters the club, he increases the number on a counter in his hand. When someone leaves the club, he decreases the number on a counter in his hand. He is now given a rule which is as long as the number of people in the club is less than a particular number, let’s say 740, then he should let the person in the front of the line in. Once the counter hits 740, he doesn’t let people in. Nice and simple. Now let’s say the manager has a thing for a certain type of woman so he makes an exception to the rule. Any pretty blond woman under the age of 30 wearing a tank top and skirt above the knees immediate gets in without standing in line. We have introduced several opportunities for error but let’s focus on the most obvious one. If 740 people are in the club and a pretty blond 23 year old in a mini-skirt and tank top walks up, does the doorman let her in or send her to the back of the line?

Back to our graphic artists. When you are designing a layout for a website, the layout is typically created as a single image then sliced into smaller images. If you are designing a horizontal navigation bar, when slicing it up do not make two images 41 pixels tall, one image 42 pixels tall, one image 43 pixels tall, and the creme de la creme, the final image 44 pixels tall, and expect me to easily line up the text below the images. Especially don’t do this when the extraneous pixel height is all white space! Thank you. That is all.

/rant

Posted on 6 Comments

I need a new editor

For most of the past decade I have coded using CFStudio 5. It is a fantastic editor that was bought by Allaire from another company under the name Homesite. CFStudio was a more robust version of Homesite. Eventually CFStudio was abandoned which probably had something to do with Macromedia buying Allaire and wanting to promote Dreamweaver as their preferred editor. Now that Adobe owns Allaire/Macromedia, CFStudio has been reborn as Homesite+ and Dreamweaver still exists.

When my computer crashed, I found myself reinstalling everything. Yes, the computer is back up. It is running Windows XP and has a 500 GB hard drive. I can finally download all the podcasts I want! It also begs the question of whether or not I am using the best IDE for my purposes. I am not an eclipse fan. I see the potential and I really want eclipse to be a good solution but I’ve had too many bad experiences with it. For the past several weeks I have been coding in Notepad++ and although the compare plugin rocks the editor itself is really just an editor and I need an IDE.

Suggestions? IDE should accommodate PHP, ColdFusion, CSS, JavaScript, etc.

Posted on Leave a comment

What do bits and bytes look like?

I spend a lot of my days staring at stuff like this:

fV,da){var result=[];for(var i=0;i<=da.length-1;i++){if(da[i]!=fV){result[result.length]=da[i];}}return result;};function um_aM(fV,f){for(var i=0;i<=f.length-1;i++){if(fV==f[i]){return true}}return false;};function log(fi){regetPopDoc();var fW=um_K.getElementById("debugHint");if((um_v)&&(fW)){fW.value=fi+"\r"+"\n"+fW.value;}};function um_aZ(fV){var dn=0;if(fV.offsetParent)while(1){dn+=fV.offsetLeft;fV=fV.offsetParent;if(!fV.offsetParent)break;}else if(fV.x)dn+=fV.x;return dn;};function um_ba(fV){var dp=0;if(fV.offsetParent)while(1){dp+=fV.offsetTop;fV=fV.offsetParent;if(!fV.offsetParent)break;}else if(fV.y)dp+=fV.y;return dp;};function um_aF(el,gP){if((um_J)||um_I||ie){var gX=gP.split('-');var gY='';if(gX.length>0){gP="";for(var i=0;i<=gX.length-1;i++){if(i>=1){gY=gX[i].substr(0,1);gY=gY.toUpperCase();gY+=gX[i].substring(1);}else{gY=gX[i];}gP+=gY;}}else{}}var x=el;if(um_p||um_n||um_o){var y=x.currentStyle[gP]}else if(um_q){var y=eval('x.currentStyle.'+gP);}else if(um_I||um_J){var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(gP);log('get style: y is '+y);}else{var y=document.defaultView.getComputedStyle(x,null).getPropertyValue(gP);}return y;};function um_aN(){var fB=navigator.userAgent;var hd=navigator.appVersion;log('navigator is: '+fB);log('version is:'+hd);if(hd.indexOf('MSIE 5.5')!=

Posted on 1 Comment

Kill A Programmer!

Does your programmer frustrate you? Do the words "two weeks" rolling off his/her tongue make you want to strangle that programmer? Well, now, just like every time to you clap your hands a fairy dies..is that right?..clapping? and fairies? There’s something about hands and kittens dying too. Neither here nor there because now you can kill a programmer! To date, 46479 have been eradicated. Yes, with just the click of the mouse, you can fry one of those frustrating nerds! Or you can just ask them a question.

Posted on Leave a comment

Becoming a Google Adwords Professional

In 2000 or 2001, I was working with a company that needed an advertisement campaign manager. I stayed awake for fours days straight drinking gallons of coffee and taking only power naps to write an ad campaign manager from scratch using ColdFusion and MS SQL. This was before the days of keywords so instead ads were organized by categories. Each ad could be categorized and subcategorized. Campaigns could be scheduled for date ranges with multiple ads meeting IAB industry standards and the particular place on the page could be dynamically specified. Personally, I was pretty proud of the end product and impressed with how it turned out for being built so rapidly.

The experience of writing an ad campaign manager helped me appreciate the complexity of such an endeavor but nothing prepared me for the awe inspiring product that is Google Adwords! Prior to yesterday, I thought Google Adwords was just the name Google used for selling ads that appeared on sites of publishers using Google’s Adsense and in search results. Google’s Adwords is such a complex product that they offer a certification exam for people wanting to become Google Advertising Professionals. I spent yesterday reading, reading, and reading, and watching video after video after video to learn as much about running efficient campaigns as possible. There is definitely an art to writing an effective Adwords campaign and not wasting money.

I was going to give an overview of what I learned yesterday but I have so much more to learn and Les Jones has does an excellent job already. Read Les Jones’ post My quick advice on getting the most from Google Adwords.

Posted on Leave a comment

Week 2 – no work

A major project culminated on Saturday July 25. I did something unusual. Instead of jumping into another project or lighting a big fire under my sales and marketing hat, I spent a week tending to long neglected personal things. This was both necessary and cathartic. I feel human again.

Today I did some final testing on some client code and got final approvals and sign-off closing out yet one other project. I now turn my energies to patch a little code as a favor to an old client of mine and this afternoon I have a scheduled conference call to complete some research for a bid for what may be my next project. Hopefully by the end of the week I’m off overhead and back to billables. So far, I think it is a good idea to add a week of "no work" after an extensive project for tidying up loose ends and making up for neglected areas in my personal life. However, if by the end of this week I am not back to billable hours, I will declare it a failed experiment and begin working on a mental breakdown.

Posted on Leave a comment

PHP is exactly the same on Linux and Windows…

PHP is exactly the same on Linux and Windows as long as you are using good coding practices, are not using deprecated variables and functions, are not suppressing error messages, are not porting code from an older version of PHP. See, I maintain code on a project that was originally contracted to someone in the United States who failed to tell his client that all he was doing was outsourcing the project to a foreign company. He lost the contract to me when that foreign company became unresponsive to change requests. Many of the comments and variable names are in a foreign language that I do not recognize. The code looks like the foreign company had once written a CMS and just resell it shoehorning new features with hacks. There are many weaknesses to their code but this is not about judging other developers. This post is to warn that although PHP should conceptually move seamlessly from a Linux environment to a Windows Server environment, in reality it doesn’t.

Posted on Leave a comment

Today is Postmorem Day

Yesterday a major project ended for me. This project, as most, consumed my life. I gave up sleeping, found myself wearing the same clothes days in a row because I didn’t know the day had changed, skipped meals, and pretty much neglected anything that wasn’t related to getting the job done. Today I examine the aftermath. Yes, I thought I’d take the day away from the computer but if you stop the momentum, the project never really closes.

When I was a quality assurance engineer so many eons ago, I pushed hard for postmortems. In the software world, a postmortem is an examination after the project to review the development process while fresh in mind with the goal of improving the process on upcoming projects. A postmortem doesn’t just discuss where things went wrong but where things went right. A postmortem can include the ever important cleanup that happens afterward such as backing up the development environment, closing out your notes, jotting down notes about assumptions that were made and things aside for the future, and anything else to bring full closure to a project. In the real world, not many people like postmortems. They represent overheard to management and extra work to the developer. And it may or may not be billable to the client. People want to simply celebrate the product delivery, shove everything on the desk to the floor, and move onto the next project.

My postmortem is not billable to the client. Examining the aftermath, I recognize the importance of wrapping up to be able to move on. I can’t even find the surface of my desk right now for the scattered notes and neglected pile of mail. Instead of taking a break today, I’m going to bring closure to my project. (and find my desk).