· · Ruby
Cloud Lifesaving and Fear
· Last year I built (and of course blogged) this nifty little Android app called LifeSaver, which would copy your telephone-call and SMS logs onto an SD card, so you could move the SD card to another phone, run LifeSaver again, and get ’em all back. Calls and texts aren’t migrated by the excellent Android backup system ... [26 comments]
Late Summer Tech Tab Sweep
· Some of these puppies have been keeping a browser tab open since April. No theme; ranging on the geekiness scale from extreme to mostly-sociology ... [2 comments]
· The conference was in an Embassy Suites right there by San Fran airport, thus for the first time in years I found myself in The Valley but without a car; felt weird. As usual, a bracing blend of geek love and mind food, plus this time with musical and athletic side-trips ... [3 comments]
Upcoming Gig — Scottish Ruby
· Next March, I’ll visit Edinburgh (for the first time!) to keynote the Scottish Ruby Conference, along with the excellent Jim Weirich. Interestingly, this is the former Scotland On Rails; they’ve decided to broaden their spectrum. [2 comments]
島根 September — Canal Farewell
· I suppose that’s about enough words & pictures from around Shimane prefecture. Here are a few farewell shots from the Matsue city canal-boat tour ...
島根 September — Ruby Road Trip
· Our story thus far: a gaggle of gaijin are invited to hold forth at RubyWorld 2009 in a little-noticed corner of Japan. The conference was on Monday and Tuesday; Wednesday they took us on a scenic Shimane tour. Matz and Ko1 and Prof. Takeuchi came along, and I got pictures so you can too ... [2 comments]
島根 September — RubyWorld
· The reason I went to Japan was to attend RubyWorld 2009, a conference centering around the Ruby programming language. The reason the conference was in this rather remote corner of Japan is that Matsumoto Yukihiro (known to geeks as “Matz”), the inventor of Ruby, chooses to live and work in Matsue, and the city and prefecture governments are trying to use his presence as leverage in diversifying the local economy into Open-Source software. While the conference was reasonably well-covered in the Japanese media, I’ve seen nothing in English, so I’ll try to rectify that here. With pictures ... [2 comments]
· Possibly you’ve never heard of it. But if you know anyone who knits or crochets, ask him or (more likely) her about Ravelry and chances are you’re talking to an active member. It’s big. This is an interview with Casey Forbes, who constitutes the whole engineering staff ... [6 comments]
· Who knows how many more chances I’ll have to talk about Sun tech that I like? In the five years I’ve been here I’ve been pleased by OpenSolaris and Fishworks and HotSpot and GlassFish and others, but NetBeans is #1 in my heart. I just downloaded 6.7 RC3 a couple of days ago to try to fix a problem (it didn’t, but the problem was amusing) and it’s really good stuff. Generally nice, and with one absolutely life-changing new feature ... [6 comments]
· This is saddening stuff. At a recent Ruby conference (that I’m not going to name because it wasn’t their fault), a speaker (whom I’m not going to name for reasons of taste) had porn-flavored slides in his presentation; people were offended and said so. Some in the Rails community, including its leader, pushed back hard, in a way that offended many more people. If you haven’t been following the story, I think Martin Fowler’s SmutOnRails has a good aggregation of links, and also I agree with most of his commentary. I’m going to add two observations, one link, and some recommendations ... [16 comments]
Minimal Rack + JRuby + GlassFish Recipe
· I’ve been working on a little piece of Ruby-and-Rack-based Web integration goo, and it’s done enough that we have to figure out deployment. One reason I picked Rack is that it’s advertised as deploying on anything. The environment where this will live has some of this and some of that, and we’re using GlassFish to tie it all together, which seems like an appropriate choice. So, the problem is: How to plug a simple Rack application into GlassFish? ... [2 comments]
· I’m referring not to an instrument of torture, nor industrial furniture for computers, but to the increasingly popular Rack Web server interface. I’ve found, first, that the explanations of what it does aren’t that great, and second, that it’s ideal for my current at-work project. I bet it’d be useful for lots of others too, so here’s my shot at an introduction ... [16 comments]
· Being a brief code fragment that makes me happy ... [5 comments]
· I’ve been using RSpec in a way that’s probably inappropriate, but has got me thinking about Test-Driven Development and REST ... [13 comments]
· Maybe I’m just being paranoid here, but I’m starting to get a little worried that RubyGems could be a nasty attack vector, given certain combinations of malice and stupidity ... [19 comments]
Tab Sweep — Technology
· I’d kind of gotten out of the habit of doing tab sweeps, largely because my Twitter feed is such a seductive place to drop interesting links. But as of now there are around 30 tabs open on my browser, each representing something I thought was important enough to think about and maybe write about. Some are over a month old. Some of them have been well-covered elsewhere. All I assert is that after I read each one of these, I didn’t want to hit command-W to make that window go away. Unifying theme? Surely you jest ... [1 comment]
RX and 1.9 and Pain
· This fragment is mostly a note to myself and placeholder and might prove useful to someone slashing through the XML undergrowth with bleeding-edge Ruby. Briefly: I revived my “RX” Ruby tokenizer (see here, here, and here) to contribute to Antonio Cangiano’s proposed Ruby benchmark suite, which I think is a Really Good Idea. I had a bit of pain getting the code to run on both Ruby 1.8 and 1.9, and then when I tried sanity-checking the output by comparing it to REXML on 1.9, REXML blew chunks. There are, apparently, issues about REXML and 1.9. Read on for details in the unlikely event that you care about any of this ... [3 comments]
· This really isn’t the place to come for Ruby news. But that’s OK, because I have the pointers to where you should go. Plus, one of the news stories is making me think “Smells like Erlang.” ... [4 comments]
· I see the JRubyists have shipped JRuby 1.1. I increasingly think JRuby is interesting and important as a test case, even if you don’t happen to care in the slightest about Ruby or Rails ... [7 comments]
Ruby News: Honey Pie
· I’ve been building up bits & pieces of Ruby news for weeks and weeks, so this is a pretty sizable bright-red glob ... [2 comments]
· I was doing a general Tech Tab Sweep and I noticed that I had a ton of Ruby-related stuff, so it gets its own fragment ... [2 comments]
The Ruby News
· I keep putting off this Ruby News Survey piece because there keeps being more news, but hey, you have to pull the trigger sometime ... [1 comment]
Now That’s a Patch
· I refer to Sam Ruby’s massive patch to make REXML work properly with the latest Ruby. I’ve long disliked REXML (see here and here), but it’s here and it works. Only the way it works changed in 1.9, and there were some horrible regressions, and it gets patched very slowly. (I’m actually wondering why Ruby needs to have a weird regex-based parser when Expat is plenty good enough for Perl and Python, and in fact if you look at
xmlparser.rb, you can switch parsers, just as Nick Sieger has done for JRuby with JREXML. But I digress.) In the short term, we need to see if the REXML maintainers are responsive to Sam’s patch. [1 comment]
Year-End Sweep — Tech
· Over the course of the year, in browser tabs, bookmarks, and del.icio.us, I’ve built up a huge list of things that I felt I should write about, at least at the time I saw them. Well, dammit, I’m not gonna let 2007 end without at least making a try. Here goes. Categorized, even ... [7 comments]
Ruby Performance Snapshot
· What happened was, I got a note from Matt (who runs the ongoing server), saying my traffic had suddenly jumped (to like 230G/month) and wondering why. I had no idea, so I whipped up a little Ruby script to break down traffic by resource and host and time-of-day and so on. Then I wondered which version of Ruby would run it fastest? ... [1 comment]
· I started out nervous with the idea of adding closures to Java, and I think I’ve slid firmly into the “contra” camp. One reason is that it seems increasingly a bad idea to add anything to the Java language. On a related subject, my brief sojourn in Ruby-land has changed my thinking about closures entirely ... [19 comments]
· Check out Antonio Cangiano’s The Great Ruby Shootout, which addresses the vexed question of Ruby performance, takes names and hands out numbers. Damn interesting numbers, too, if not terribly surprising. You want surprising? Engine Yard, which already employs Rubinius Guy Evan Phoenix, has just hired Ryan Davis and Eric Hodel to work on Rubinius. Holy crap. That makes four Ruby-implementor teams with multiple people grinding away at the problem full time. This is what they call good news. Meanwhile, the Mac corner of the Ruby World is glowing with scarlet Ruby love.
Ruby Survey Results
· Highlights: 1,000 responders, of which 470 Rails and 530 Ruby; TextMate is the most popular tool globally, but the Vi family is slightly preferred on the Ruby side. Thanks, everyone, for pitching in! ...
Ruby Tool Survey
· At Sun, I’m in the Developer Tools group. Someone asked “Which tools does the Ruby gang use, anyhow?” I said “Hmm, TextMate, Emacs, Vi, recently some Eclipse and NetBeans.” They said “How do you know?” I said “Uh.” They said “Why don’t you ask?” So I did. Here’s the write-up, in another fragment, which is more commenter-friendly I think. [15 comments]
· Way back in 2004, when we had the first Java/DynLangs summit, one of the DynLangs guys’ gripes was that bytecodes were too hard to generate. They still are; but check out Charles Nutter’s Bytecode Tools in Ruby: A Low-level DSL; is it just me, or is that remarkable? I have tended to be a bit less impressed than your average Ruby fanboy at a bunch of method calls sans parentheses claiming to be a “DSL”. But man, that looks slick.
· I enjoyed attending RubyConf immensely, but I also regretted it. Not all is well in my personal favorite open-source community. (This article is full of complaints; for my love-letter on the same subject see here.) [Ouch, check the comments. My position on weekends is, um, not universally held.] ... [16 comments]
· I was at RubyConf ten days ago and just now catching up, been overloaded. This was my second RubyConf and, like last time, I came away inspired. This is an illustrated fan letter; but there are problems in the community and at the conference; I’ve written about them separately ... [2 comments]
The Plot Thickens
· Ah, I see the RubyForgers have the new server on the air. That 4200 should do quite a bit better than the very basic Xeon it’s replacing, particularly since they were maxed out on I/O ...
Tab Sweep — Tech
· There were a few here that I wanted to do a whole piece about, but I just gotta clear some space on these decks. Today we have pushing and pulling and queueing and Ruby.next and Java hate and PHP-vs.-Rails. What’s not to like? ... [9 comments]
· Now, this would be a red-letter day. I was chasing a weird Ape bug, and I found the problem:
atomURI#absolutize was returning a URI not a string (and by the way, why doesn’t URI offer String methods like
=~!?! But I digress.) Anyhow, I moaned, thinking “Crap, that’s used everywhere, what am I gonna break?” What I needed was “Find Usages”... Hah! I’d recently grabbed a new NetBeans 6 pre-release (the 070810 build of M10) and Tor’s been doing some heavy chest-beating recently. Here goes with the right-click ... [9 comments]
Tab Sweep — Tech
· August is supposed to be the slow time of year. Not! Is there ever a lot of interesting stuff out there. Today we have WS-funnies, OOXML Purdah, Web names, Internet Registry structures, and Ruby metaprogramming craziness ... [8 comments]
· And is there ever a lot of it. I was going to break this into a handful of targeted snippets, but anyone who cares about the language would read ’em all anyhow. Thus, an illustrated tour through Tokyo conferences, JRuby 1.0, Refactoring, and M17n ... [3 comments]
JRuby IRC Koan
· On the
#jruby IRC channel, a well-known JRuby committer was heard to utter the following: this is the instance of place which harbors the method we are invoking which may not really be self at point it is calling. And it was in the middle of the day, too. [3 comments]
· Here’s the nice one: PragDave a.k.a. Dave Thomas launched an effort to get the RailsConf attendees to give something back; something as in hard cold cash donations to charity. I plugged it during my keynote, as did several others, and Chad Fowler really got behind it. It came out pretty well. And on a lighter note, Big Jimmy Kane offers cogent insight on my appearance waving a Sun banner in Rubyland.
RailsConf Day Two
· The first hour and fifteen of the day was Cyndi Mitchell of ThoughtWorks and me in keynote mode. The interesting part, though, was the hallways and lunch ... [15 comments]
RailsConf Day One
· [Thursday] Sitting in the airport getting ready to head out; it’s been a while since I’ve spoken to over a thousand people (well, I do every day here, but that’s different) so I’m nervous. Happy, too; I’ve managed to schedule my Sun-related work so I can get to a few sessions that sound super-interesting; I expect to get my brain upgraded. [Friday] I’m filling in conference notes and pictures as the days go by ... [3 comments]
Ruby Servlet Dispatching
· I’m wiring the Ape up so I can run it with JRuby in a servlet in a real Java App Server, and while Marcin Mielżyński’s first-cut RubyServlet works fine, I suspect it’s not the only approach to dispatching. So I’m doing some research and thinking, and I’ve collected it here for anyone who cares ... [4 comments]
· Ruby-related stories going across my radar keep making me say “ooh, that looks hot.” ... [4 comments]
· I got the Ape running on JRuby and wired Jing back in, which is really useful (some of the so-called Service Docs out there are canine fecal matter). I was pretty damn impressed when the now-2400+ lines of Ape code totally just worked in JRuby. Then, I was irritated by the realization that my primitive CGI setup for running the Ape is just not gonna fly if I have to start up a JVM and JRuby for each request. So I thought “this is what servlets are for, right?” and the good news is that It Can Be Done ... [3 comments]
Another Blow to Emacs
· I’ve been watching Tor Norbye grinding away on NetBeans 6, and couldn’t wait any more, so I went and downloaded a daily build, and it seems to kinda work. Up till now, all my Ruby work has been in Emacs, but the NB6 pre-pre-alpha trumps it ... [15 comments]
· As usual, there isn’t a unifying theme. In this issue: lumpiness, stuff, microformats, eye candy, metaprogramming, beards, and psychology ... [1 comment]
· What happened was, I got an email from a Japanese colleague asking if I could come to an all-day meeting at the Sun EBC with the Open Source Software Society Shimane. I wrote back saying “Huh?” and he wrote back explaining that Shimane is a prefecture in Japan and that the delegation would include Yukihiro Matsumoto, also known as “Matz”, the designer of Ruby, who lives there, and that I’d been asked for. I wrote back saying “OK”, and now I want to go and visit Matsue, the capital city of Shimane, an hour’s flight from Tokyo ... [4 comments]
· In this month’s JRuby news, Ryan Tomayko goes all visionary, Charles Nutter ponders InvokeDynamic, and Nick Sieger’s a committer. I partially disagree with Ryan’s point #3. My impression has been that the average Java package is at least as well-maintained as in any other language you care to name, and better than some (but he’s right, of course, that the maintenance activity needs start manifesting quickly via your local apt or yum or whatever). Also, Ryan recommends Ruby when “where readability and maintainability are more important than performance and reuse”. Uh, isn’t readability a really important factory in re-usability? Which means that Charles should be (and probably is) worrying about calling Ruby code from Java, not just the other way. Anyhow, JRuby’s a hotter and hotter area. I watch the JRuby developer newslist, which I don’t recommend unless you’re an enthusiast; on a good day Ola Bini alone can saturate the average inbox. [1 comment]
· A couple of months ago, Rubyist world headquarters over in Japan was looking around for something to run their new Subversion server on. We dug a box out of a closet and sent it along, and now it looks like it’s up. Jeepers, that’s a fully loaded X4100, it ought to be able to handle the next couple of thousand Ruby committers assuming they only code eighteen hours a day or so, and with hot-swappable everything, so next time you type
svn co ruby, it’ll probably work. [2 comments]
RX + YARV
· I’m in about round eight of my duel with Ruby, trying to make a correct automaton-based parser run as fast as a regexp-based one that has a casual attitude toward the rules. (Our story thus far here and here.) I thought I’d try out YARV, the heir-apparent Ruby VM. [Update: Hah! Improved RX a little more.] ... [8 comments]
· Thanks to the commenters on the previous RX piece who recommended
ruby-prof (there’s a gem install), which is a much faster and thus better profiler than the built-in one. I learned a few more things ... [6 comments]
An RX for Ruby Performance
· This is an insanely long and gnarly essay about implementing, then optimizing, the low-level bits of a pure-Ruby XML parser. If you obsess about XML reading, deterministic finite automata, or Ruby code optimization, you may find some part of it interesting. There may perhaps be six people in the world who care about all three; others are warned that an attempt to read this end to end may lead to general paralysis and perhaps even clinical brain-death. [He’s not kidding. -Ed.] By way of compensation, I’ve tried to be offensive wherever the opportunity presented. [Update: Outstanding comment from Avi Bryant below, which he repeats and expands here.] ... [18 comments]
Unicode and Ruby
· I gave a presentation called I18n, M17n, Unicode, And All That at the recent 2006 RubyConf in Denver. This piece doesn’t duplicate this presentation; it outlines the problem, some conference conversation, and includes a couple of images that you might want to steal and use in a future Unicode presentation. For those who don’t know, “i18n” is short for “internationalization” (i-18 letters-n), “m17n” for “multilingualization”, and you can call me “T1m” ... [24 comments]
· I spent Friday through Sunday at RubyConf in Denver; a small, friendly, educational gathering. The Ruby community is nice, and I’ve already praised the technology enough; but the future is a bit opaque ... [10 comments]
Ruby String Walking
· In preparation for my presentation next weekend at RubyConf, I’ve been poking around at Ruby’s string-handling. One thing that text-wranglers such as me like to do is walk through a string a character at a time, and Ruby doesn’t make this particularly easy. I ended up implementing
String#each_char_utf8 three times along the way. [Update: Lots of interesting feedback, and a worth-reading ruby-talk thread.] ... [8 comments]
Red Rock Magic
· If you, like me, know basic Ruby and are perhaps ready for some more advanced topics, Ola Bini’s Ruby Metaprogramming techniques may be just the ticket. The first tip, about singleton classes, is kind of scary and it’s a technique I haven’t fully internalized, but the voodoo level decreases fast and there are a few tricks that I can use right now. I’m already using
method_missing, any language that doesn’ t have that just seems crippled.
Making Markup Correctly
· I’ve encountered three different Ruby libraries for generating markup: there’s one in the CGI library, there’s Builder, and there’s Markaby. To some degree, all are heavily informed by the special case of generating HTML; and maybe they’re OK for that. But if you want to go further and generate XML, they’re all pointing in the same, wrong, direction. Maybe I’m missing something, but I do have an alternative to offer. Plus, I find a chance to laugh at myself gleefully. [Update: Ouch! Refuted!] [Update: And again, more seriously.] ...
· Charles Nutter and Thomas Enebo, better known as “The JRuby Guys”, are joining Sun this month. Yes, I helped make this happen, and for once, you’re going to be getting the Sun PR party line, because I wrote most of it. [Update: It strikes me that thank-yous are in order. Given that Sun is in the process of (appropriately) slashing some of its engineering groups, new hires are a little tricky. A lot of people helped, but I think the biggest contributions were from our Software CTO Bob Brewin and especially Rich Green, who approved the reqs about fifteen seconds after Bob and I raised the issue.] ...
The Ruby Ape Diaries
· I took tons of notes while I was working on the Ape. I was going to hold off publishing till I released the code, but once I actually launched the formal Sun process to do that, I discovered that it can take two or three weeks, and so I decided to go ahead while it was fresh in my mind. Unfortunately, the piece pretty soon had fifteen different sections and would have been too long for mere mortals with jobs to read, and furthermore, the sections didn’t have much to do with each other, and there just aren’t that many people on earth who’d be interested in all of them. Some of them look close at the issues of making Java and Ruby get along, while others wallow in duck-typing perversity and finer points of Ruby style. So I’ll keep them short and do one a day (or so) for the next week (or so) and fill a table of contents in here.
I. Why JRuby?
II. Back to Ruby
III. Quack Like a URI
V. << !!
VI. Java APIs from JRuby
VIII. Surface Phenomena
IX. Those Libraries
X. Making Markup
XI. Where To?
RAD XI: Where To?
· [RAD stands for Ruby Ape Diaries, of which this is part XI.] I think this concludes the Diaries, although ongoing already has a couple of five-part trilogies. The Ape works reasonably well and is getting quite a bit of use; Sam Ruby has convinced me that, rather than whittle away at the to-do list, I ought to figure out a way to build a large catalog of problems and edge cases, test-suite style, in such a way that you can add new ones without writing code. I haven’t yet figured out how to do it. My Ruby is still not fully idiomatic but it’s better than pidgin, and there’s a real possibility that the next time I get my back to a wall and need to do something to a few million lines of text right now, I may not use Perl. It should be reasonably obvious that I like Ruby. Still, there are flies in the ointment, worms in the apple, fake jewels in the shop window ...
RAD X: Making Markup
· [RAD stands for Ruby Ape Diaries, of which this is part X.] If you’re writing Web apps, and even if you’re one of the few who isn’t, you’re probably going to have write code to generate markup, HTML or XML. Historically, programmers have found this difficult, and thus there are lots of libraries that try to abstract markup away behind code (for example, my own Genx). There are tricky issues and trade-offs here, and Ruby throws them into pretty sharp focus ...
Spolsky Starts a Language War
· In Joel Spolsky’s new Language Wars, he argues that .NET, Java, PHP, and maybe Python are the safe choices if you’re going to build out a Web app that’s really big and really critical. He ices this cake with a shovelful of classic FUD aimed at Ruby and Rails. Not surprisingly, David Heinemeier Hansson volleys back twice with Fear, Uncertain, and Doubt by Joel Spolsky and Was Joel’s Wasabi a joke? Bruce Tate has a more thoughtful response over at InfoQ: From Java to Ruby: Risk. You may not agree with all of Bruce’s points, but they’re well argued. It may surprise some who’ve endured the flood of Ruby-red writing around here recently, but I think Joel’s correct that Python is quite a bit better proven than Ruby; and also that Ruby has a big Unicode problem. But I can’t get around the fact that Joel sounds exactly like a mainframe droid talking about Personal Computers, or a VMS droid talking about Unix, or an EDI droid talking about the Web, or a C++ droid talking about Java. Yeah, the new thing is kinda unproven and kinda shaky in places and kinda slow and not very full-featured. But it’s got ease-of-use advantages and programmer-productivity advantages and developers like to use it. See the Technology Predictor Success Matrix, and particularly the last three criteria: Happy Programmers, Technical Elegance, and especially the 80/20 Point. Joel’s probably wrong.
RAD IX: Those Libraries
· [RAD stands for Ruby Ape Diaries, of which this is part IX.] Ruby’s debugging facilities, compared to what IDE users like me are used to, are, well... sincere. At one point during the Ape work, I had a bug that was really driving me crazy. The symptom was that my HTTP interaction with the server would just freeze up, and I couldn’t spot the pattern behind it. It’s a fact of protocol-testing life that this particular kind of shit happens. Sometimes you’re reduced to debugging with print statements, and I was. But after a while they weren’t helping me, I was calling
Net::HTTP#start on an apparently-valid connection and then... nothing. Eventually, I was driven to looking in the library source,
net/http.rb. Hey, it was easy to understand! (Have I talked about Ruby and readability before?) I could see where my request was going, but I couldn’t see how it could go wrong. Well, this is a dev machine, and Real Men debug with
print statements. So in they went... right into the Ruby distro libraries, I mean. And I ran it again. Only took a couple of minutes to zero in the problem; in this case, a JRuby bug. I’m not sure what the lesson is... but the code spelunking was frighteningly easy. This is not typical of other peoples’ HTTP libraries; I have bitter memories of bashing my head to a bloody pulp against LWP back in the last millennium. Did I mention readability? [Ed. Note: You’ll be happy to hear that there are only a couple more RAD entries in the pipeline, then I’ll be done.]
RAD VIII: Surface Phenomena
· [RAD stands for Ruby Ape Diaries, of which this is part VIII.] Programming is supposed to be an engineering discipline, or maybe a branch of mathematics. But, as Don Box memorably said: “the only people who should do it are those who can't not do it”, calling us “those few people who absolutely must live in the world of executable abstractions”. One consequence is that we’re passionate about the content and the form. Herewith some remarks on appearances; the way Ruby code looks and how you store it and so on; issues as important, perhaps, as any other ...
RAD VII: J?REXML
· [RAD stands for Ruby Ape Diaries, of which this is part VII.] In native Ruby, the default way to do XML processing is via the REXML library. In JRuby, you have another default choice—Java’s built-in XML APIs. Neither option is that great. Still, there are some reasonably safe ways to get the job done. I wrote some glue code called JREXML to make the Java APIs look more like REXML, which forced me to think about this stuff perhaps more than is entirely healthy ...
RAD VI: Java APIs from JRuby
· [RAD stands for Ruby Ape Diaries, of which this is part VI.] The reason I first built the Ape in JRuby was so I could get at all those nice Java APIs, and that turned out to be a good reason. Of course, there is a bit of impedence mismach, and I ended up writing some glue code. I kind of suspect that, should JRuby catch on, there’s going to be scope for quite a bit of this glue-ware. This fragment is just a few examples of the genre, to provide examples and perhaps provoke thought ...
RAD V: << !!
· [RAD stands for Ruby Ape Diaries, of which this is part V.] If you look at Ruby code, you keep seeing this little two-character motif
<<, and maybe everyone else already knew about this, but it sure feels like magic to this farm boy from the Prairies. Bonus: Lisp speculation ...
RAD IV: TMTOWTDI
· [RAD stands for Ruby Ape Diaries, of which this is part IV.] That glob of letters in the title stands for “There’s More Than One Way To Do It”, and it comes from Perl culture. It is a distinguishing feature of Perl that if there’s something you need to do, not only does Perl have a way to do it, it has lots of different ways. Perl’s legion of evangelists, led by Larry Wall, argue that this is an advantage. Larry has a compelling argument by parallel with linguistics; natural languages usually have many ways of saying anything that’s worth saying. Not everyone agrees that this is a virtue; in particular, Pythonistas have historically grumbled. Ruby seems to fall into the Perl camp. And now, dear readers, I must confess to a bit of duplicity. When I wrote RAD III: Quack Like a URI, I knew that my example was perhaps not the purest possible example of duck typing, but my hidden agenda, namely gathering material for a TMTOWTDI essay, worked out well ...
RAD III: Quack Like a URI
· [RAD stands for Ruby Ape Diaries, of which this is part III.] This little illustration of a programming idiom is solely designed to horrify newcomers from the Java world, and will look mundane to existing Rubyists. Problem: I want to check a URI to make sure it’s appropriate for use in the Atom Protocol, and if not, report a coherent error message ...
RAD I: Why JRuby?
· [RAD stands for Ruby Ape Diaries, of which this is part I.] To build a validator you need an HTTP engine and an XML parser, both of which Ruby is advertised as having. JRuby, when I first took this on, was as at release 0.9.0 and had plenty of rough edges. But I decided to use it anyhow ...
· I have previously admired the Ruby language, albeit from a distance, and been impressed by the vigor of the Rails community. In the last week I have written a few hundred lines of Ruby code that actually do something useful and I’ll probably release (come see it at OSCON); so now I’m somewhat better educated ...
Upcoming Gig: RubyConf
· Hey, RubyConf accepted my paper proposal, I18n, M17n, Unicode, and all that. So it looks like I’ll be in Denver October 20-22. See you there!
Rubies and Pearls
· I’m still feeling my way into this comments system, but my first days with Ruby are making me think back a dozen years or more, to when I was learning Perl. It was a big data-filtering job and Michael Leventhal had pulled together a very typical Perl bundle-of-regexps and suddenly one day I was pitching in on handling more types of input data and pulling out more structure. Larry Wall, the author of Perl, is a linguist by training, and is proud of the fact that with Perl, as with a natural language, you don’t have to be an expert to be effective Just as a child derives value from using English even if inexpertly, a novice Perl programmer starts being rewarded quickly. Other languages have this characteristic to a greater or lesser degree; and I’m beginning to think Ruby is right up there. (For me, Java had it too, as it would I think for any expert C programmer comfy with O-O thinking.) At the moment, there are lots of Ruby idioms that are still gibberish to me; but I find two crucial things: my pidgin Ruby is already pretty useful for getting things done, and I’m learning new tricks.
Comments on Camping
· Last month I said I’d make a comment system for ongoing, and I got lots of good advice. Several of the people who wrote suggested I consider Camping, so I decided to give that a try, and started today ...
By Tim Bray.
I am an employee
of Amazon.com, but
the opinions expressed here
are my own, and no other party
necessarily agrees with them.
A full disclosure of my
professional interests is
on the author page.