Hacker News new | past | comments | ask | show | jobs | submit login

> "and lord help you if your boss all of the sudden says you need all of it to go into DailyReport, and you need a new YearlyReport class with overloaded behavior for FiscalYear, CalendarYear, and NarnianYear."

Oh man I've had to do this once or twice. The best approach I've found is to use macro's (This was in SAS language these are kind of like C++ Templates if you are familiar with those) I ended up writing a generic "aggregation macro" that took two datetimes and an 'interval' argument and rolled up each variable between the supplied time range at 'interval' frequency.

Of course it doesn't help when you inherit someone else's code. In that case you are stuck with possibly grueling job of refactoring or you have to hack in a bodge ie. a hardcoded exception and like you said most managers just want it "done" so you end up with duct taped together crap that is a pain to maintain.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: