rc3.org

Strong opinions, weakly held

Month: June 2005 (page 7 of 7)

The end of the honeymoon

As I’ve mentioned here before, I am a huge fan of the Spring Framework, a big chunk of Java code that makes it easier to build applications. Spring’s main feature is enabling you to manage dependencies among components in your application using something called dependency injection. It also provides an MVC framework for building web apps (and interfaces to make it easier to use lots of other common frameworks). Anyway, until this week, my relationship with Spring has been nothing but good. Then I ran into an obscure problem that’s turning out to be a bear to fix (or work around).

In some ways, Spring is a little bit like Ruby on Rails, in that it makes some assumptions about how things ought to work so that the developer doesn’t have to deal with those issues explicitly. For example, Spring turns Hibernate’s checked exceptions into runtime exceptions. (The Hibernate developers agreed, and made the change themselves in Hibernate 3.0.) Anyway, to make a long story short, Spring is too smart for its own good when binding values from an HTTP request to a Java bean. If the property of the bean is a string array, and the incoming parameter is a single value, then Spring helpfully treats the incoming string as a comma-delimited list.

So, if you have a list of values come in (as if from a checkbox group), like “red” and “blue,” the resulting array has those two values in it. If two values like “Boston, MA,” and “Providence, RI” are submitted, then they are copied into the array as is. But if one value is submitted, “Tempe, AZ,” then Spring turns it into an array of two values, “Tempe” and “AZ.” The problem is that I can’t turn it off, even though I’ve been trying to figure out how all week. I’ve posted on the boards, read the code, stepped through it with a debugger, and still, no dice. The honeymoon is over.

Playing by different rules

Richard Dawkins has a good op-ed explaining how creationists use science against itself. In life, the thing I find most discouraging is the tendency of people to use the openness and honesty of others to their own political or personal advantage. I don’t read any weblogs written by people who take this approach in debate. If you can’t engage honestly, I’m not interested.

Time to start shorting domain names

I remember about 10 years ago, when I was about to leave a job, that I wanted a new long term email address. I settled on a mailbox at well.com. Back then, having a well.com address meant that you were at least somewhat cool. That’s how I saw it anyway. Shortly thereafter, I registered rc3.org, because it’s short and because rc3.com was taken, and moved all my email to that domain. And I thought that making sure your mail got delivered to a prestige domain was a dead idea — that nearly everyone would just have their own domain name down the road. The explosion of weblogs confirmed that for me — who would want their weblog to be in a directory off of a domain name they didn’t own, or even under someone else’s domain name with your own host name.

Anyway, I think that the need for everyone to have their own domain name never really arrived, and that indeed, things are moving in the opposite direction. I have no problem telling people my address at gmail.com, and if I were starting a weblog today, having it reside under typepad.com or blogs.com would be perfectly fine with me. There are plenty of high traffic web sites that live at blogspot.com and livejournal.com.

I think that the improvement of search engines plays a big part here. I could easily tell someone “just Google me” rather than go to “rc3.org” and it would be just as easy to find me. Anyway, I think that the ownership of your own domain name is just not the big deal it once perhaps was. That said, I’ll keep mine.

Influences

In writing up the book thing yesterday, the toughest question was about which books mean a lot to me. I kept trying to think of a book that I could point to that led to my being so interested in computers. There wasn’t any book that did it, though. Rather, it was computers themselves. I remember the computers we had in school, mostly really old TRS-80s like this Model III. I was not only obsessed with using computers, I was obsessed with misusing computers. Our lab of TRS-80s was on a primitive LAN, and the main goal of my friends and I was to gain unauthorized access to something. We were never very successful, mainly because our methods were primitive.

If there is one thing that fueled my obsession with computers, it was the movie Wargames, which I was completely obsessed with. It was after watching that movie that I became obsessed with having a modem and my own phone line (my parents never let me have either) and calling BBSes. I had to satisfy myself with customizing BBS software (cnet for Commodore 64, which was the thing back in the day) in case I ever did get to run my own BBS. Anyway, I look back on that time and realize that having a career centered around Web applications was almost inevitable.

Preventing identity theft

Bank of America’s new idea for preventing identity theft, presenting you with a photo that you provided every time they request your password, seems really smart to me. Needless to say, they’ll have to protect the photos to insure that they can’t be abused, but this idea seems fundamentally sound.

My life in books

At John’s request, I’ll play along with the book meme that’s floating around.

Total number of books I’ve owned: I have no way of accurately estimating how many books I’ve owned. Right now we may have 300 books in the apartment, but we are pretty zealous about getting rid of anything we’re not sure we’ll read again in the future. No hoarding.

Last book I bought: PHP 5 Objects, Patterns, and Practice by Matt Zandstra. Someone recommended it when I asked them about PHP books. Prior to that, Weber’s Real Grilling, by Jamie Purviance and Tim Turner. This was an impulse purchase, which I can now say is the best book on grilling ever, mainly because it confirms everything I already believed about how to grill a steak.

Last book I read: I’m in the middle of Hibernate in Action, by Christian Bauer and Gavin King. Great book if you use Hibernate. Frankly, I really regret that I’ve been reading so many computer books lately.

Last book I finished: Head First Design Patterns, by Elisabeth Freeman, Eric Freeman, Bert Bates, and Kathy Sierra. As mentioned previously, I really liked this book. I prefer a good novel or interesting nonfiction book anytime.

Five books that mean a lot to me:

  • Manufacturing Consent, by Noam Chomsky and Edward S. Herman. I’m not sure of the degree to which I’d agree with this book today, but at the time I found it very powerful, in an “everything you know is wrong” sense. I doubt most people who slam this book or Chomsky’s thinking have even read it.
  • Galapagos, by Kurt Vonnegut. I read this book at one of the lowest points in my life. Reading about a world in which humans had, after destroying the civilization that they had known, devolved into slightly sentient marine mammals was just the tonic I needed. It was the first Vonnegut book I had ever read, and I read it because my roommate had purchased it as required reading for a class at one time. A combination of being broke and lazy had led me to just read whatever happened to be laying around the house.
  • The Book of Three, by Lloyd Alexander. Probably the first fantasy book I read as a kid. (Either that or The Lion, the Witch, and the Wardrobe, by C. S. Lewis.) I still remember the Chronicles of Pyrdain fondly.
  • Siddhartha, by Hermann Hesse. I can think. I can wait. I can do without.
  • Teach Yourself Netscape 4 Web Publishing in a Week. I wouldn’t recommend anyone actually buy this book, but it was the first one with my name on the cover (I revised an old edition of someone else’s book).

Five people I’d like to see to do this as well: Stan, Scott, Fred, Andrew, and Eliot.

Update: I’ll add two more people to the list above, Jessamyn (who already reviews the books she reads) and Rebecca.

Rationalizing LAMP

Daniel Sabbah, the general manager of IBM’s Rational division, ticked some people off this week when he said that companies that LAMP tools are “primitive” and that companies that rely on them will have to grow up at some point. Ryan Tomayko blasts the hell out of him, and makes a lot of good points about the state of the art when it comes to building Web applications these days.

I think that the truth lies somewhere in the middle. I think that Sabbah misses his mark when he says that scalability is the issue with LAMP, mainly because people think of scalability in terms of handling many users at once. Where they generally do fall down is scalability in terms of remaining comprehensible when the application gets big and complex.

It’s not impossible to write big, complex applications in PHP, or Perl (or Python, I assume), but they don’t do much in terms of helping you get there. At my job, I work with PHP and Java. When I work with Java, I utilize a number of frameworks that enable me to write a clean, layered application that makes it easy to unit test everything (even Web components) in an automated fashion and reuse my code easily. I use an IDE (Eclipse) that lets me easily navigate and refactor my growing code base very efficiently. Java provides WAR files which enable me to easily package my applications so that all of the libraries that they depend on are included in the application itself, so I don’t run into versioning problems down the road. (I find this to be a huge problem in the Perl and PHP worlds, where libraries are centralized at the OS level in usual practice.)

None of these problems are insurmountable. I am learning more and more about writing layered applications in PHP, and I’ve also implemented a unit testing regime. I know that you can keep all your PEAR modules at the application level if you want to. The truth is, though, that when you do those sorts of things you cut against the grain of the language and customs of the PHP world.

The latest problem I’m running into is figuring out how to deal with transaction isoaltion in PHP. In the world of Java frameworks, much work has gone into making it possible not only to easily deal with database transactions, but to move the level of abstraction up one tier and isolate transactions that may span several databases or systems. Granted, few people need this functionality, but if you do need it, LAMP is probably not going to suit your needs. This, I feel, is what Sabbah was talking about. He just didn’t put it very well.

Newer posts

© 2025 rc3.org

Theme by Anders NorenUp ↑