Wednesday, October 26, 2011

Moving to Tumblr

I don't like Google anymore.  Well... that's not really true...  Most of their stuff is pretty awesome and I use just about all of it...  Name a service and I probably use it...  But the problem is that all my eggs are in one Google basket and the problem is that I don't like the way they do business.  I don't like being the product they sell to their advertisers. I don't like the fact that all their services just drive more information into their profile about me. They know way too much about me and it's my own damn fault.

So I've decided that I'm going to migrate some things away from Google.  I'll use Twitter and Facebook rather than Google+.  I'll use iCloud mail and calendar services rather than GMail and (G)Calendar.  Flickr rather than Picasa, iPhone rather than Android.  And starting today I'm going to use Tumblr instead of Blogger.  But Google search is way better than Bing (IMHO) so for now Google Search, you're safe.

Now I haven't posted much in the last year and a half so it's not a big deal anyway but I feel better about it.  If you want to still follow me I'm at http://omegalisk.tumblr.com/

Sunday, July 25, 2010

Apple's diversion seems to be working...

Ever since Apple's press conference a little over a week ago I've seen a lot fewer fervent iPhone4-hate posts.  Now I don't particularly care for Apple's tactics on the issue (i.e., pointing out everyone else's death-grip antenna problems) but I have to admit that it was pretty darn effective.  I still think Apple has a problem (potentially worse than the other smart phones out there) but they've certainly been able to reduce the ferocity of the attacks.  For that they get top marks.

It was also obvious just how personally they took the attacks.  They put their hearts and souls into the project and believe they have an exceptional device. When reviewed from a lot of different angles they're right.  It seems like a great device (I'm in Canada so I haven't seen one yet).  So when the media blew up the severity of the antenna issue they got a upset.  That was obvious in their defensive position and the tone of their message.  But you know what? I completely understand.  I like to think I'm pretty passionate about my work too and have undoubtedly gotten overly defensive on occasion.  I know what it's like to feel unfairly shot down...  So again, I think they did a good job getting that across in the message.

But the job's not done... The free bumpers and refunds address the immediate problem but now I expect Apple to take this brief reprieve and use the time to come up with a better solution.  Maybe we'll see a small adjustment that will make the iPhone 4 more acceptable, maybe we'll see more carriers adopt the iPhone (and remove the negativity that comes with AT&T), but I expect we'll see a more thorough solution in the next iPhone iteration.  What doesn't kill you only makes you stronger, right?

Wednesday, July 14, 2010

How Much of Apple's current problem is AT&T?

People have been bitching about dropped calls and reception issues with the iPhone forever.  Everyone who has an iPhone in the U.S. bitches about AT&T.  So now when the iPhone 4's quality is called into question, I'm guessing a lot of the AT&T hate is being inappropriately applied to Apple.  I'm not saying there isn't a problem with iPhone 4.  I actually have no idea, but I'd be willing to bet that the dog pile that's forming is at least partly due to AT&T.  How exactly would a consumer be able to tell the difference?  All they know is that they can't make a call.  Is it the carrier, the phone, or a bit of both?  The current bitch-o-rific bandwagon is to blame Apple so that's what everyone is doing.

Part of Apple's solution to this iPhone 4 debacle should be the end of the AT&T exclusivity in the U.S.  Of course it may become a little more difficult to convince another carrier to offer the iPhone if everyone thinks the product has a defect...  What a mess.

Monday, July 12, 2010

iPhone 4 Disaster

Regardless of what's really happening with the iPhone 4's antennae, Apple may have a Windows Vista on its hands... a PR nightmare.  I think they can (and will) recover but in the meantime Google is probably preparing its "I'm an Android" ads just in case.

Tuesday, June 15, 2010

At the Intersection of Technology and Liberal Arts


I love this slide from Apple's Steve Jobs. I wish more people felt as passionately about striking that balance.

Sunday, February 07, 2010

YoYos

When I was a kid, one of my favourite toys was a red wooden YoYo, a gift from my father. I never really did much with it, but was happy to make it go up and down. Something about the spin and the anti gravitational effect of climbing up the string was mesmerizing.


It wasn’t until a few years later when I was in grade five (I think) that YoYo’s made a big splash at my elementary school with the Coca Cola and Sprite “return tops”. The school yard was full of them and it was only then that I learned a few tricks: “Sleeper”, “Around the world”, “Loop the Loop”, “Three Leaf Clover”, “The Breakaway”, and the ever popular “Walk the Dog” and “Rock the Baby”. But like every craze, it faded away...


But I never forgot my favorite toy... As an adult, I could always find YoYos branded with company names at conferences or trade shows. This one with Sun’s Java logo (definitely a collector’s item) I picked up in San Francisco at the JavaOne conference in 2004.


Fortunately for me, my wife knows I like these things so she gave me this Yomega Firestorm Wing YoYo as a Christmas gift around the same time. “Everyone should get a toy in their stocking” was her very sound reasoning. Now this little beauty was a bit different from every other YoYo I’d ever owned... for two reasons. One was it’s shape. It has what’s called a Butterfly Design. I didn’t know it at the time, but the flared shape is meant for doing string tricks; the shape helps you land the YoYo on a string. The more traditional design on the other hand, is best for looping tricks, the kinds of things I was doing as a kid. The other thing that was new to me was that it has a transaxle, basically a plastic sleeve around the metal axle that allows it to spin freely. That small improvement made things like the sleeper a breeze. Again this design enables string tricks. But not knowing that at the time... I just kept did the same old stuff as always, got bored and eventually put it down in my growing collection.


It was a few years later when my curiosity about YoYos was piqued again. A guy at work bought a Duncan Bumblebee YoYo and informed me about its ballbearing transaxle. Instead of a simple plastic sleeve, this thing had a ballbearing that allowed for even longer sleeps. Shortly afterwards I found the Yomega Raider for sale at The Discovery Hut in Chinook Centre here in Calgary and quickly bought it. After that day and thanks to the wonders of the web I was able to discover a lot more about the resurgence of this toy and found myself wanting to combine the shape of the Firestorm with the ballbearing axle of the Raider.


In 2007 I bought the Duncan Freehand YoYo at Games People Play at the North Hill Shopping Centre in Calgary. It has the butterfly shape and the ballbearing axle and it came with a mini instructional DVD. That’s where I learned about string tricks and freehand tricks... not that I could actually perform them. Even the starting trick “Man on the Flying Trapeze” (aka, “Flying Trapeze” or just “Trapeze”) was too much for me. I just couldn’t land it consistently. But I kept trying.


That leads me to where I am today. Last Christmas I got a YoYoJam New Breed. Its Butterfly shape is a bit more dramatic than the Freehand, has a wide gap, a large ball bearing transaxle and is made from a combination of plastic and metal (which may again enhance sleep times because of the extra weight at the edge). It’s this YoYo (and replacement strings from yoyoGstring) that finally got me interested in playing again. I also can’t go without highly recommending a series of short instructional videos on YouTube by AndrĂ© Boulay. They’ve helped me learn the “bind return” skill and tricks like “Trapeze”, “Double or Nothing”, “BrainTwister”, “Split the Atom”, “Zipper”, “The Matrix”, “Drop in the Bucket”, and “Plastic Whip”.


YoYos have come a long way and so have the tricks. I find it pretty fun and have only started trying to learn the advanced stuff. For inspiration check out this latest video from a Calgary company called Saturn Precsion Yo-Yos (SPYY) or this one from an Edmonton based company called Caribou Lodge Yoyoworks (CLYW)

Sunday, September 27, 2009

Mono (C#)... 4 years later

It's been 4 years since I first started looking at C# and in particular Mono. Since January 2005, I took a course on C#.NET and even worked on a project or two, but I can't seriously claim that I'm a big .NET guy (yet). I continued to work in Java and a whole lot more with Ruby and Rails (thanks to JRuby). But just like I said 4 years ago, I'm a pragmatist about these things. Since Calgary seems to be moving to C#, I figured I should probably take a look at the lay of the C#.NET land again.

I'm still a Mac-toting fan boy and don't really want to pay for a Microsoft OS license or pay for their IDE so Mono is the only game for me. So I headed over to the Mono website. I was ecstatic to see that MonoDevelop finally works on a Mac. So I downloaded the latest Mono runtime and the latest beta of MonoDevelop. I installed both without a hitch and proceeded to build an ASP.NET MVC webapp in just a few minutes. No fuss, no muss, it just worked... Very cool.

I still work in Rails most days and in my spare time I continue to work through an iPhone App development course so Mono isn't going to get a lot of attention for a little while, but it's out of the fridge and on the back burner...

Tuesday, September 22, 2009

Quicktime X A/V Controls

I've been (very slowly) working my way through Stanford's CS193P iPhone development course available on iTunes U.

iTunes is a pretty good client for watching the lectures. It keeps track of where you were and if you're like me and your lecture viewing is frequently interrupted (i.e., kids), that can be a pretty useful feature.

But one of the things that it won't do is allow you to speed up the playback (at least I don't think it will). So when the instructors are talking about due dates, late assignments, and other housekeeping that doesn't really apply to you, it can be frustrating to watch through it in realtime. So if you can live without iTunes' ability to track progress, simply go find the movie on your hard drive (right click and select "Show in Finder") and open it up in QuickTime Player.

In Leopard open the "A/V Controls" window in QuickTime 7 and set the playback speed (up to 3x). After installing Snow Leopard I was sad to see that the A/V Controls window was missing from QuickTime X so I assumed you had to use the optional QuickTime 7 installation. But tonight I tried option clicking the fast forward button in the QuickTime X Player and discovered that instead of increasing the playback speed to 2x, 4x, or 8x when you repeatedly click the button, it incrementally increases the playback speed by 0.1x up to a maximum of 8x!

So there you go. Save some time and learn some iPhone development too.

Friday, June 05, 2009

Put Out to Pasture

I can't help but feel a bit unwanted and put out to pasture... You see my development group has just been moved out of the building where the majority of our users work. While it comes as the result of another business unit demanding our office space (they're more important than us), it feels like just another step in what has been a long progression to outsourcing.

The History

At some point Management got hold of the term "core competency" and started to go wild with it. They figured that since their "core competency" was Oil and Gas, that they should outsource all other non-core functions. Since they didn't understand IT and didn't want to seek to understand, we became the obvious target.

Management's (evolving) Plan

Step one: get rid of all the technical people. If you were technical then there was no position for you as an employee. But that didn't quite work as expected because everyone just became an independent contractor. You had the same people doing the same work in the same offices. You officially reduced head count, but you were paying more for exactly the same service.

Step two: Put 3rd party companies between you and the independent contractors. You centralize the billing and satisfy some taxation laws (the people no longer look like employees) but you're still paying more because these 3rd party companies who really don't do much still have to make a buck.

Step three: Remove their ability to talk directly to the users. Insert a new group of "Business Analysts" between the technical people and the users. Now you got a nice buffer zone. The thinking goes something like this: These business analysts will be the liaison for the users and the technical people. They'll be able to speak both business-speak and techie-talk. Since we never really understood what those technical people were saying and suspect that they were always trying to bamboozle us, we'll trust the BAs to keep the techies in line.

Step four: Round up the techies. They were distributed all over the place before and were actually sitting with the business. Can't have that. Put them all together in one team where they can "learn from one another" and make sure that they have to get all requirements filtered through our BAs. The BAs are better at determining requirements anyway and write lots of nice impressive looking documents. This is looking good.

Step five: Move the techies somewhere else. The business people can still talk to the techies. Dammit! A couple floors and an elevator ride are not enough. Move them to the basement or even better another building!

Step six: Outsource. All techies are the same. Replacing them is easy now. The BAs are now in control and all those fabulous documents they create are wonderfully accurate and complete and easily implemented by some faceless drone somewhere else. Mission accomplished!

The Reality (before step six)

The BAs (for the most part) neither understand the business nor do they understand the technology. They were either the incompetent technical people or the incompetent business people that the company didn't know what to do with. Ahh perfect, make them BAs. Somehow they'll be good at that. At least they're blissfully unaware of their role in all this.

The technical people who do the actual work are unhappy. They feel marginalized and unappreciated. They want to use agile software development techniques and improve their craft. But with BAs who don't understand Agile and who more often than not run the projects (with a surprising lack of project management skills) that gets axed. Unit testing goes out the window, independent QA is curbed, and directly speaking with the users is prohibited. The requirements documentation is understandably flawed and incomplete. Communication is strained, scope is fixed and because they know better the BAs fix the timeline. Through individual heroics software gets pushed out the door but the bug counts are way up.

The users are frustrated and stuck with an unworkable process. Projects take forever, response time for fixes is slow, and they very rarely get what they need. Results are invariably poor but regardless of feedback to IT things don't seem to improve.

Upper management is seeing their vision implemented and are happy. They are blind to the pain their decisions have caused.

The Fix

Realize that IT is a part of doing business. You can't avoid it. Yes it's a frustratingly complex problem and a sometimes difficult-to-understand creative endeavor but it's necessary. Agile software development techniques have evolved out of decades of failed projects and painful experience. It is designed to address the communication problems and deliver working software in the most expedient way possible. Sure it has its problems too but adaptation and evolution of the process is the way forward. Tying things up in ever greater amounts of bureaucracy and politics despite your best intentions is ridiculous. Understand that IT is part of doing business and embrace it instead of trying to push it further away.

Friday, March 13, 2009

So why do you do it?

That was the question a member on my team asked me when I said "even though our team has a bright Ruby and Rails future it doesn't seem like anyone else in Calgary does".

You see he's not a Java developer or a Ruby/Rails developer but rather a data warehousing/ETL expert, and after hearing us rave about all things Rails he thought it might be a good idea to pick it up too. I didn't want to discourage his exploration but I also didn't want to give him the impression that in these tough economic times that being a Rails guru was really going to turn him into a hot commodity. That's plainly not true. In Calgary, it seems like the wind is in the sails of the Microsoft .NET community.

And while I don't despise C# (or Java for that matter) I don't have the affection for those technologies that I do for Ruby and Rails so his question threw me off. And he has a point, if it's not going to improve my marketability as a developer outside of my current contract then why in the world would I choose to develop non-mainstream skills?

Well for me the answer is easy. I've worked with Java for about ten years and done the odd C# project or two so I feel pretty confident in my abilities to use either one if I have to (C# just isn't that different from Java). But that's the point. My current environment doesn't make me use those technologies so I choose not to because I know I can be more productive with Ruby and Rails. In other words I can provide more value to my client for the same amount of money they're spending to have me sit there. I can deliver software to my users faster than I can with the other mainstream choices, and I can do it with less code that is better tested and I think more maintainable. And although I know there are developers who like to squeeze every billable hour they can from their client, I prefer to deliver so that my users have a positive experience. My theory is that the positive experience will make them think of me the next time a potential project rolls around.

That's why I do it! And oh yeah, I love it too. :-)

Wednesday, February 11, 2009

Ruby on Rails Makes Me Happy

Last year I got to work on my first Enterprise Rails application and although there were some brief moments of coolness, that project was punctuated with a lot of things that just made it suck overall. In fact, I was doubting that bringing Rails to the enterprise would be a good thing. There were just to many other things wrong that had nothing to do with the technology.

But half a year later our enthusiasm for Ruby on Rails hasn't been seriously diminished despite a less than stellar project, and surprisingly our commitment is growing. From three developers doing Rails we've grown it to five and my managers have fully accepted it and are pushing it forward for most new projects.

Excitingly for me, I was recently assigned a small but very high profile project. And this time I think I've been able to do things the best way I know how in a very short period of time. The controllers are RESTful, my routes are appropriately nested, the layouts are clean table-free HTML with CSS and the Javascript is unobtrusive. I really dig Prototype and the app is sprinkled with just the right amount of AJAX and the Scriptaculous effects are not gratuitous.

Quite honestly I'm pretty thrilled with this app. It's only been a week or two worth of effort but it's been thoughtful and extremely efficient. So efficient that I think the app will be fully functional before the TQA and Production Tomcat servers I requested will be provisioned by the server team (remember I'm in a big enterprise). And yes, you read that right I'm deploying to a JEE web container. I'm past any trepidation I may have once harboured about JRuby vs MRI Ruby. To me it's a proven part of my deployment strategy that I can depend on.

Anyway I'm a happy developer again. I'm getting apps written and deployed for my users and I love the look of my code. The cool thing is that Rails keeps getting better. Rails 2.3 is just around the corner. I like the application templates and the integration of Rack. I still have to bring up my testing game but give me another week and I think my tools of choice (RSpec, Remarkable, and FactoryGirl) will have me cranking out better test coverage than I've ever had before.

Anyway let me wrap this up with some of the things I think are wicked about Ruby and Rails and the various gems:
  • pluralize
  • belongs_to, has_many :through (declarative ORM)
  • Model.all
  • Model.paginate (will_paginate gem is awesome)
  • link_to_if
  • select, collect, each (collection methods are cool)
  • statement if expression (statment modifiers rock)
  • distance_of_time_in_words_to_now
  • model_url
  • before_update, before_delete
  • validates_presence_of, validates_length_of (declarative validation is sweet)
  • Ruby, a REAL language, in my view templates!
  • jruby script/console oracle (interacting with Oracle through my models via JDBC)
  • rake war:clean war (Thank you warbler)
  • script/autospec (even better on my Mac when integrated with Growl)
  • ActionMailer with layouts (my HTML emails never looked so good)
  • Ajax.Request, Ajax.Updater (Yay Prototype)
  • case (yeah just a nice simple case statement)
  • auto_discovery_link_tag and builder (yeah I added an RSS feed for good measure!)
  • Railscasts (an exemplary example of a great community, Ryan Bates you rock!)


Thursday, December 11, 2008

JRuby & Rails 2.2

We just started converting things over to Rails 2.2.2 and I thought I should say that the one feature that really kicks some ass is its thread safety. JRuby 1.1.5 (very soon to be 1.1.6), which takes advantage of Java's native threads, combined with this latest version of Rails finally makes for a very good deployment story.

Rails' traditional single threaded model, while conceptually nice for development, never really made things easy for deployment. In MRI-land, you always needed multiple processes, translating into multiple instances of Mongrel. In JRuby we needed multiple instances of the JRuby runtime. While it worked, it was definitely a bit of a memory pig. With Rails 2.2 we can now run with only one JRuby runtime in a JEE web container that was already multi-threaded. Now memory consumption is several fold smaller than what it was before and we now have a much better story to tell everyone. Thanks to everyone on the JRuby and Rails teams!

Now, I shouldn't just end with a big hurrah to everyone without mentioning that we did run into a problem with some thread unsafe code in our own app. It took awhile to find it (a week) so the one word of caution is be careful about any shared state in your application (in our case it was a rather obvious global variable that we seemed to keep overlooking).

In any case, Rails and JRuby are a great match for enterprise web app development. I've been hesitant to say that in the past because of a few rough edges like the one I mentioned before but now I think it's about time everyone should look at this fantastic combination.

UPDATE:
Thought I'd add a link to a recent Ruby shootout. It's reporting on the performance of JRuby vs other Ruby implementations and the importance of threading.

Monday, September 01, 2008

Heroku, RubyGems and Git

My daughter and I started a little Ruby on Rails project and I thought it'd be nice to host it somewhere for her to play with. I have an account on Heroku that I haven't used in months and thought it'd be nice to try it out again. I signed back in (after resetting my forgotten password) and was impressed to discover that they've integrated Git. After creating the project and navigating to the Rails start page I found some instructions:

gem install heroku
heroku clone stuffies
cd stuffies
[..local edits..]
git add .
git commit -m "local changes"
git push

So I ran off and installed the heroku gem. But had trouble with step 2. Fortunately a couple of google searches had me back up and running. One to deal with "Permission denied (publickey)" upon heroku clone. And another to figure out how to create the RSA key. Now I have a local Git clone of my project that I can work on in NetBeans and then I can quickly publish the changes to Heroku with a commit and a push. Sweeeet!!!

Wednesday, August 06, 2008

Calling Java from JRuby to do the dirty work

I recently had to try and read a UTF-16LE-BOM encoded text file from Ruby. I couldn't figure out how to get Ruby to deal with the double byte characters in the file. But I did know that Java has very good UTF support so I decided to let Java do the heavy lifting for me. I ended up with something like this:
require 'java'

import java.io.InputStreamReader
import java.io.ByteArrayInputStream
import java.io.BufferedReader

data = ''
File.open("text.txt", 'rb'){|f| data = f.read}

#strip the BOM (Byte Order Marker)
data.slice!(0..1)
#let Java deal with the UTF-16 encoding
reader = BufferedReader.new(
InputStreamReader.new(
ByteArrayInputStream.new(data.to_java_bytes), 'UTF-16LE'))

while ((s = reader.read_line) != nil)
puts s
end
It may not be the perfect solution (I'd like to see a regular Ruby solution) but I suppose leveraging the Java libraries was the whole point of JRuby in the first place wasn't it!

(Executing File.open("text.txt", 'rb'){|f| puts f.read} looked fine on my Mac, except for the BOM, but looked terrible in the console on Windows. The solution above actually converts the text from double byte to single byte characters)

Thursday, July 31, 2008

Really Achieving Your Childhood Dreams

By Randy Pausch. Great lecture from Carnegie Mellon's School of Computer Science. Here's the iTunes link and YouTube as well. Watch out for the head fake. Great stuff.

Wednesday, June 18, 2008

Lessons from my first Rails project

I’m finally being paid for working on an “Enterprise” Ruby on Rails pilot project. I think I helped persuade our IT group to give Rails a try. But unfortunately I wasn’t available to help the project get started. Instead I joined the project several months in. So while it’s cool to finally be doing Ruby and Rails full-time it’s also pretty painful to be living with some of the poor decisions made before I got here. I can’t say that if I’d been involved from the get-go that we would have avoided some of these problems (sometimes it runs deeper than the technology) but what I can offer is a list of things I’d suggest you watch out for (in no particular order):

Be realistic
In the early days of Rails I remember people saying things that made it sound that Rails was ten times more productive than Java. That’s a wild exaggeration and everybody should know it. There’s no way you’re going to be 10X more productive, end of story. Hope for “10% more productive” after you’ve got one or two projects under your belt. At least that’s realistic and achievable and if you get more than that then great! But for the love of God don’t start off with that idea. A big part of the software game is managing expectations. Don’t dig yourself a hole you have to try and climb out of. Despite what you read on the web, your first Rails project will probably take you more time, not less. New language, new tools, new framework, new infrastructure, new bugs, and new deployment problems. My project started with unrealistic expectations and now we’re over budget and over schedule. That’s not a great way to get management on your side.

Deploy early and often
That’s an agile thing and not unique to Rails, but getting over the hurdles of deployment shouldn’t be taken for granted. We’re primarily a Java shop so when people saw JRuby and WAR deployment, they figured everything would be easy-peasy. Not so. Part of being “Enterprise” is that quite often you’re several months, if not years, behind the technical curve. The first thing we needed was to get past Java 1.4 and an old version of Weblogic. We needed at least Java 6 and Tomcat 6. Trust me, getting “comfortable” IT infrastructure people to upgrade their technology can be very painful and slow.

Now assuming you got the basic app server running on a reasonably recent version of Java, go and figure out how to build the WAR (warbler gem), get to Oracle (activerecord-jdbc gem) through JNDI, get your Rails log files out of the exploded war directory (logging gem), integrate with ActiveDirectory for Authentication and you’ve got your hands full of a bunch of other problems that will eat away at your time. Budget for it.

Now once you got all that, deploy often! Our project has periodically deployed something outside of our dev environment but not frequently enough to gather any kind of momentum to satisfy our users. Without gaining the users’ trust you get into a whole other set of problems.

Unit test (RSpec seems pretty awesome)
Sounds like a reasonable thing to do... but we didn’t. I won’t go into all the reasons why testing is good, but to fail to take advantage of the testing infrastructure that Rails gives you out of the box is pretty ridiculous. Even if all you’re doing is executing the code and never asserting the results are correct at least you’re executing the code and will find runtime problems that a language like Java would have given you at compile time. I started using RSpec for my stuff and I really like it, but it sucks when the other developers won’t add to the tests or even run yours. But my strategy is to lead by example. Maybe sooner or later the other will pick it up too. If you can get buy-in early and be ruthless about keeping your testing effort on track.

Figure out the non-standard Rails stuff
Beyond the deployment stuff I talked about earlier, figure out the other places you must configure rather than adopting the Rails conventions. For example, we have a rule that says you must access the database from an account other than the schema owner. That means we needed to call set_table_name(‘schema.table’) in all of our models. We also needed to create the permissions for the non-schema owner. And don’t forget proper referential integrity constraints in your migrations. These are all things you can ignore for a while but if you have any hope of putting you application in your users’ hands you’re going to have to figure it out. Personally, I hate surprises like this late in the project. My recommendation is to sort them out early.

Don’t underestimate security (a.k.a., read the requirements doc)
We have users who don’t trust anyone and have dreamed up one of the most elaborate security mechanisms you can think of. Unfortunately we went through five months of development and not one of the developers before me even seriously looked at it. Sadly, I can understand why. Every Java developer (including me) thinks they got that one figured out and just skips that part of the requirements doc. Except that someone should have actually read ours and said Woah! It’s not always easy to retrofit something like this if you just assumed it was an orthogonal concern. If someone wrote a requirements document for you (no matter how badly written) be sure to read through the whole thing. You never know what problems may be lurking.

Read ‘The Rails Way’
In general, get some training. Or in lieu of that, get some good books. I bought “The Rails Way” by Obie Fernandez (great book btw) after I got assigned to the project. To my way of thinking the project should have already bought a whole bunch of Rails books and made them available to the developers. But it’s up to you to be prepared. If there are parts of the framework that are still a bit fuzzy start reading some books (go to the source if you need to).

Evaluate your editor
So like I said before, our shop is primarily a Java shop, so when I got on the project people were using IntelliJ to edit their code. Now IntelliJ may be a kick-ass Java IDE but from what I’ve seen it’s not great for doing Rails. So when I started, I used NetBeans. Now NetBeans has never in my mind been a great Java IDE, and quite frankly it’s not my dream Ruby IDE either but Sun hired the JRuby dudes and Tor Norbye, the principal NetBeans guy at Sun seems to understand Ruby and the needs of Rails developers pretty well. As near as I can tell, unless your a Mac-toting Textmate user, NetBeans is the best game in town for Rails development (I even use it on my Mac). So my recommendations is to get off your butt and seriously evaluate the tools you’re using. Maybe IntelliJ is the right thing for you, but you don’t really know unless you look around.

Use an issue tracking system
We didn’t have an issue tracking system when I started on this project. So not only could we not tell how far we were by test/spec status, we weren’t even tracking the change requests and bugs properly. Wow. In my mind this is part of the scope problem we’re having. The users just ask for something and without visibility to the whole team and management, it just gets magically added and the schedule slips.

Web 1.0
AJAX is pretty attractive to a Web 1.0 developer. But food is awfully attractive to a starving man too, but that doesn’t mean you should let him eat himself to death. Take it slowly. IMHO, do it old school on your first (and maybe your second or third) Rails project. Throw in the odd autocompleting field if you want but this AJAX stuff and all the pretty visual effects can get out of hand pretty quickly.

Use people who want it to succeed
Java and .NET are pretty typical technologies in IT and unfortunately a lot of the developers who’ve invested a lot of time learning this stuff seem to forget that the technology is only a means to an end and not the end itself. They’ll be threatened by new technology. They’ll be threatened by Ruby and Rails. So if you can, staff your project with the developers who are open minded and wouldn’t mind if a Rails application succeeded. If you push these hostile developers onto a Rails project their negativity will bring everyone else down.

Understand RESTful Rails
I don’t remember when exactly David Heinemeier Hansson really started pushing the idea of a resourceful/RESTful way to develop web applications with Rails, but it’s damn good stuff and you should really figure out what it all means before you start building a whole bunch of stuff the old way. Figure out Rails’ routing system and what map.resources does and then you’ll be able to go with the flow and let Rails do a lot more of the work for you. I’ve seen more than one developer write a lot more code than they need to.

Separate HTML, CSS, & Javascript
I can’t believe these so called IT web developers who still use all the old FONT, BORDER, WIDTH, ONCLICK etc. HTML elements in their templates. C’mon! HTML is mark-up, CSS is styling and JS is behaviour. Separate these aspects of your view layer the same way you separate models, views, and controllers. I’ll make some allowances for surgical uses of RJS but if you want things to be maintainable sort this out already. (I know this isn’t just about Rails but it bugs me so much I figured I’d rant about it anyway ;-))

If you’re about to embark on a Rails project, get ready to enjoy yourself, just don’t lose your head in all the hype and follow some good common sense.

Tuesday, May 13, 2008

My first JRuby contribution

I've reported lots of bugs before but this is the first time I submitted a fix back to an open source project.  The fix was to the JRuby-Extras ActiveRecord-JDBC project to allow you to do something like this for a Rails model class against Oracle:  

class Person
  set_table_name "department.people"
end

Accessing the database from someone other than the schema owner and therefore fully qualifying the table with schema is a rule I needed follow in order to deploy a webapp in my current IT department.  

I posted the original fix quite a while ago but nobody really took notice. Then Jesse Hu came along and made it better (and probably independently I might add) and also added a couple other fixes for things I hadn't noticed.  

But unfortunately neither one of us seemed to really know how to submit the fix so it got ignored for awhile.  Originally I created a patch and just pasted the text into the body of my comment.  Jesse attached the entire Java file.  A few days ago when Thomas Enebo asked for things we'd like to see fixed in the next release of JRuby I jumped at the chance.  After I got a hint about what to do from Charles Nutter, I got the latest version of the project from SVN, created a .patch file from Jesse's source, and then submitted it back to the JRuby-Extras Tracker and then finally back to JRuby's JIRA issue.

Today I got notice from Nick Sieger that it'll be in the next version.  Very cool.

Unfortunately I have to admit that I still a need a bit of work on my testing skills because I wasn't able to figure out where or how to insert some unit tests to prove that my fix worked.  Something to save for the next time. I'm just happy I can finally get rid of my custom version of this library.

Wednesday, April 30, 2008

Rails on Windows

I've been working on a Rails project at work for the last few weeks.  We've been targeting JRuby for deployment and therefore I've been working primarily in JRuby for development.  This week I thought it'd be nice to get running with the regular MRI with MySQL instead of Derby.  I installed cygwin and tried to get back to doing things at the command line (I've been using NetBeans)...  I was getting tired of the performance hit I was taking every time I ran a rake task or a generator or started up Mongrel.  I was under the impression that the MRI ran as well on Windows as it does on my Mac.  Not even close.  Performance still sucks and managing the differences between my JRuby installation and my cygwin hosted Ruby isn't much fun.  I'm about ready to bail and just go back to JRuby.  Now I know why people buy Macs to do Rails development.  It rocks.  Rails development on Windows on the other hand truly sucks.  Thank goodness JRuby and NetBeans are there to hand me a few niceties.  Otherwise I'm not sure I'd have the patience for it.

Sunday, March 09, 2008

The iPhone SDK

I don't own an iPhone and since I'm in Canada I can't even buy an iPhone from Apple even if I wanted to, but that hasn't tempered my enthusiasm for the new iPhone SDK.  Like so many thousands of others I downloaded the SDK as soon it was available, installed it, and then started coding away.  I'm sure more experienced Cocoa developers were able to quickly bang out something cool, but not me.  It took me a bit longer to get the mandatory "Hello World" running, but nonetheless, my previous Objective-C/Cocoa investigations definitely came in handy.  I think one of my mistakes was thinking that the videos Apple put up would help me.  IMHO, don't bother.  Go right for the developer documentation in XCode instead.

Alas, I can't really say that much about the SDK.  I clicked through one of those license agreements and I'm sure that there's something in there that forbids me from revealing anything too juicy.  But I think it suffices to say that I'm still enthusiastic about where this is going.  I think the iPhone (even though I don't have one yet) is a great bit of technology and once in the hands of people in the enterprise who suffer at the other craptaculous mobile devices out there, they'll definitely start demanding stuff.  And that's where I fit in.  I'm excited to see how this all evolves and hope I'm ahead of the curve at least momentarily. ;-)

Sunday, March 02, 2008

Javascripting with ExtJS

Back in the early days of my work in Java I adopted the typical Java developer's bias against Javascript. Whenever someone would mention Javascript I would cringe. Afterall, why would I choose Javascript when I had Java? But I always felt I was missing something.

So last year I decided to do something about it and integrated the Prototype Javascript library into my Struts application.  I quickly learned that I didn't hate Javascript but hated the inconsistencies in the browser DOMs and learned to properly direct my hate  (Internet Explorer, I'm looking at you!).  

Despite a couple hiccups, that project was really quite enlightening and I went on to expand my knowledge with a great series of videos at the YUI Theatre. Douglas Crockford has three series of videos that I highly recommend to anyone wanting to learn JS. He goes over the history of Javascript and plainly spells out Javascript's problems and strengths (e.g., it supports functions as first class objects with support for closure, hashes are all powerful, prototypical inheritance is different than classical inheritance but is quite workable, and be careful of the default global namespace).

So now armed with a proper understanding of the language, I started a building new web application in January and realized that there were requirement that would be best served by AJAX and some nice browser widgets.  In enters ExtJS. After a couple weeks writing a spike through Struts and ExtJS (still using Prototype underneath), I made the choice to adopt ExtJS as a the library for my application's user interface.  Two months later, I'm more than satisfied with the choice.  So are my users.  

In the end, I've shed a bias I really shouldn't have been harbouring, I embraced a "new" language and added the ability to better server my users.  I still won't choose Javascript for a lot of things but I'm much happier knowing that I can properly apply it as part of an overall solution.