In Praise of the Unpowerful
The title of today’s sermon: “In Praise of the Unpowerful”
I’m always amazed at how long it takes and how error-prone the process of creating a data-driven website is when the database schema is so conceptually simple, the business rules are simple, you can come up with a database-model in an hour and a complete site map and access rules in another hour, but then to actually create it, debug it, test it, etc. etc.. it takes months for really smart people to execute it to completion. What is up with that? Why is it so much more difficult than making a sign at, say, FastSigns? I can understand if it takes a day or two, but months . . . . ?
We love giving up power, but we’re in denial of that fact. Look how many constraints RoR imposes upon the structure of Ruby programs when you make a website, and how people in the Rails community get so excited they start drooling all over themselves about that. Look at REST, and how they’re loving those additional constraints as well. Look how we gave up more power, by making the default database SQLite instead of MySQL in Rails 2.0. HTML, the king of the unpowerful, is a huge huge success. (Think how many pages of HTML have been written or generated.)
I’m not sure what the best interface is going to be to manipulate directly model abstractions like UML – whether we’re using graphical IDEs or writing DSL scripts to generate code – but I just like the idea of language creation as a general problem solving approach. . . . I have a feeling this direction hasn’t been explored enough. . . . . especially of course in the direction of less powerful languages. I’m thinking that there should some really easy way to create DSLs in general. Like we need software that supports the creation of DSLs. . . . .Maybe that’s Ruby, but maybe it’s more than that.
Lately, I’ve been kind of intrigued by the notion of the Principle of Least Power in programming languages.
I think our tools are simply WAY TOO POWERFUL for our own good. Even Rails is way too fine-grained for most peoples’ good. Yes, I understand that people need to write Othello games in Javascript sometimes and connect to funky-ass payment gateways with their custom APIs. But there is a huge class of websites that are doing the same shizzle over and over again.
I like the idea of thinking about languages in terms of subsets of power. Give the least powerful subsets to the dumbest people with the least experience to do the easiest tasks, and the most powerful supersets to the smartest people with the most experience to execute the hardest tasks – but don’t make the learning curve humungous for the dumb people – cuz that defeats the purpose. (I don’t mean that they’re stupid actually, they’re just lacking knowledge and experience like me. Just a rhetorical device . . . . to illustrate a point.) For example, PHP is way too powerful for most professional programmers with 2-3 years of experience. Have you ever seen maintainable PHP code? I have once, and it was autogenerated. Same goes for Rails. . . . . It’s way too easy even with the directory structure they made for you to write unmaintainable code. TOO MUCH FREEDOM.
Rails is my current favorite framework, and I still enjoy it a lot. But, there should be a really dumb easy way to make a website that requires no knowledge, no configuration, no fancy complicated command lines. It should just be one line of code or one line of code that takes an input file for the schema, and an input file for the permissions. . . . okay and one more for the interface (I know that sounds like MVC, but I’m thining of something much higher level than Ruby or Erb). I shouldn’t have to be configuring observers and turning on and off switches, configuring mongrel clusters, looking at log files, and debugging my deploy.rb file. Making a simple RoR programming is like sitting in the cockpit of a 747 with 5,000,000 switches staring at you in the face.
On the other hand, I like scaffold generators in Rails. They are essentially creating a high-level declarative language with a command line interface and I think that’s great, but still it’s way too complicated. I should not have to read several thousand page textbooks to deal with the aftermath of having typed that command. Hmm . . . . . maybe I just need to get more involved with Rails code generators.
Sorry, I didn’t mean to rant. . . . . it’s 3 a.m. here . . . . . :)
Posted by David Beckwith on Sunday, February 03, 2008