• Question: Tell me something about the following principles: DRY, SOLID, YAGNI, optimistic vs. pessimistic locking, MVC vs. MVVM etc. What are they and how do they work?

    Asked by n3rdy to Angela, Gopal, Hannah, Becky, Vince on 25 Jun 2013.
    • Photo: Vince Hall

      Vince Hall answered on 25 Jun 2013:

      DRY: Don’t Repeat Yourself: So in software development try to minimise repetition of code. For example, in C++ you don’t need to keep defining something to do, put it in a function. Don’t keep defining an animal that is a mammal with 4 legs, a tail and meows, just call it a CAT – define a CAT class.

      SOLID: Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion. Five basic principles of object-oriented programming and design. The principles when applied together intend to make it more likely that a programmer will create a system that is easy to maintain and extend over time.
      I confess: I used wikipedia.

      YAGNI: You Aren’t Gonna Need It:
      Only put in things that are needed, don’t just overload a program with stuff that you think is useful. It might be too much, wait until someone asks for it.

      Well, that’s a start.