> In our case, it should have been the string "display" but called display instead, and by sheer coincidence the word display in any Ruby object is a valid caller.
Wow, that sounds incredibly dangerous... how do you even test for not introducing a bug like that somewhere? I am not so familiar with Ruby, is there a linter or something that can catch these?
It sounds similar to a phenomenon I've seen in Python. You can overwrite the builtins using Python. There's very rarely a good reason to do so, but people often clobber variables like 'type', 'max', 'min' accidentally. I know at least some atom and vim plugins exist to warn you about this.
Perhaps the root of issue here is with the tooling or language, but If I were them I wouldn't feel in control of my own code. And that should be terryfing.
This is 90% HAML syntax, and not even very good HAML; the first line (`.col-md-8`) is even worse because of Bootstrap. The only real Ruby is on Line 4. I don't even know what Line 5 is trying to do.
Don't let this poor example turn you off from Ruby, its syntax is amazing. One of my biggest struggles with using other languages is just how ugly the syntax is, even in the best case.
Like others have said, that's mostly HAML. HAML syntax is actually succinct and nice once you know what the codes mean.
Basics of it: indentation nests html elements. each line is basically an element or a control structure. = is run this ruby code and display it. - is run this ruby code but don't display it. a period with something after it is shorthand for create a div with that as a class. the fact that it creates nicely formatted html that is automatically closed for you is a bonus. the #{} part is string interpolation that comes from ruby and those items inside that are just ruby objects with functions/attributes on them.
Give ruby a chance and you will likely fall in love with the syntax.
It would be easier to read the post if it was in regular English. I have no idea what is being said by the following sequences of characters, that may be words, such as "Meh", "Schweet", and "Mmmmk".
The conclusion of the story is anti-climactic, since from the problem statement itself, it was clear an object was trying to print itself. Then the given line showed the issue exactly, but the author didn't know about "display" in Ruby.
If he used the variable name "Mmmmmk" instead, rather than "display", it would have been more clear.
"meh" means "I don't really care". "Schweet" is a way of "cool", in this case sarcastically (notice that when spoken aloud it sounds like "sweet" which is a slang term for cool). "mmmk" means "ok" but in a disinterested fashion.
I'm curious what is your native language where people don't use colloquial terms and only speak "regular"?
Thanks. I did look up "meh" on duckduckgo, and saw something about an "impulse buy" (meh.com), then wondered what is added by using these neologisms. Now I see that the third result for each of these words is from urbandictionary.com, and those definitions comport exactly with yours.
Every written human language has a vernacular versus a written form, typically with a cline between them. English is the closest in correspondence between the two, among the languages I know, but the difference remains.
I do read English every day, but it is much slower for me when people use neologisms that don't have germanic, greek, or roman antecedents, as most English words do. I don't mind learning new vocabulary, especially when it is more precise or apt, as is often the case in math, philosophy, art, or in technical works.
The neologisms this author chose to use are interjections, and I still don't see what power was added to his prose by their use. I suppose they act as shibboleths, signalling his class identity in some way. The entries on urbandictionary.com do give a clue: the origins appear to be "Bill Cosby", "The Simpsons" and "South Park". The OP likes comedy and cartoons? Or marijuana? It's common to hear people talking about getting stoned and watching "The Simpsons" or "South Park" all day. And, that may partially explain his inability to debug his code.
Wow, that sounds incredibly dangerous... how do you even test for not introducing a bug like that somewhere? I am not so familiar with Ruby, is there a linter or something that can catch these?