Skip to content

Latest commit

 

History

History
15 lines (14 loc) · 2.18 KB

File metadata and controls

15 lines (14 loc) · 2.18 KB

Questions about Code Design

  • It is often heard that one of the most important goals in Object-Oriented Design (and code design in general) is to have High Cohesion and Loose Coupling. What does it mean? Why is it that important and how is it achieved?
  • Why does array index start with '0' in most of languages? [A]
  • How do tests and TDD influence code design? [A]
  • Write a snippet of code violating the Don't Repeat Yourself (DRY) principle. Then, explain why is it a bad design, and fix it.
  • What's the difference between cohesion and coupling? [A]
  • What is refactoring useful for? [A]
  • Are comments in code useful? Some say they should be avoided as much as possible, and hopefully made unnecessary. Do you agree? [A]
  • What is the difference between design and architecture? [A]
  • Why in TDD are tests written before code? [A]
  • C++ supports multiple inheritance, and Java allows a class to implement multiple interfaces. What impact does using these facilities have on orthogonality? Is there a difference in impact between using multiple inheritance and multiple interfaces? Is there a difference between using delegation and using inheritance? [This question is from The Pragmatic Programmer, by Andrew Hunt and David Thomas]
  • Pros and cons of holding domain logic in Stored Procedures. [A]
  • In your opinion, why have Object-Oriented Design dominated the market for so many years?
  • What would you do to understand if your code has a bad design?