Sujet : Re: filling area by color atack safety
De : fir (at) *nospam* grunge.pl (fir)
Groupes : comp.lang.cDate : 19. Mar 2024, 23:23:48
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <utd392$2e30d$1@i2pn2.org>
References : 1 2 3 4 5 6
User-Agent : Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0 SeaMonkey/2.24
Malcolm McLean wrote:
On 16/03/2024 18:21, Scott Lurndal wrote:
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
On 16/03/2024 13:55, Ben Bacarisse wrote:
Malcolm McLean <malcolm.arthur.mclean@gmail.com> writes:
>
Recursion make programs harder to reason about and prove correct.
>
Are you prepared to offer any evidence to support this astonishing
statement or can we just assume it's another Malcolmism?
>
>
Example given. A recursive algorithm which is hard to reason about and
>
Perhaps hard for _you_ to reason about. That doesn't
generalize to every other programmer that might read that
code.
>
>
From experience this one blows the stack, but not always. Sometimes
it's OK to use.
>
Since you can reason about it so easily, you can tell the others when
you're OK and when you are not, in a handy intuitive way so that someone
thinking of implementing it will know.
>
from "effective c" or maybe i call it "optimal" point of view recursion as it is implementeded in c is wrong (it is sub-optimel)
so i agree with that statement - hovever a big dose of world today
programs in a non optimal way (for example whole that python ond other
programing ways is non optimal)..and thus te recursion may be found one way
..and i must say whan i way younger i was much more hardfixed to optimal coding..today i almost no code at all and lost a interest (i mean "being interested") in many things ..i also consider that
non optimal cases more interesting - and generallt this recursion would be standable - especialy if for example windows has this "guard page"
some exception based mechanism that would allow to resize stack
up its default two megabytes (which is a bit small size as for today)
instead of crashing application
im not sure hovever if its done and if its posoble as i understand there is exception when tryibgf to read write immediatelly after stack reserve but not quite if someone just moves up stack pointer (like when allocating stack space for array) but those machanisms could be handy