Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Bob Eager Newsgroups: alt.folklore.computers,comp.sys.raspberry-pi Subject: Re: Is it a lost cause? Date: 11 Jul 2016 18:39:22 GMT Lines: 35 Message-ID: References: <146725407.489943112.212855.peter_flass-yahoo.com@news.eternal-september.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net msfc0YcHcPzTOZWVBxRt2gmQKJ1rkuSSv6T4PkpclMGFO1WeL1 Cancel-Lock: sha1:MnTxmMZ6HG6IL6L6S9USlxLCEtI= User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Xref: csiph.com alt.folklore.computers:167011 comp.sys.raspberry-pi:12694 On Mon, 11 Jul 2016 17:27:29 +0100, The Natural Philosopher wrote: > On 11/07/16 17:01, Bob Eager wrote: >> On Mon, 11 Jul 2016 16:57:58 +0100, The Natural Philosopher wrote: >> >>> Often it is easier, though less efficient*, to break deep nesting >>> into subroutine calls, so each level of logic has its own 'block'.. >> >> That happens to me, particularly if the code contains a 'switch' >> statement and contains other stuff such as another 'switch', or >> conditionals. >> >> That is my solution. >> >>> *(static) inline functions can of course be used in C(++) to make the >>> code more readable WITHOUT the overhead of actual subroutines. >> >> Which is what I do. >> >> > Oddly enough there seems to be evidence that the complier will inline a > static function that is only used once... Rather a sweeping statement. It will depend on the compiler. One might say that logically the compiler should always do this, but I can think of situations when I would rather it did not. I'll leave identification of such a situation as an exercise. -- Using UNIX since v6 (1975)... Use the BIG mirror service in the UK: http://www.mirrorservice.org