Aaron N. Tubbs bio photo

Aaron N. Tubbs

Dragon chaser.

Twitter Facebook Google+ LinkedIn Github
  • Even when one is being paid, “please remove me from your list” wars still happen on distribution lists.
  • McDonald’s is considering outsourcing drive-thrus. I think this is pure genius, and for that matter can’t comprehend why the entire restaurant isn’t yet automated by robots controlled from India as well.
  • People search for some weird stuff, like “apache2 gran turismo 4” or ‘starbucks and “roasting profile”’ as well as more mundane things like “gran turismo 4 transformer more money from GT3 cheat code.” First, to address that last point, money is not a problem in GT4. With 100,000 credits and 8 minutes in b-spec mode, all anybody has to do is b-spec the silver arrow race, get the CLK race car, b-spec the german professional race, and pocket a cool million credits. b-spec makes cheating unnecessary, as credits are superfluous. For the Starbucks roasting profile, just set your roaster to “char” and pull the beans out just before they turn to powdered charcoal.
  • Ruby doesn’t support increment/decrement operators. With all of the rest of these programming usability features, I’m left going “why not?” The only explanation I can find referenced on google doesn’t exist anymore. Bother. That said, thinking a bit about the way everything is an object (more on this in a bit), I realized that i++ would be expanded to i = i + 1, which could potentially require some object-incurred inefficiency. Who knows.
  • Continuing in that trend, the distinction between !, ^^, and || and not, and, and or is “most curious.”
  • Ok, now I’m just stealing from the above, but zero is considered truth in ruby, and only false and nil are considered untrue.
  • Ruby has native arbitrary precision integer support built right in by default. Classy!
  • Ruby supports closures!
  • Ruby’s iterators such as each and collect seem to make it a much more functional language than I expected. Map, grep, inject, all of that stuff is therefore trivial to accomplish. I miss functional languages, it seems that Ruby bring some of the best features out into a more “useful” language.
  • Ruby supports parallel assignment — another one of those stupid space-saving programming tricks that make a whole bunch of declarations so much cleaner.
  • Ruby is weird:
irb(main):016:0] a = "b"
=> "b"
irb(main):017:0] b = a
=> "b"
irb(main):018:0] a
=> "b"
irb(main):019:0] b
=> "b"
irb(main):020:0] a[0] = "5"
=> "5"
irb(main):021:0] a
=> "5"
irb(main):022:0] b
=> "5"
irb(main):023:0] a = "bunny"
=> "bunny"
irb(main):024:0] b
=> "5"

So, I understand the idea that when I modify a, b should change, since variables for native types are just object references. Command 23 doesn’t make any sense to me at first, but then I realized that assigning a to a new object (by feeding in “bunny”) means that it is no longer pointing to the original object. Ergo, assignment to a variable for a native type is not an overwriting operation, but a replacement, and therefore b is pointing to the original variable a’s object. I think the reason why this is difficult for me to grasp at first is that while I’ve developed in object-oriented paradigms before, I’ve not spent much time with languages where everything is a first-class object. I’m more comfortable at the moment thinking of things are variables, references, and pointers, rather than just remembering everything is a pointer.

I expect in a few days I’ll be coming back and saying “never mind, this is all very intuitive and straightforward, and I don’t know what I was thinking.” Once I’ve had that many hits on the Ruby crack pipe, you can come by and tap me on the shoulder and tell me it’s time to go home.