Half a croissant, on a plate, with a sign in front of it saying '50c'
h a l f b a k e r y
I like this idea, only I think it should be run by the government.

idea: add, search, annotate, link, view, overview, recent, by name, random

meta: news, help, about, links, report a problem

account: browse anonymously, or get an account and write.




Opposite of "abstract" method qualifier
(+2, -2)
  [vote for,

In object-oriented programming, I sometimes wish there was a way of saying, "I intend this method to be an implementation of my superclass's method (be it abstract or not). I didn't make this up."

- In the absence of "specific", mistyping the name of a non-abstract superclass method that you intend to override is an error that leaves you with perfectly valid code (which is never invoked). Introducing "specific" means that the compiler can find these typos.
- A human reader knows that these functions are there as part of interfacing with the surrounding object framework.

Higher langauge complexity, clutter, more stuff that doesn't really do much in a procedural sense.

- if method names were prefixed with the name of the lowest inherited subclass they belong to (separated by something like . or :), you'd get even more documentation out of it.
- [PeterSealy] Symbol Completion in source code editors helps prevent such typos.

I'm not sure the advantages outweigh the disadvantages; I just wonder where there's an OO language out there that has addressed this, and how it played out in practice.

jutta, Dec 08 2000

(?) Aspect-oriented programming http://www.parc.xer...m/csl/projects/aop/
Not quite the right thing, but would this help? [rmutt, Dec 08 2000]


       Hm. Aspect-oriented programming would help in the sense that it reduces the need for inheritance as an interface mechanism; is that what you mean, rmutt?
jutta, Dec 09 2000


back: main index

business  computer  culture  fashion  food  halfbakery  home  other  product  public  science  sport  vehicle