6 ms·
Every industry has jargon, words which have one meaning in everyday use, but a different meaning within the industry that can be confusing or even hostile to ou
by a4isms 5y ago
Every industry has jargon, words which have one meaning in everyday use, but a different meaning within the industry that can be confusing or even hostile to outsiders. "Magic" is an example of jargon when used within the programming community, and especially within the sub-community devoted to Ruby on Rails.
As an example of jargon, the dictionary definition is irrelevant other than to emphasize that it is jargon. There are applicable broad arguments against jargon in general, of course, but as an example of jargon, it's not any worse than any other jargon term or phrase, such as "It's ____ all the way down."
If we want a definition that we can understand, the correct source is not the dictionary, but this quote from OG sci-fi author Arthur C. Clarke: “Any sufficiently advanced technology is indistinguishable from magic.”
With respect to programming, meta-programming is not indistinguishable from a spell cast by a mage in D&D. A better comparison is to prestidigitation, the entertainment art of doing a thing that appears to be impossible, even though everyone in the audience knows that there is a trick to it that can be explained and understood.
It's really that simple. "Magic" as a term of jargon means "A sufficiently advanced use of Ruby's meta-programming that is indistinguishable from a conjurer's trick to those who don't know the trick."
- triffee 5y agoThe jargon file defines this succinctly, and is a generally fun read for those who haven't seen it. http://www.catb.org/jargon/html/M/magic.html http://www.catb.org/jargon/html/M/magic.html
- klabb3 5y agoMetaphors have value. Is magic a good metaphor? It doesn't imply metaprogramming specifically to me, but it implies that the computer figures something out without seemingly being told how, which gives me quite a bit of information. Otoh, one man's boring code is another man's magic, so it's relative. But so is "performant", "simple" etc. Those are certainly useful terms, but they rely on context. There are worse sins in programming jargon; like when you overuse technical terms so much that you lose the "point" of what it's supposed to do. Another one is using heavily overloaded abstract terms without explaining which variant you're thinking of. If you say "service" without context, I will come after you :)
- a4isms 5y agoI couldn't work it into the my comment, but an example that came to mind is a quote from Dr. Adele Goldberg: "In Smalltalk, everything happens somewhere else." I vividly recall that when I first installed Digitalk's Smalltalk/V, everything seemed to involve spooky action-at-a-distance.
- nixpulvis 5y agoMagic is not jargon. Magic has a special form of non-locality. To look for the cause of "magic" one must either pray to some god or roll the dice and read the tea leaves. If hunting down the source of understanding feels like this, we call it magic. Jargon can be carefully laid out and taught. Common practice can be learned and maintained. Magic is a word invoked to intentionally tell you not to learn and to stop asking questions. It's insulting to the very nature of the programmer, who must ask these questions in order to understand the systems they are trying to describe. As for the quote, which everyone has heard by now: "Any sufficiently advanced technology is indistinguishable from magic." This is a cynic's perspective, which while valuable to a point, does not alone lead to that which we desire. We read this quote and think, ah yes, that is how I feel... I wish things were better.
- samatman 5y agoYou stripped the use/mention distinction from what you were replying to; the result is at most a digression. "Magic" is in fact jargon, contrasting other meanings of the word with jargon itself is irrelevant to that.
- nixpulvis 5y ago'"Magic" is an example of jargon when [...]' This was my primary challenge. Either you accept everything as jargon, or you actually read my reply and consider my perspective. I'm not offering a crisp definition, I'm merely adding some addition flavor which is at odds with the parent's as I understand.
- a4isms 5y agoMy perspective as detailed in the full message is that the sense in which meta-programming in Ruby is magic is more akin metaphorically to prestidigitation than to the supernatural. In that sense, it does not imply "stop asking questions," nor does it imply "there is no answer." To me, it implies, "This may look like a supernatural entity is involved, but that's just a trick we're pulling. If we pull back the curtain, we'll find there's a little man with some levers and we'll see how it's done."