|
-
Oct 13th, 2000, 05:36 PM
#1
Thread Starter
Fanatic Member
Hi.
When you all develop apps, do you make sure that your app will perform correctly when the maximum possible values for numbers, text boxes, masked edit boxes, etc. are entered?
Or do you just program for reasonable values entered by the user?
Thanks, in advance, for your feedback.
-
Oct 13th, 2000, 05:50 PM
#2
If you mean declaring a Byte or Integer instead of Long, yes I always do that.
-
Oct 13th, 2000, 06:03 PM
#3
Thread Starter
Fanatic Member
I guess I should be more specific.
For example, on 1 form you let the user enter the price of an item into a masked edit control. On another form, the user enters the quantity that he/she wants of that item.
Now, when testing my app, if I enter the [/b]the maximum numbers[/b] (99999, etc.) as the price and do the same for the quantity of items being purchased, I get a ridiculously large number that may even cause errors in my program because of the amount that variables can hold.
So, my question is, should I even worry about these super-large numbers that will probably never be entered? Or should I code the app in such a way that the user can't enter any values large enough to cause an error.
I hope you get my drift.
-
Oct 13th, 2000, 06:07 PM
#4
Yes, always be prepared for the unexpected (even though the numbers might be ridiculous). My suggestion is for you to go with the Error Handling method. For example, if you are using an Integer, make sure the number is less than 32,767
-
Oct 13th, 2000, 06:10 PM
#5
transcendental analytic
It depends of what i'm doing, mostly i take time for checking correct input but that doesn't go for experimental apps and making temporary developing tools
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 13th, 2000, 06:32 PM
#6
Thread Starter
Fanatic Member
Thanks.
Kedaman and Megatron.
I guess I should program for those "ridiculous numbers." But it will probably help me smile later when I don't get unexpected errors.
-
Oct 13th, 2000, 07:22 PM
#7
It is a race between software engineers to produce idiot-
proof software with the Universe to produce more powerful
idiots....the Universe is winning.
Yeah, you gotta go to the bounds of the possible and one
step beyond. Also, always test for what happens if the
idiots send Null.
Good Luck (You'll need it!)
DerFarm
-
Oct 13th, 2000, 07:25 PM
#8
Thread Starter
Fanatic Member
DerFarm, thanks for your reply....I think.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|