Great talk by Adam Wiggins here at RailsConf. But this post is more a reminder to me than a synopsis for you. Find out more at adam.blog.heroku.com and railscasts.com/episodes/150-rails-metal.
May 6, 2009
This morning’s keynote speaker at RailsConf mentioned, in passing, working on some code without named constants. When something needed to be changed you’d have to find the right instance of it and change it, and hope you changed it everywhere you needed to. It’s elementary that you should use named constants for just that reason. But this story reminded me of an early programming experience I had with FORTRAN IV on a CDC 6400.
You see, when you write a 1 in your code, you’re kind of using a named constant. That 1 is is the name of a value (that happens to be one, or 000000000000000000000000000000000000000000000000000000000001 in bits on the 6400). We always expect that the value of the constant named 1 has to be one. But in my freshman programming class, I managed to change the value of 1 in my source code to zero. FORTRAN programmers will probably know how I did that.
This made for a wonderfully oddly behaved program. The first time through a loop always worked, later ones always failed, and it didn’t matter what values I set before each run. The story had a happy ending: I learned how to read core dumps and a bit more about machine language, and moved on to other programming languages that make it harder to change the values of literal constants.
May 5, 2009
David Heinemeier Hansson is opening the conference, quite appropriately, and saying a lot of interesting things about the past and future of Rails. The conference is going to post video of the keynote in a day or so, and I recommend watching it. But what got me sitting up straight and listening more alertly was when he started talking about something else. Requirements.
David says that programmers treat requirements as commandments from on high. And that they shouldn’t do that. The stakeholders aren’t are committed to the requirements as programmers think. They know what they want, but they’d be just about as happy with a lot of other solutions, too. And those other solutions might be a whole lot less expensive to provide.
His example concerns chocolate. He’s got a sweet tooth. Ask him for requirements to satisfy that sweet tooth, and he’ll specify top quality Belgian chocolates. Meeting those requirements will take a lot of money and a lot of time. Maybe that’s necessary. But try offering a Twix bar right now for just a buck or so instead, and most of the time he’ll actually be happier with that.
The real key to programmer productivity is saying no to requirements as stated, and instead understanding what the stakeholders want to accomplish and opening negotiations with them on the best way to do that. Requirements are a starting point to that. They’re not handed down to us on stone tablets.
That means programmers have to be much more involved with stakeholders, and take more responsibility for the ultimate outcome of their efforts. But they’re going to create a lot more value if they do that.
May 4, 2009
I’m here at RailsConf looking for a bit of cold, free, sweet caffeine at the break. There are plenty of sodas, and they’re even the right brand – Coca-Cola.
But unless I want a lot of empty calories, my only choice is Diet Coke. Which is drinkable, but only barely. (Pepsi fans: don’t gloat. No other brand of diet cola reaches even that level.)
This is a travesty because now Coke Zero exists. Somehow they’ve managed to create a diet cola that really tastes like Coke (the only cola that has ever mattered)! But you can almost never get it at a meeting or restaurant because they’ve got the old standby Diet Coke. And Coca-Cola is fine with that because it helps in their goal to fill supermarket shelf space with several thousand different products all called Coke.
Coke Zero is a better choice than Diet Coke in every single circumstance. Coca-Cola, you’ve got a responsibility to us – fix your advertising and branding and GET RID OF DIET COKE! Let Coke Zero take off and fly!
And while you’re at it, get rid of Cherry Coke, Caffeine Free Coke with Lime and Splenda but without added Vitamins, and all those other stupid variations. There are only two drinks worthy of the name “Coke” – Coca-Cola and Coke Zero.