c++ - Testing for valid arguments in the internal interfaces that client can't see -


it's practice test arguments in function before function real processing begins.

but true internal functions , interfaces? boss(my tech lead) told me don't need check things in internal interfaces, because front end filtering them out.

so true, suppose protocol, , when protocol have many layers, , think protocol our internal protocol okay ignore checks because use protocol internally?

but true internal functions , interfaces ? boss( tech lead ) told me don't need check things in internal interfaces, because front end filtering them out.

your boss right insofar should frontends code responsibility , makes no sense checks again , again (which hurts performance).

probably best practice use assert() parameter checks. don't have rely on frontends functionality during debugging , testing phase, checks removed production code.


one thing dislike assert() approach is, it's debugging unfriendly.
it's way easier catch exception , check call stack see culprit was. maybe better idea regarding write own kind of assert() macro, doesn't call abort(), throws appropriate exception. same original assert() erased production code.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -