Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Do you use interface as a tagging system for the code, or you have a better way to remember which object does what?

how do you keep in mind a complex system, after the use of the abstraction.

share|improve this question

closed as not constructive by Oded, gnat, ChrisF May 15 '12 at 16:38

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

Can you give an example what you mean by tagging with interface or remember which object does what? I know the serializable interface in java and c# that does not have any method in it but is used to tell the serializer that this class can beserialized. java (@AttributeClassName) and c# [AttributeClassName] also have attributes. – k3b May 15 '12 at 14:34
serializeable is the best example. other examples are based on other empty interfaces that you "implement" just for the sake of saying, yea, this object is. – Display Name May 16 '12 at 12:35
up vote 8 down vote accepted
  • an intuitive package structure
  • carefully chosen names
  • a comment describing the object's role at the beginning of the class
  • a small document describing the "big picture"

Every mind has its limits, we cannot keep in mind large amount of complexities. I would even say that our job, as programmers, is to maintain complexity under control, and there is no silver bullet for this.

The cleaner, intuitive, simpler the system is structured, the easier it is to find one's way through. This is achieved by simplifying things where it can be, by decoupling things, by choosing the right abstractions, the right tools, etc.

share|improve this answer
This.VoteLevel++; Seriously though I try to insist on, at least, this when I work on some kind of code. Good design and documentation save bad code every time & bad design and documentation kills good code every time - IMHO – Jamie Taylor May 15 '12 at 12:28
+1 for "choosing the right abstractions" – henginy May 15 '12 at 12:47

I only use interfaces as tags where it is idiomatic in the language/existing source. That practice is uncommon.

As for keeping a complex system in mind after abstraction... Well that's the point of abstraction isn't it? If the system is well designed/abstracted, you don't need to keep the entire thing in mind; just the part you're working on. Good names help, because then you can read cthe code rather than remember what that bad name really means. Good types help, since they have obvious purposes.

Consistency is vital. Then you don't need to remember details about the code since all of the code follows the same style and practices. It is easier to read, and you don't have to read a lot of code to work on the one part of the system because it is easy to infer what the rest of the code does (and how it does it) when the code is consistent.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.