Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Honest question, what do you expect OO to solve for you?

Things like

  - Maintainability
  - Extendibility
  - Testability
  - Reusability
etc

One problem with OO is that you can organize your code in many different OO styles and somewhat depending what you try to achieve you should pick a style matching that.

Personally I think your example is not separated enough,

  - Client configuration
  - Url construction
  - Reading data from API
  - Saving data
In the first example everything is mixed up in one class, it is like having a huge main function. I would probably have three different classes to solve that.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: