Caching in Seaside vs. Rails
This one will be short as I stopped programming momentarily to write this.
One more reason (of many) I enjoy developing with Seaside vs. Rails is that caching is much easier and is "built-in" in a Smalltalk environment. This difference is primarily from the way Rails is structured. When a request comes in to Rails, the Dispatcher initializes new instances of your controller which then pulls in models from the DB, which also get instantiated in memory, and when the request is over this is all thrown away to start over again in the next request/response cycle. Because of the image-based nature of Smalltalk, your model instances are always there in memory. This can change depending on your persistence strategy, but for the simple cases you usually arrange to have them in the image at all times. Sometimes they get instantiated at image start-up, other times on-demand (but this is slow, just like Rails!). Incidentally this makes Seaside much faster for the same relative level of optimization work because it skips ActiveRecord's step of instantiating your model objects on-demand. Seaside's rendering times are faster out of the box because your object instances are already there in memory ready to go. Anyway... my point is that I needed some simple caching of a method's results to help a page load a little faster in Seaside. All I did was add a new instance variable to my model instance that lazy-loaded the result of the calculation. I then added a few more places where this "cache" gets invalidated from other method calls, and I'm done. I didn't have to install gems, configure a new server like memcache, read docs on a gem's interface to memcache, etc. I simply leveraged the tools available in Smalltalk, and built a simple thing that just works. I don't have to worry about persisting it as its lazy-loaded. Which really is how memcache is usually used with Rails, as a place to temporarily store the results of an expensive computation. There is nothing stopping one from doing this same thing in Rails, but it doesn't go with-the-grain of the way Rails is built and you are expected to use it. Rails is "opinionated software" after all, and I've worked on many Rails projects where one piece or another has to violate the opinions and work on it becomes painful. For whatever reason solutions in Smalltalk end up much simpler and therefore lend themselves to easy extension and expansion.