I have a question about organizing projects:
If someone wrote code like this:
class Account ... end class Customer ... end class Displayamajig def display_account(account) ... end def display_customer(customer) ... end ... end class Persistamajig def persist_account(account) ... end def retrieve_account(account_identifier) ... end def persist_customer(customer) ... end def retrieve_customer(customer_identifier) ... end ... end ...
Would you suggest they rewrite things like this?
class Account def display ... end def persist ... end def retrieve(identifier) ... end ... end class Customer def display ... end def persist ... end def retrieve(identifier) ... end ... end
If so, wouldn't it make sense that if you saw an application organized like this:
That you should refactor it into this:
Why? Why not??
Join the discussion on Hacker News.
My recent work:
- jQuery Combinators, what else? A jQuery plugin for writing your own fluent, jQuery-like code.
(Spot a bug or a spelling mistake? This is a Github repo, fork it and send me a pull request!)