
The Search For Class:0x00000027b59290 - robin_reala
https://chrisarcand.com/the-search-for-class0x0000001ab51700/
======
kbaker
> 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?

~~~
wyldfire
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.

------
tener
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.

------
csense

        .col-md-8
           #{@record.name} / #{@record.description}
           - binding.pry
           = check_box_tag(display, true, @record.display, :disabled => true)
           = _('Display in Catalog')
    

Ruby syntax is terrifying. There is so much going on here I can't even begin
to figure out what this code is supposed to do.

~~~
psadauskas
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.

~~~
pauldino
Line 5 looks like it's for i18n. To save on typing and reduce clutter
typically "_" is used as an alias for the gettext function.

~~~
psadauskas
Ah, that makes sense. Thanks.

------
haikuginger
Why is the slug "the-search-for-class0x0000001ab51700"? This is mildly
upsetting to me.

~~~
chrisarcand
To see if anyone would notice ;)

------
kevinherron
#DynamicLanguageProblems

------
artursapek
What a meaningless existence

------
balnaphone
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.

~~~
JadeNB
> I have no idea what is being said by the following sequences of characters,
> that may be words, such as "Meh", "Schweet", and "Mmmmk".

This is a lie.

~~~
balnaphone
Enlighten me, please.

In my native language, meh = girl/daughter, schweet = dessert, mmmk = closest
meaning would be "thinking", like "hmmm" in English.

~~~
anchpop
"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"?

~~~
balnaphone
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.

Thanks again.

