3 ms·
eschew "my IDE will write it" in favor of more powerful abstractions But he specifically said that this breaks down when you need to pierce the abstraction and
by HeyLaughingBoy 17y ago
eschew "my IDE will write it" in favor of more powerful abstractions
But he specifically said that this breaks down when you need to pierce the abstraction and he's right. You can often accomplish the same thing by doing the "non-abstracted" code in a lower level language and linking to it, but that's not always convenient or safe.
I'm of two minds on this topic. I like the "smarts" of a good IDE that hides stuff that I don't care about. But at the same time, I'm afraid that if it breaks (bug in the IDE or library), I don't have the ability to find the broken part and fix it or work around the problem. This was exactly how I felt when I started playing with WCF.
- callahad 17y agoIf you have to pierce abstraction by stripping away the IDE, you've got an issue with the design of the language. Take python: I don't have to write getters and setters, but if I need to tinker around "inside" one, I simply write a function and decorate it with @property. But that code is only present if I need to create an exception to the general case, rather than having everything, including the common cases, present in source and hidden by the IDE. Edit: Check out Project Lombok (http://projectlombok.org/ http://projectlombok.org/), which tries to address some of these issues for Java (including the exceptional case, rather than hiding the general case). We discussed it a two months ago at http://news.ycombinator.com/item?id=738958 http://news.ycombinator.com/item?id=738958
- jrockway 17y agoPython is not even the best example here, in Common Lisp and Perl (and probably lots of other languages) provide even better abstractions. If you want to modify the behavior of one accessor, you can modify it with method modifiers. If you want to create a new class of accessor-generation behavior, you can write a new metaclass that works exactly the way you want. (And of course, you can write your own "defclass" macro that always uses your own metaclass, if you desire.) In Perl, we can even compose meta-roles into metaclasses; meaning that even tiny changes can be made easily reusable. This is generally preferable to editing code in an IDE.
- adw 17y agoYou can do the __metaclass__ thing in Python too. We'll find you and tut at you if you do, but you can do it.