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

The DRY example is better though. The payload is an object. When you have multiple objects of the same shape you have a class of objects. Menu items could be loaded from a JSON source. Separation of concerns and duplication is removed from the code.


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

Search: