Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: The Alternate Extension - Error-Safe or File Size?  (Read 4697 times)

0 Members and 1 Guest are viewing this topic.
The Alternate Extension - Error-Safe or File Siz...
« on: April 03, 2006, 11:38:07 pm »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 4588
Alot of arguments go on in the classroom about wether or not to ELSE everything you write, to avoid errors, and errors with stupid compiler messages (Abort/Ignore). The problem is, else'ing everything you write increases file size majorly in the long run. Is it better to be safe, or small?
Logged
the a o d c

aab

^ Evolved from a Hobbit
Re: The Alternate Extension - Error-Safe or File...
« Reply #1 on: April 04, 2006, 03:18:31 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 992
If im correct in thinking you mean trap every error possible in code eg:
int*p=getstuff();
if(p) use(p); else MessageBox(0,"eeee","aaaaagh!",MB_ICONERROR|MB_OK);

Well, depends on the language, the critical nature of the tasks, the speed and size requirements scale of the program..and quality of your debugging tools.
Really its about time: A company would want to minimise risks of having an error in the first place, and in the event of having one, be able to find it easily (of course). The larger something is, the more blablabla <i knwo...its all obvious ..>. Basically, after years of experience in a particular fashion, a fusion between the directing programmer and physical coders can judge whats best.
And if your going to if for an exception...why not else. May as well just not do the if in the first place: at least that way it would crash and you would know theres a problem. Ifing and nothing happening gives no no idication of an exception, more something logically incorrect which could lead someone seeking through all their code.
Logged




I ♥ Sol
.... I ♥ Sol ? wtf how long has that been there? >_> *rrrrrrrrar*
  • MySpace
Re: The Alternate Extension - Error-Safe or File...
« Reply #2 on: April 04, 2006, 06:31:04 am »
  • *
  • Reputation: +1/-0
  • Offline Offline
  • Gender: Male
  • Posts: 4588
That sir, is an excellent response.
Logged
the a o d c

aab

^ Evolved from a Hobbit
Re: The Alternate Extension - Error-Safe or File...
« Reply #3 on: April 04, 2006, 11:34:22 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 992
ah....Thats nice 'cause i wasnt sure wether i was interpretingn your question right...eg what if 'The Alternate Extension' was a special programming tool that i hadnt heard of with some extra significant meaning behind elses.
I'd also like to add that with todays hardware, size is much less of an issue than it used to be. the else can be jumped over so speed of execution shouldnt be hampered too much, and the error messages themselves (rather than having literal error strings embedded in code throughout a program) can be stored in files, accessed by a much smaller string (say 4 bytes long, with significant meaning behind each byte that specifies grouping so it can find the string more easily, having the last two or maybe just the last the index of the error within the grouping) to reduce size of the output..So in esssence the asm of the content of the else would just be something like: push "BPP0"; call MySpecialErrorThingie;
Logged




I ♥ Sol
.... I ♥ Sol ? wtf how long has that been there? >_> *rrrrrrrrar*
  • MySpace
Re: The Alternate Extension - Error-Safe or File...
« Reply #4 on: April 04, 2006, 11:59:13 am »
  • *
  • Reputation: +3/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6629
I prefer Try blocks :D, 99% of errors can be caught with them, pain in the arse though if you do manage to get an error that cant be handled by one. Using else is more ore less pointless as if an exception is throw your program will cease, and the else block will lie in code heaven for all eternity.
Logged

Ben

Re: The Alternate Extension - Error-Safe or File...
« Reply #5 on: April 04, 2006, 01:20:36 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 437
I wouldn't say that you need to else EVERYTHING. But there are times when you can get random pointer errors that are just annoying and you can't see why.
Hell I suppose it could have stopped a few pointer errors, but if you compile every three seconds then you should be able to realise where the actual error is - in the last line you wrote :-p.

They aren't necessary in a final version, unless they keep getting called for some reason. But if your code is solid enough you won't need it and the only pointer errors you'll get will be windows fault.
Logged
Want a place to upload your sprites and games for FREE? Look no further than GameDevotion

aab

^ Evolved from a Hobbit
Re: The Alternate Extension - Error-Safe or File...
« Reply #6 on: April 04, 2006, 11:49:07 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 992
Try, catch yeah, But youll still need if, else somewhere the exception handler to throw your own exceptions (excluding the built-ins or libraries exps, which in the end will compile under a condition once again)
Then in the catch block messages can be collectively reported.
Logged




I ♥ Sol
.... I ♥ Sol ? wtf how long has that been there? >_> *rrrrrrrrar*
  • MySpace
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.208 seconds with 51 queries.

anything