Breaking news: Tcl considered lacking in some areas
One of them is how, with Ruby (or any OO language), you can easily do lazy computation, simply using methods on objects. Nothing earth-shattering here (move along, please), but since Tcl does not have objects I find myself passing around arrays as a poor-man’s version of objects. But that requires that I calculate all values up-front, instead of only as needed. An obvious performance loss, not to mention a nuisance because you have to worry more about any overhead you are adding.
(There are ways around this, such as having attributes actually be procedure calls, so you say [$item(url)] instead of $item(url), but that has other drawbacks, including not working naturally with the templating system I am using.)
Also, now that I have gotten used to developing in Ruby, I keep bumping into instances where Ruby has simple constructs that saves me several lines of code. A classic example, that I cannot believe Tcl does not have: Array#collect. When you want to process each element of a list (such as adding quotes around them before using them in an IN clause in a SQL statement), you have to write 5 lines of code for what in Ruby is just types.collect { |e| ”’#{e}’” }.join(”, “).
There are many more and far deeper differences going on, but these are the ones I happened to be experiencing tonight, as I am sitting here ate De Balie, developing this CMS for Greenpeace.
About Calvin Correli
I've spent the last 17 years learning, growing, healing, and discovering who I truly am, so that I'm now living every day aligned with my life's purpose.
1 comment
Leave a comment