← Back to context Comment by clark_dent 3 hours ago Could you humor a coding noob--how do you deal with utterly insane inputs like that? 8 comments clark_dent Reply wwalexander 1 hour ago Arbitrary precision arithmetic (GMP, BigInteger, etc). Numbers can take arbitrary amounts of memory, instead of just a single machine word. doubled112 2 hours ago Crash and report an error. chowells 2 hours ago You report an error and exit cleanly with a proper operating system error code. Crashing is a quick hack, acceptable for throwaway projects but not in software used long-term. SoftTalker 1 hour ago Crashing (in the sense of "give up and exit with an error") on invalid inputs is valid (and often the best thing) in many cases.Fix your inputs. 1 reply → matthewkayin 2 hours ago You first ask if you really need to. AnimalMuppet 2 hours ago Unless you're exposing it to the internet, ever, in the entire future history of the program. Then you kind of have to, in one form or another. Someone 43 minutes ago You have to, but you probably shouldn’t do it by trying to add the inputs. That opens a door for DDOS attacks.Returning an error on inputs that are too long (for some definition of it) is the way to go.
wwalexander 1 hour ago Arbitrary precision arithmetic (GMP, BigInteger, etc). Numbers can take arbitrary amounts of memory, instead of just a single machine word.
doubled112 2 hours ago Crash and report an error. chowells 2 hours ago You report an error and exit cleanly with a proper operating system error code. Crashing is a quick hack, acceptable for throwaway projects but not in software used long-term. SoftTalker 1 hour ago Crashing (in the sense of "give up and exit with an error") on invalid inputs is valid (and often the best thing) in many cases.Fix your inputs. 1 reply →
chowells 2 hours ago You report an error and exit cleanly with a proper operating system error code. Crashing is a quick hack, acceptable for throwaway projects but not in software used long-term. SoftTalker 1 hour ago Crashing (in the sense of "give up and exit with an error") on invalid inputs is valid (and often the best thing) in many cases.Fix your inputs. 1 reply →
SoftTalker 1 hour ago Crashing (in the sense of "give up and exit with an error") on invalid inputs is valid (and often the best thing) in many cases.Fix your inputs. 1 reply →
matthewkayin 2 hours ago You first ask if you really need to. AnimalMuppet 2 hours ago Unless you're exposing it to the internet, ever, in the entire future history of the program. Then you kind of have to, in one form or another. Someone 43 minutes ago You have to, but you probably shouldn’t do it by trying to add the inputs. That opens a door for DDOS attacks.Returning an error on inputs that are too long (for some definition of it) is the way to go.
AnimalMuppet 2 hours ago Unless you're exposing it to the internet, ever, in the entire future history of the program. Then you kind of have to, in one form or another. Someone 43 minutes ago You have to, but you probably shouldn’t do it by trying to add the inputs. That opens a door for DDOS attacks.Returning an error on inputs that are too long (for some definition of it) is the way to go.
Someone 43 minutes ago You have to, but you probably shouldn’t do it by trying to add the inputs. That opens a door for DDOS attacks.Returning an error on inputs that are too long (for some definition of it) is the way to go.
Arbitrary precision arithmetic (GMP, BigInteger, etc). Numbers can take arbitrary amounts of memory, instead of just a single machine word.
Crash and report an error.
You report an error and exit cleanly with a proper operating system error code. Crashing is a quick hack, acceptable for throwaway projects but not in software used long-term.
Crashing (in the sense of "give up and exit with an error") on invalid inputs is valid (and often the best thing) in many cases.
Fix your inputs.
1 reply →
You first ask if you really need to.
Unless you're exposing it to the internet, ever, in the entire future history of the program. Then you kind of have to, in one form or another.
You have to, but you probably shouldn’t do it by trying to add the inputs. That opens a door for DDOS attacks.
Returning an error on inputs that are too long (for some definition of it) is the way to go.