• Michael R (unregistered)

    return mr_sednod;

  • (nodebb)

    TRWTF is being more confusing than PHP. Globals have to start with $, but locals don't? What??......

  • (nodebb)

    @moderators Well, the first post was (unregistered) linkspam, and it got through the automatic moderator... Perhaps a bit of manual moderation is in order...

  • (nodebb) in reply to Mr. TA

    When I first looked at Ruby ~20 years ago, I joked that it combined object-oriented programming with the readability of Perl.

  • (nodebb)

    I don't know if the mr in mr_number is supposed to stand for something or if the author is trying to politely address it as "Mr. Number" (perhaps due to another language barrier issue), but I'd like to believe it's the latter.

  • (nodebb) in reply to Mr. TA

    As someone who actually enjoys using Perl, I stopped reading the "Learning Ruby" book when it got to the part that sigils indicate scope. $foo? Global. @foo? class instance. foo? local. My eyes.

  • Tinkle (unregistered) in reply to adamantoise

    Sadly, it almost certainly refers to medical records number.

  • (nodebb) in reply to Dragnslcr

    Ruby [...] combined object-oriented programming with the readability of Perl.

    That is actually a very good description of the raison d'être for Ruby. It was the stated goal of the project to basically be "inspired by Perl".

    Since people still think Perl is a great language today. YMMV. I never really liked Ruby but I started learning it because for a while Rails was the best framework around to do quick CRUD prototypes. Until everybody else started doing the same stuff.

  • Die Kuhe (kein roboter) (unregistered)

    "[...]but it smells like they wanted a global variable[...]" Well, I would believe instead that a "return out" was planned, before someone found out that more than a single "return" is also allowed...

    P.S. Of course "it refers to medical records number"...

  • Officer Johnny Holzkopf (unregistered) in reply to adamantoise

    Judging from the code line "mrn = PatientMrn.find_by_mr_number(mr_number)", it could be possible that "mr" means "medical record", you know, for patients, and "mrn" is "medical record number". However, it's a bit strange to use "n" in one place ("mrn", "PatientMrn"), "number" in another ("mr_number", "find_by_mr_number"), for one and the same subject of thinking (a number). But were they thinking? Hmmm...

    Many years ago, I came across a code snippet that contained a variable called "dr_onoff" (DR on / off), which turned into "Doctor Onoff" - maybe Mister Number and Doctor Onoff work in the same hospital, treating their patients with patience?

  • (nodebb)

    Mr Number, meet Mr Bangy: https://youtu.be/8MVu2Rs8oF8?t=4122

  • (nodebb)

    I've only used Ruby briefly, but it does have one syntax feature that I absolutely love: there can be an ! or ? on the end of a function name, as part of the same. The ! means "this function also edits instance", the ? means "this function returns a bool."

    Meanwhile, over in JavaScript-land, I have to look it up almost every time to find out whether sort() works in-place, or generates a new sorted array. Ruby has sort!() and sort().

Leave a comment on “Mr Number”

Log In or post as a guest

Replying to comment #:

« Return to Article