- Feature Articles
-
CodeSOD
- Most Recent Articles
- My Identification
- Mr Number
- intint
- Empty Reasoning
- Zero Competence
- One Month
- A Little Extra Padding
- Ready Xor Not
-
Error'd
- Most Recent Articles
- Monkeys
- Killing Time
- Hypersensitive
- Infallabella
- Doubled Daniel
- It Figures
- Three Little Nyms
- Tangled Up In Blue
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
return mr_sednod;
Admin
TRWTF is being more confusing than PHP. Globals have to start with $, but locals don't? What??......
Admin
@moderators Well, the first post was (unregistered) linkspam, and it got through the automatic moderator... Perhaps a bit of manual moderation is in order...
Admin
When I first looked at Ruby ~20 years ago, I joked that it combined object-oriented programming with the readability of Perl.
Admin
I don't know if the
mr
inmr_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.Admin
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.
Admin
Sadly, it almost certainly refers to medical records number.
Admin
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.
Admin
"[...]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"...
Admin
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?
Edit Admin
Mr Number, meet Mr Bangy: https://youtu.be/8MVu2Rs8oF8?t=4122
Edit Admin
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().