Skip to content

Comment on Why Ruby is not my favorite language

Comments

I had a great question in a job interview yesterday: "What do you like least about your least favorite programming language?". I picked Ruby as my least favorite, as there's not many languages out there that undermine themselves so totally (I may not want to program in basic, but it does what it says on the tin). Here's my answer:

  Matz's decision-making process
    He tries to make Ruby be all things to all people
      Lots of confusing sugar and overloading baked in
    I much prefer Guido's hard pragmatism
  
  The panoply of function types: Methods, Blocks, Procs, Lambdas
    All intertwined and yielding into one another.
    I love that in Python there is only one:
      Objects with a __call__ method, defined metacircularly.
  
  The culture of adding/overloading methods on base classes
    Many gems do this en masse, and there are a lot of low-quality gems
    Especially disastrous because it's unscoped, and infects the whole process
      For a language with four scoping sigils it sure screws up scope a lot
  
  The Matz Ruby Implementation
    The opposite of turtles-all-the-way-down (Smalltalk crushed beneath Perl)
    It punishes you for taking advantage of Ruby's strengths
    The standard library is written almost entirely in C
      It doesn't use Ruby message dispatch to call other C code.
      That means that if you overload a built-in, other built-ins won't use it
    Anything fiddly that's not written in C will be dog slow

I had a great question in a job interview yesterday

For what it's worth, this has recently become a 'standard' interview question for developers. I predict that people will start game it by having a canned response, thereby rendering it virtually useless---just like all other standard interview questions.

"For what it's worth, this has recently become a 'standard' interview question for developers."

I used to ask interviewees to discuss what they didn't like about their favorite language. If they had a hard time finding stuff to criticize, there was a good chance they didn't really know the language. or were not particularly critical developers.

Right, that's why it was initially useful. Now that lots of people use the question, though, even mediocre developers will make sure to come to the interview with a list of criticisms of their favorite language.

"... even mediocre developers will make sure to come to the interview with a list of criticisms of their favorite language."

Which is fine if, when pressed, they can back up what they say. The question (like most good interview questions) is largely an excuse to help guide a conversation and some exploration to avoid canned responses.

Hilariously, I had already written an answer to the preceding question: "What do you like least about your favorite programming language?" for an email to someone else just a day earlier.

Granted it's still a terrific question -- expository about the applicant, and easy to banter about to detect bullshit / plagiarism.

s/start game it/start to game it

Argh. I hate catching typos in my own comments.

I just realized what the true inverse of turtles all the way down is:

"You're in the desert, you see a tortoise lying on its back, struggling, and you're not helping -- why is that?"

The fucker stole my hat.

A tortoise? What's that?

"... A tortoise? What's that? ..."

'Do you make up these questions? Or do they write 'em down for you?' ~ http://www.imdb.com/title/tt0083658/quotes

You know what a turtle is?

Of course!

I'm Mario. That bitch stole my ho.

That's a trashy, misleading question to ask, designed to make the interviewee look like a fool. If I don't like a programming language, I don't learn it (unless I have to). For this reason, somebody's reasons for disliking a particular language are likely to be riddled with inaccuracies unless they're into reading up heavily on languages they don't use.

How can you get to dislike a programming language without learning it first, at least well enough to have things you don't like about it? If your reasons for not liking it are "riddled with inaccuracies", then maybe what you don't like about it isn't that language but something else that you have mistaken for that language?

I usually like to ask: how would you change your favorite language?

You must be able to criticize what you love to be a good programmer.

Now that's a quality question that demands critical thinking.

This is at a company where they listed 11 (!!) fantasy languages in the job description. They want candidates to be the type of people who do projects in novel languages just because, that can reason about programming language design issues, that have well-founded reasons for not liking things.

Yes, it would bait idiots who "don't like C because you can only define variables at the top of a function", or "don't like Java because you have to put classes in different files" -- but that's intentional.

"11 fantasy languages"

As in 11 not-real languages. Languages that don't exist?

I'm not sure I follow.

As in 11 academic languages that you would get paid to use in your fantasies (the company advertising the job doesn't use most of them, they just want coworkers that like them too).

oh no, all this time I have been putting many classes in one file. I guess I should have compiled more often.

Curious. What's your opinion of Perl?

The fundamental difference is that Perl doesn't think itself beautiful. There's plenty to hate specific to Perl: sigils for types, noisy syntax (not even the #$@%, just the structure is ugly), nested lists always being flattened silently (as a design choice, Larry is crazy).

I never end up using Perl, the niche it occupies between shell and python is empty for me. I never have a problem with a shell script where I'm wishing for more control structures or builtins. The few times I've written long-running resource-intensive shell scripts (like brute-forcing an MBR partition scheme), reducing the number of forks wouldn't make them more than a few percent faster.

The major ray of light shining down on Ruby is that it is a Perl that people want strongly to write better looking code in. That's a pretty big accomplishment, I think. It seems like a lot of the classic Perl webdev shops are moving to Ruby, and I think that's pretty great.

I don't hate Ruby, I'm just disappointed in it.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.