[OCP 11 Complete Study Guide] [OCP 11 Programmer I Book] [OCP 11 Programmer II Book] [OCP 11 Practice Tests Book] [OCA 8 Book] [OCP 8 Book] [OCP 8 Practice Tests Book] [Blog]
ASCII silly question, Get a silly ANSI.
Don Morgan, Founder
www.DeveloperAdvantage.com - FREE Audiobooks for Software Developers
ASCII silly question, Get a silly ANSI.
Don Morgan, Founder
www.DeveloperAdvantage.com - FREE Audiobooks for Software Developers
[OCP 11 Complete Study Guide] [OCP 11 Programmer I Book] [OCP 11 Programmer II Book] [OCP 11 Practice Tests Book] [OCA 8 Book] [OCP 8 Book] [OCP 8 Practice Tests Book] [Blog]
Don Morgan, Founder
www.DeveloperAdvantage.com - FREE Audiobooks for Software Developers
I think it is possible. If the code is going to be run rarely, then the performance aspects of doing some built-in Calendar logic over subtracting a magic number are going to be so small as to be negligible. So I would use the Calendar logic there. But if it is going to be run often enough to matter, then the number of times the "magic number" version is wrong will be noticeable twice a year (in some places). So I would use the Calendar logic there too.Originally posted by Don Morgan:
Without knowing the details of what the application is for, it is not possible to establish the winner in the performance vs correctness tradeoff (even vs cost of developer time solving it!)
Originally posted by Paul Clapham:
Or to put it more bluntly, I would use correct logic in preference to faster but incorrect logic in almost all situations.
[OCP 11 Complete Study Guide] [OCP 11 Programmer I Book] [OCP 11 Programmer II Book] [OCP 11 Practice Tests Book] [OCA 8 Book] [OCP 8 Book] [OCP 8 Practice Tests Book] [Blog]
Originally posted by Paul Clapham:
I think it is possible. If the code is going to be run rarely, then the performance aspects of doing some built-in Calendar logic over subtracting a magic number are going to be so small as to be negligible. So I would use the Calendar logic there. But if it is going to be run often enough to matter, then the number of times the "magic number" version is wrong will be noticeable twice a year (in some places). So I would use the Calendar logic there too.
Or to put it more bluntly, I would use correct logic in preference to faster but incorrect logic in almost all situations.
"I'm not back." - Bill Harding, Twister
SCJP6
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |