Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write a bulletproof date validation routine.
#44
Quote:Erm... the code looks functional, but there are still some things that could be improved Wink

#1. I don't like my program to quit when I run your function (d'oh Big Grin)

#2. It can be made much faster if you use integers.

Moneo, Meg, add comments if you wish Smile
Neo,
"... the code looks functional" --- you're being so kind.

About #2 above: Speed is really not an issue, but it is nice to write the speediest code you can, just as a matter of habit.

The same applies to writing tight, straight-line code with as few if's as possible. The more code your program has, and especially the more if's, then the more chances of bugs. Just like our friend DarkNinja's code; his enhanced leap year logic has so many if's, that I don't even want to bother checking it.
*****
Reply


Messages In This Thread
My entry - by Meg - 10-11-2004, 09:03 PM
updated - by Meg - 10-12-2004, 08:01 PM
/nod - by Meg - 10-23-2004, 01:34 AM
Foo - by ToohTooh - 10-26-2004, 10:36 PM
Reply on Clarification Suggestion - by Neo - 10-26-2004, 11:37 PM
Re: Reply on Clarification Suggestion - by oracle - 10-27-2004, 02:00 AM
Hmm... - by ToohTooh - 10-27-2004, 02:12 PM
Re: Hmm... - by Neo - 10-27-2004, 10:12 PM
Thank you. - by ToohTooh - 11-01-2004, 04:54 PM
Write a bulletproof date validation routine. - by Moneo - 11-21-2004, 07:23 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)