Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Hour reports!

Name: Anonymous 2008-07-07 8:48

So, how do I program an hour-report program?!

Name: Anonymous 2008-07-08 1:13

>>6
Your implementation does not respect ENTERPRISE best practices.
1) You must use template programming to instantiate various OPTIMIZED functions with different sleep time, generated at compile-time. Otherwise your hard-coded value may force programmers to edit your code by hand or copy+paste which is terrible for maintainability.
2) "3600" and "1" should never be used by themselves since we don't know what they represent. Use "const int seconds_per_hour = 3600" and "const int one = 1".
3) What if report returns an exception? Needs a try/catch.
4) Where are the objects? Procedural programming is unreusable and ultimately destructive.
5) Your function may not execute report every 3600 seconds. Consider the case where report() takes 4 seconds to execute, then the loop will report() every 3604 seconds. You should consider using multithreading so that sleep and report may execute at the same time.

Overall I give this a 2/10. I would not hire you in my company.

Name: Anonymous 2008-07-08 12:47

>>8
Speaks the truth!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List