Beauty’s where you find it
16 Jul
Another great quote from Code Complete:
Managing complexity is the most important technical topic in software development. In my view, it’s so important that Software’s Primary Technical Imperative has to be managing complexity … Once you understand that all other technical goals in software are secondary to managing complexity, many design considerations become straightforward.
Code Complete Second Edition - Steve McConnell (Chapter 5.2 Key Design Concepts)
It all comes back to maintainability of your codebase. This is something that I am constantly trying to get better at. Typically the majority of time spent in a web application is post initial production deployment. I would advocate that extra time up front to make those smart decisions will only mean quicker response times when bug fix and feature requests are coming in. The quicker response times are a direct result of managing complexity up front.
15 Jul
I completely embrace the idea of coding standards, and for a long time I’ve used my own. This morning I have decided that from now on I will be following the coding standards set fourth by the Zend Framework.
http://framework.zend.com/manual/en/coding-standard.html
This is a decision I don’t make lightly, and one that I have been toying with for a long time. Do you have a particular set of standards you follow?
13 Jul
Horst Rittel and Melvin Webber defined a “wicked” problem as one that could be clearly defined only by solving it, or by solving part of it (1973). The paradox implies, essentially, that you have to “solve” the problem once in order to clearly define it and then solve it again to create a solution that works. This process has been motherhood and apple pie in software development for decades (Peters and Tripp 1976) … a dramatic example of such a wicked problem was the design of the original Tacoma Narrows bridge … This is a good example of a wicked problem because, until the bridge collapsed, its engineers didn’t know that aerodynamics needed to be considered to such an extent. Only by building the bridge (solving the problem) could they learn about the additional consideration in the problem that allowed them to build another bridge that still stands.
Code Complete Second Edition - Steve McConnell (Chapter 5.1 Design Challenges)
Perhaps because I am a Mainer I keyed in on this content. It’s wicked good! At any rate, I like the example that McConnell uses to illustrate a wicked problem. Imagine though that the bridge had not collapsed, and instead only violently swayed in the wind. Would the engineers have taken down the bridge and started over, or would they have monkey patched tried to extend a flawed design? Would the bridge have been easy to “fix”, or would the fixes only have introduced more potential for disaster. It’s interesting to think of software in this regard. It’s impossible to design software today that addresses every issue of tomorrow. If the software is written in a cohesive, organized, thoughtful way though, it should be easier to monkey patch extend.
12 Jul
More and more as of late I have been finding that I do most of my programming at work (as I should), and most of my reading at home. At any given time I am reading 3 or 4 books, and trying to keep up with numerous blogs. I have such a backlog of things I want to read that programming at home is often not an option. Not to mention the fact that my family is growing (a 2 yr. old and another on the way). So, I don’t hunch over at my keyboard into the wee hours of the morning like I used to. So, when do you program?
Just in case you are curious, I am currently reading:
10 Jul
We have a client who is having issues with character encoding. They recently had a massive content migration and along with the migration came numerous character issues. They moved from a character set of iso-8859-1 to UTF-8, and with multiple content editors copying/pasting from many different resources (pdf’s, Word, Web Pages, etc) they now have some cleanup to do. We were recently asked if we could provide a report on all the pages where certain characters resided. No problem. We ran some SQL queries (most content resides in the database thankfully) that looked similar to the following:
SELECT p.id, p.title FROM `pages` p WHERE p.content REGEXP '(‚|…|)';
In the case of the above query, we’re just taking advantage of MySQL’s native REGEXP operator to check for the existence of any of the three characters (simplified for illustration) in a content block. After running our SQL statement we quickly realized that the work necessary to clean this up would likely amount to at least a few weeks for our client. With an additional few hours of work (after backing things up and testing, testing, testing) we were able to provide a solution that will take a matter of minutes to implement (if the client chooses to hire us to do so). Here is an abbreviated version of what we came up with:
UPDATE `pages` p SET p.content = replace(p.content,'¢¢š‚',''); UPDATE `pages` p SET p.content = replace(p.content,'¢¢š…\',''); UPDATE `pages` p SET p.content = replace(p.content,'¢¢š',''); UPDATE `pages` p SET p.content = replace(p.content,'‚',''); UPDATE `pages` p SET p.content = replace(p.content,'‚',''); UPDATE `pages` p SET p.content = replace(p.content,'…\',''); UPDATE `pages` p SET p.content = replace(p.content,'…\',''); UPDATE `pages` p SET p.content = replace(p.content,'…',''); UPDATE `pages` p SET p.content = replace(p.content,'',''); UPDATE `pages` p SET p.content = replace(p.content,'…',''); UPDATE `pages` p SET p.content = replace(p.content,'','');
There isn’t anything earth shattering here. These are simple queries, but they illustrate the inherent abilities of the technology employed with our client’s application. These inherent abilities, if known, have the potential to save dozens of hours. In the case of the above example, I truly believe we will likely save our client at least 30 man hours.
8 Jul
On the way into work today I saw someone wearing a Yellow chicken suit in front of a Red Lobster restaurant. In and of itself that isn’t much for news, however I almost went off the road when I saw the sign they were holding:
Top Frederick (as in Frederick, Maryland, USA) company looking for Senior Programmer …
I really, really wish I carried a camera in my car. How Senior is the person they are looking for I wonder? Senior in High School? I have a sense of humor, and this company was probably trying to appear casual and cool, but this just seems strange to me.
2 Jul
Tomorrow I’m having heart surgery!! It’s really more of a procedure than a surgery, but it does involve doctors going into my heart and making some burns around my Pulmonary veins. For 8 years now I have lived with Atrial Fibrillation, and tomorrow this procedure will hopefully be the start of a life without AF. For me anyways, when I’m having an episode I get tired, winded, light headed, and weak. I have found over the years that certain things tend to precipitate an episode, include: drinking beer (damn), staying up late (damn), unhealthy eating habits, drinking coffee before bed (damn), and allowing myself to get dehydrated. Also, laying on my left side at night tends to cause problems. When an episode does start it can last anywhere from 1 - 24 hours. Just this morning I came off the tail end of a near 24 hour episode. I only recently found out that exercise can cause my heart to go back into normal sinus rhythm. So, a light jog/brisk walk this morning did the trick.
So, goodbye AF. You have been a pain in my ass and you will not be missed.
Update: The surgery went well. From what I’ve been told I was very hard to control on the operating table and had to be restrained. At one point I sat up during the procedure and knocked my head against one of the overhead devices. There were 281 different burns made around my Pulmonary veins, and evidently I am a rarity, as I have 5 veins instead of the typical 4 (go me)! I think the total time I was on the table was around 5 hours. After my recovery period I was pretty sick due to the dose of anesthesia needed to keep me under. Currenty I’m taking 5 different drugs, 2 of which are blood thinners. I hate medication. Lisa was awesome of course and is taking great care of me. Her mom came into town to watch Cameron. We’re so lucky to have her. Anyway, my healing phase is 3 months, after which I hope to be drug free and free of AF.
1 Jul
In my opinion, an API should be many things. Perhaps the most important thing it should be is easy to use. If it isn’t easy to use (because documentation is poor, naming in inconsistent, or because it’s just not well thought out or organized) than it will likely only lead to frustration. Not only will it be difficult to develop on a poorly thought-out API, but it will be incredibly difficult to maintain and extend an application built on this poor API. I’ve been thinking a lot about style guides recently, and the troubles clients often have when they can’t effectively use the site styles we (developers/designers) have put together for their project. With that in mind I wanted to talk about how your style-guide is your client’s API. You are the programmer/developer/frontendguy/whatever. You have put together an incredible application that allows the client to create and maintain pages (complete with enough Ajax to sink a ship). Now you hand the application over to the client, and they need to begin the process of populating content.
27 Jun
jQuery took what would have been a 4 - 6 hour job ordeal and turned it into 10 minutes of pure enjoyment. Read on.
One of our clients at work has a site which is maintained with Dreamweaver (DW) templates and Contribute. If there is anything I have learned about this combination, especially DW templates, it’s that updating templates/libraries and pushing those updates to pages can become increasingly painful as a site grows. This particular client insisted on the template/Contribute route, and at the time we couldn’t make a solid argument about why they should not pursue this solution to content management (we now have that argument). We are on a maintenance contract with this client and once per week we have requests to update content. Because I did the initial setup, and because I have the most experience with DW, this job falls on my plate. Here’s the rough flow of data management / updates.
This process is time consuming, slow at best, and very frustrating. Now I would normally be working on other tasks while files are being checked in/out, however that’s not the point. This whole workflow makes we want to vomit.
Today we had a request to add a footer to each page in the site, where previously there had been no footer. That’s an update for every template file, and every page in the site. You might be thinking, why didn’t you initially add markup for an empty footer, or at least add an include that pointed to an empty file? We didn’t, but that is a good idea. Instead, I took what would have amounted to 4 - 6 hours worth of mindless, brain numbing work (believe it or not, it would have taken 4 - 6 hours), and instead implemented a javascript/php include solution. This took about 10 minutes. Here is the markup.
$.get("/assets/php/includes/footer.inc.php", function(data){
$("#wrap").after(data);
});
As you can see, I created a footer include file, used jQuery’s get method to retrieve the contents, and inserted those contents after the main wrapper div. I chose to pull the contents of the footer from an include file in order to make future updates of that content more manageable. I wouldn’t want a future developer pecking around in the JavaScript just to update the footer. That would be just plain wrong.
In the world of web development implementation typically isn’t the issue. Figuring out the proper solution usually takes more time. What I’ve done here isn’t rocket science, but it did save me hours of time, while not sacrificing future application maintenance. I can live with that.
Recent Comments