Strong opinions, weakly held

Tag: Ruby (page 2 of 2)

Programmers should study a little economics

So the big news on Twitter among Ruby programmers is that the “hashrocket” operator has been deprecated. For those of you who aren’t Ruby programmers, here’s what that means. If you want to declare a hash literal in Ruby, right now you can do it like this:

my_hash = { :foo => "1", :bar => "2" }

Also, many methods accept hash literals as an argument, so you can do things like this:

url_for :controller => 'posts', :action => 'index'

At some point, that notation will be unsupported, and hash literals will have to declared in a different way.

When the version of Ruby is released that doesn’t support this notation, it will be incompatible with a massive amount of Ruby code. My advice to the Ruby developers would be not to do it. I don’t know what the rationale is for removing it, but the result is going to be lots and lots of servers that are simply never upgraded to that version of Ruby.

They should take a lesson from the PHP people. The migration from PHP 4 to PHP 5 has taken forever as a result of much smaller incompatibilities than this one.

Economics tells us that we have to be careful about the incentives that result from our actions. Removing the hashrocket operator creates a strong incentive to leave the Ruby upgrade path.

Update: Sometimes rumors on Twitter are just rumors on Twitter. I don’t see any mention of deprecating the => operator in the Ruby Subversion repository.

Links from January 25th

Links from January 24th

Rails and Rack and Metal

I make pessimistic pronouncements about Ruby and suddenly interesting things turn up.

What’s Ruby’s future?

I’ve had a blog post about Ruby sort of simmering on the back burner, but I haven’t written it because I don’t really feel qualified enough to substantiate the case that I wanted to make. As so often happens, somebody else has beaten me to the punch and written something much like I had in mind.

In this case, it’s KirinDave, who explains his suspicion that Ruby is a soft of dead end. There’s a funny thing about programming languages. They’re some of the only pieces of software that really seem to eventually be finished. Perl has seemed finished for a long time. I suspect that Python may be finished. C has been finished forever. Ruby, at times, seems over but not finished, if you get my meaning.

On the other hand, I find programming in Ruby enjoyable and educational, so it’s not like I’m looking to give up. It’s just that even after a couple of years of doing it, I still feel like we’re dating rather than married.

Ruby Gems as an attack vector

Tim Bray warns of the dangers of Ruby Gems as an attack vector. The risk is that basically anyone can create a Gem and make it available using the gem installer.

I’ll say that this is why real systems administrators detest the various packaging schemes that scripting languages offer. It’s generally a much better practice to manage libraries through the operating system’s centralized packaging system — Red Hat’s RPM, FreeBSD Ports, Debian/Ubuntu’s APT, and so forth. Administrators who want to go beyond the vendor-approved repositories for packages are free to do so, but packages from the vendor list can be installed with relative confidence.

Who knows what to expect from packages from CPAN, PEAR, RubyForge, and the like? (This also ties into my longer argument about why developers are the natural enemy of the systems administrator, but I’ll get into that some other time.)

Whitespace sensitivity

Armin Ronacher points out that in some aspects, Ruby is more sensitive to white space than Python. (Via Simon Willison.) What I can say with confidence is that I am more sensitive to white space than Python or Ruby, and I’ll also add that civilized developers adapt to the conventions of the language that they’re using. I guess what I’m saying is that arguments against Python or Ruby based on how they handle white space are fundamentally weak. In the end, they all seem to boil down to, “It doesn’t look enough like C for me to be comfortable.”

_why has a better hobby than me

_why the Lucky Stiff is working to compile Ruby into Python bytecode so he can run it using Google Application Engine. I’m just linking to this because it’s so damn cool.

Newer posts

© 2023 rc3.org

Theme by Anders NorenUp ↑