James Carr | Rants and Musings of an Agile Developer

Archive for November 2008

As someone with a hearing impairment, I have stated in the past my frustration at the total lack of captions in the online world. Although network channels and television stations are required to provide closed captioning as per FCC regulations, online video is completely free of this requirement… which leads to many interesting videos with no captions. :(

I’ve blogged about this in the past, and at that time closed captioning for online content was in a sad, sad state. NBC, for example, had poor captioning only for selected content and no captions for some of my favorite shows like The Office. Luckily, this has changed! Heroes, which once displayed their captions to the side and in a poor sync with video, now displays captions just like on T.V. Further, I have yet to come across a show on nbc.com that I watch that doesn’t provide captions! :)

But it doesn’t stop there. One of my favorite online shows, Dr.Horrible, provided captions… and many are following the trend. Hulu, Veoh, and Youtube have closed captioning available if the content provided desires to provide it. Score one for the hearing impaired crowd!

Unfortunately, a lot of the video online that I really enjoy has yet to provide captions. TED currently does not provide captions for their talks, yet if this job posting is any indication they will have closed captioning in the very near future. YouTube may provide the ability for closed captioning, but many of my favorite technically themed videos (specifically, Google Tech Talks) still do not provide captions.

Overall, today things are quite a bit better than they were last year, and it seems that it will continue to improve. I’ll be really happy when TED talks provide captions, and even happier if Google Tech Talks begin to provide captions as well. The pushback is that it can be difficult to get a full time captioner to caption user generated content… it can be quite costly for businesses or providers that don’t have the resources to devote to captioning their videos.

What I’d like to see in the future? Perhaps an optional “Community Provided Captions” for online content… if the content provider is unable to provide captions, a youtube or hulu user can opt for captions provided by the community at large (while knowing these may be a little inaccurate). While not ideal, and frankly it’d be better to just display delayed transcripts for the captions, it’d still help open up content for the hearing impaired.

I’m very enthusiastic about closed captioning for online content in 2009… last year, I was very pessimistic. ;)

No tags

I’ll let you in on a dirty secret: my first paid programming task was to make custom modifications to an oscommerce shopping cart. I cut my teeth on PHP that weekend and learned through trial by fire how much good, clean code (with no global variables!) matters, and how much it really SUCKS when everything is in the global scope. I always died a little inside each time I had to make a modification… I once started refactoring the code on the side, but gave up after a month. It was just so… intense!

Anyhow, my days of modifying oscommerce carts finally came to an end. My current job has me doing java web development (which is another beast on its own) and although I do some php related gigs on the side from time to time, always opted to use Magneto or other solutions for my shopping cart needs. Today I wondered… did oscommerce 3.0 ever release?

A quick journey to their site revealed that, no, 2.2 is STILL the latest stable release (which is what it was when I first messed with in 2004/2005 I believe) and the last release of oscommerce 3.0 (Alpha 4) was over a year and a half ago… ouch! How did this happen? Isn’t it the open source community where you are often witness to truly agile projects out in the wild?

To me, I think it is a lesson in what happens when you have code that is hacked together, unclear, and difficult to maintain. Even worse, the original codebase was written for a language that has evolved VERY VERY quickly over time… PHP is now a different beast than it was when oscommerce2.2 was released (for java’ers, think of an app in java 1.3 in today’s world). And the fact it’s widely used compounds the problem.

Like any good software, good code often has users who are constantly in need of new features that need to be added. When dealing with legacy code, any new feature can be quite costly and often requires quite a bit of refactoring (or even complete rework) in order to be able to fit the new feature in nicely. Adding new features (while not breaking existing functionality) can be mind boggling sometimes… and if you don’t have any form of automated tests AT ALL (which oscommerce has none, to my knowledge) can be so scary that it deserves its own horror movie!

I’ve had my hand at working with legacy code, and the biggest lesson I have learned when it comes to rewrites is this: don’t. It is tempting… VERY tempting to just rewrite it, or rewrite whole sections. It’s tempting to do what oscommerce did with version 3.0: put together a big release plan and do some big bang releases with some complete rewrites. Don’t! While you’re spending time rewriting, planning, rewriting, etc… your competitors are releasing. And if they aren’t, your customers are growing impatient.

The approach I’ve found helpful is to simply release… add feature X, do a little cleaning up, and release. Complete feature Y, update the look and feel of the product management menu, and release. That way the features keep coming, customers keep getting satisfied, and the product evolves piece by piece in an iterative manner. But I’m off track… this isn’t a post about agile software development. ;)

To get back on track, this post is about the need for clean code. As software developers, we should always search out ways to improve the maintainability of our code if we want our product to thrive and grow… any deterrents to maintainability will impede others from improving it, and at worst will cause the code to become stale and often avoided. ;)

As a side note, although I have slammed OsCommerce for its code quality, I do have to acknowledge that for its time it was the best free shopping cart system out there… while others had to shell out thousands for crappy shopping carts with missing features, OsCommerce was there to offer those features not only better, but for free. The contributors and core developers did an EXCELLENT job meeting the needs at the time and producing what was honestly quite an awesome piece of software.

But, in the end, Legacy Code can come back to bite oneself in the a$$ if not properly controlled. :(

No tags

Okay, I lied… that was just to get your attention, but the statement is reflective of something I’ve found myself pondering lately. As software developers, we often think we’re experts in everything and downtalk a lot of ideals and technologies that we often have zero experience with.

Why is that?

No tags

Recently I’ve been pouring over some legacy code that also happens to have a ton of crappy, yet slightly masked, javascript errors. This has prompted me to consider that sometimes it’s a good idea to go back over some of the very basics. To start, let’s look at some javascript samples:

for(i = 0; i < 100; i++){
   // unimportant code
}
function createErrorMessage(){
    message += "an error occured."
    alert(message);
}

Notice any errors here? ;)

Yep, you probably noticed the absence of the var keyword where each of the instance variables were used. "B...b..but... javascript is sloppy like that! It's a dynamic language which means I don't need to declare anything, right!? And even if not, those variables only exist within their scope." The problem here is, thanks to the absence of the var keyword causes those variables not to be locally scoped... in otherwords, if I use i somewhere outside of that for loop or method and don't bother initializing it, I'll get it's last value it had in the for loop. Likewise, if I decide to use the same variable name "message" anywhere else, it's possible that I already have something in it.

This can cause bug holes big enough to fly a jumbo jet through! A lot of developers hate javascript anyway and hack it together as quick as possible so they can get away from it, and it's not uncommon that they might find a variable to be initialized to something, have no idea why, but go ahead and use it with that value outside of it's expected scope. This also leads to code that is very difficult to maintain and exposes the whole problem of global scope in the first place, as you can't really be sure where those values might be coming from.

Remember... always use the var keyword for locally scoped variables and never make exceptions. Write your loops as

for(var i = 0; i < 100; i++){
   // unimportant code
}

and write your local variables as

function createErrorMessage(){
    var message = "an error occured."
    alert(message);
}

and you'll thank yourself for it in the end. ;)

No tags

Nov/08

22

Google Adds Result Ranking

Google Search Results

Google: Reddit Edition?


I was doing some random searching for jQuery when I noticed that google added some kind of new reddit like ranking system to SERPs.

Although I like the idea, I’m wondering how they’re protecting such a system from underhanded SEOs? It’d be trivial to write a bot to promote SERPs all day long, but of course I’m sure they have some nifty preventive measures up their sleeve anyway. ;)

One thing I hope: this will remove those damn commit logs you come across when searching for technical solutions. ARRRGGHHH!!! I hate those!!

No tags

Some of you may have attended the MidMoXp usergroup which I began organizing on behalf of CARFAX in September of last year. Although the usergroup always had very good meetings and even a couple notable speakers, it’s always suffered from on again off again scheduling, mostly in part due to my own rather haphazard, sometimes conflicting schedule.

Luckily, the on again off again scheduling will be gone as the group will no longer be solely organized and put together by yours truely… in other words, if I fall off the face of the earth, the next meeting will still take place. ;)

But, that’s not the only news, there is much more activity afoot! When we met to plan the next meeting, we discussed several topics, and a specific question came up.

Why cater only to the eXtreme programming?

Which is a good question… only one organization in town (that I know of at least) does XP, while most might just be doing a few of the practices. By focusing just on XP, perhaps the group is a bit too narrow. We then decided perhaps it’s best to broaden the scope to include all things agile, but again, why stop there? There are quite a few people in town I know of who have no interest in agile, but they are interested in some of the agile practices or software development in general.

Which is why the group will be undergoing quite a bit of evolution. It’s no longer just focused on XP or agile anymore, but Software Development Best Practices. The topics will be a mix of technical, hands on activities (we will be organizing tutorials and coding dojos) with process related practices. You’ll still find a lot of agile related stuff, but as best practices versus promoting one methodology or another.

Our next meeting will be December 9th at 6:30 P.M. at CARFAX’s Columbia, MO data center. A co-worker of mine will be giving a presentation on Kanban boards with hands on exercises illustrating some of the advantages of using Kanaban boards to communicate progress. Hope to see you there! :)

No tags

Nov/08

22

OOPSLA 2008 Wrap Up

DesignFest at OOPSLA

DesignFest at OOPSLA


Life has gotten terribly busy as of late, and I have neglected to followup with my blog. First, I want to get my OOPSLA 2008 closing thoughts out of the way.

I attended OOPSLA back in 2006 and was very impressed with the program… I got to meet a lot of big names in the software design and development community, met a lot of authors who’s books helped shape my software engineering mindset, and overall had a great time and learned a ton of new things. I even learned of db4o and AOP for the first time. For these reasons alone I decided to revisit OOPSLA a 2nd time.

First let me cover what I loved about the conference. It’s almost absent of “vendorness.” You get a lot of close interaction with a lot of smart people, and in retrospect I think that I enjoyed the conversations and new contacts I made over any of the sessions I attended. Likewise, some of the sessions were very good too… I especially liked Linda Rising’s session on initiating change in your organization. The only sad part is I missed Rebecca Wirfs-Brock’s sessions on design. I opted out as I had a co-worker attend her sessions, only to find out my co-worker finds design and UML diagrams boring. At least I did attend Rebecca’s keynote on Design, which was top notch. ;)

This year was quite a bit different from the last time I went back in 2006 though. Noticeably, the attendance was a lot smaller. I think it was due to this smaller attendance that the sessions offered were somewhat limited and very specific… there were times when I was confused about what I should go to as there wasn’t anything scheduled in that particular block that interested me. This year also had a bit too much focus on DSLs. Yes, DSLs are awesome and hip and very very useful, but as someone just delving into them, there’s only so much I could absorb. Likewise, I was really hoping to attend more AOP sessions, but alas there were none (there were workshops, but no real tutorials or sessions).

I think OOPSLA needs to evolve a bit if it wants to continue and thrive. To me, it’s been a conference that brings together the top minds, engineers and developers in our industry to help improve and nourish our community. It’s a conference that one should be able to learn a lot from as well, so no matter how much our industry advances, we need to keep the barrier to entry small. Also, I think it’s the only conference I have attended that charges an arm and a leg for tutorials… although one can buy an all access pass, why not just be like Agile or other conferences and include unlimited session attendance / participation in the conference price?

I think a lot of people would like to see more modernism… there’s a lot of events and sessions around smalltalk and lisp (which is cool because I learned about Squeak at OOPSLA in 2006) but you won’t find many sessions or talks centered around javascript, groovy, ruby, or other interesting languages. The web facing portion of the conference is also quite absent with only one or two tutorials. Sadly, there was also no domain driven design sessions either. :(

I think the conference will survive though… and again one thing that marks today’s OOPSLA from OOPSLAs of years past is that a lot of the topics born or covered there have spun their own targeted conferences that draw large attendance numbers, and even those focus areas have many conferences.

In closing, I would like to say that Gail Harris DID do a great job of organizing the conference, and the Big Event at the Parthenon was completely awesome. I was also quite pleased that there were a few functional programming sessions mixed in as well. Although I plan to attend more web / agile based conferences next year, I am still going to try and attend OOPSLA yet again next year in Orlando… because despite any shortcomings, it’s still educational and fun! :-P

No tags

Theme Design by devolux.nh2.me