3 ms·
magic is just a shorthand for "code executed automatically, behind the scenes, based on some reasonable assumptions". Rails does a whole lot of this type of mag
by metaphorm 14y ago
magic is just a shorthand for "code executed automatically, behind the scenes, based on some reasonable assumptions". Rails does a whole lot of this type of magic, as does basically every framework.
- bithive123 14y agoThen it's a meaningless term. The fact that iTunes doesn't need to ship with drivers for my sound card is the same kind of "magic".
- adamors 14y agoIt is meaningless and I have a growing suspicion that it was coined by people who came from writing (PHP) websites from scratch. I remember being pleasantly surprised when I wrote my first website with a framework after a couple of years building sites from practically nothing. Compared to frameworkless PHP, Rails is magic but then so is Django or ASP.NET MVC.
- metaphorm 14y agothis isn't a good analogy. Rails is a software development framework whose users are programmers. iTunes is a media player whose users are non-technical. in other words Rails is a tool while iTunes is a finished product. you wouldn't compare a hammer with a cabinet, would you? if zero-framework development is a hammer, then development with a framework is a power-tool combination drill/hammer/driver. the power-tool does so much more then the basic tool that it feels "magical". its not a meaningless term then. its a description of the power of the tool.
- batiste 14y agoI thought the magic term had something to do with explicit vs implicit. Some framework just don't call that much code behind your back without explicitly calling stuff. Rails is more oriented in a "convention over configuration" mindset, in this sense it might be more "magic" than others.
- deleted 14y ago[deleted]
- hackinthebochs 14y ago"Magic" code is code that gives little or no indication that it's being executed in the contexts that are affected. Think of this as the "locality" of code. Do the names and operations being referenced in the current context completely describe the functionality that is being executed? Then the code has high locality. Magic code is code with low locality.
- hackinthebochs 14y ago"Magic" code is code that gives little or no indication that it's being executed in the contexts that are affected. Think of this as the "locality" of code. Do the names and operations being referenced in the current context completely describe the functionality that is being executed? Then the code has high locality. Magic code is code with low locality.