h1. What Killed Smalltalk Could Kill Ruby Too Robert Martin h2. Smalltalk Deeply related Ruby is Smalltalk without the image The style of Ruby is similar to Smalltalk - in some sense Ruby is a reincarnation of Smalltalk There was a time when Smalltalk was a language to watch Perhaps the most impressive is the digital ozziloscope (?) h3. Why did Smalltalk pretty suddenly just stop? It's certainly dead by now C++ is a man's language A team could get things running 5 times faster than C++ Smalltalk ruled in a whole bunch of interesting ways, and yet it died - what killed it? Smalltalk was fairly non-hormone. It was more related to caffeine. h3. Ward Cunningham The inventor of things like: * The wiki * Design patterns * CRC cards * XP * Fit Clean code has a metric of 0 WTF's per minute Ward: What killed Smalltalk was it was just too easy to make a mess In C++ you got punished for making a mess, while in Smalltalk you could build mess upon mess h3. The image It was written on top of a database without any source code Java came along and was free h2. Ruby It's easy to make a mess in Ruby too. You might have violated some basic assumption in the framework, and end up chasing a monkey path hell The boy scout rule: Leave camp cleaner than you found it What if everybody did some nice refactoring every time they looked at source code But cleaning code is hard and risky "I've got to clean this up - OMG I'm not touching it!" h3. TDD It is built-in to the Rails framework People are trying to create testing frameworks and making it easy to test The Ruby community is growing very rapidly, and the disciplines might not be growing with it The rules of TDD: 1. You are not allowed to write a line of production code until you have written a failing unit test 2. You are not allowed to write more of a unit than is sufficient to fail 3. You are not allowed to write more production than is sufficient to make the test pass If you follow these rules you will write 1000s of tests each year. If you have a batch of tests that can be run at a touch of a button, how afraid are to clean up that mess that scared you off? The tests eliminate fear - it allow you to change the code Nothing makes a system more flexible than a suite of tests If you have a suite of tests, you will not be afraid of changing the system I really like RSpec and Cucumber TDD is what will your code clean. Code is never clean, code is cleanable. What is clean today, may not be clean tomorrow. h2. Arrogance The Smalltalk did have a powerful language, and they knew they could work miracles Yet that wasn't enough They were set aside, the rest of the industry said: They don't seem to like us very much, I don't think we like them You guys just go ahead with your Smalltalk, but I'm the one who get real work done The Smalltalk guys found ways to live isolated in a technological bubble h2. Final word: Professionalism Definition: "The disciplined wielding of power" Yes, this is a powerful tool, but powerful tools kill very quickly Let us redefine progress to mean: That just because we can do a thing, doesn't mean we should do a thing h2. What might save Ruby and Rails from that same demise? Not anywhere near going down that road. The community is more dynamic and larger. Three things might save it: * Disciplin - specifically in TDD * Professionalism of humility * Acceptance of solving the dirty problems Imagine that you are having an out-of-body experience - you are watching to doctor - how do you want him to behave?