Projects > Discussion

The Alternate Extension - Error-Safe or File Size?

(1/2) > >>

AoDC:
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?

aab:
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.

AoDC:
That sir, is an excellent response.

aab:
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;

Infinitus:
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.

Navigation

[0] Message Index

[#] Next page


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



Go to full version