Why is `scope` planned for deprecation?
via Digitalmars-d
digitalmars-d at puremagic.com
Wed Nov 19 00:56:08 PST 2014
On Wednesday, 19 November 2014 at 00:04:50 UTC, Walter Bright
wrote:
> I know you're simply being argumentative when you defend VLAs,
> a complex and
> useless feature, and denigrate simple ptr/length pairs as
> complicated.
Wait, we are either discussing the design goals of the original C
or the evolved C. VLAs did not fit the original C either, but in
the google discussion you find people who find VLAs very useful.
It looks a loot better than alloca. The reason it is made
optional is to make embedded-C compilers easier to write, I think.
> But hey, it's simpler, faster, less code, less bug prone,
> easier to understand and uses less memory to:
>
> 1. strlen
> 2. allocate
…
Not faster, but if speed is no concern, sure. It seldom is when
it comes to filenames.
> I know you said "just allocate a large fixed size buffer", but
> I hope you realize that such practice is the root cause of most
> buffer overflow bugs,
strcat() should never have been created, but strlcat is safe.
> Now, I know that you'll never concede destruction, after all,
> this is the internet, but give it up :-)
I always concede destruction :-)
More information about the Digitalmars-d
mailing list