Linus' idea of "good taste" code

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 27 07:17:06 PDT 2016


On 10/27/2016 11:24 AM, qznc wrote:
> I'm unsure about Linus' version. For this example, I agree that it is
> elegant. It is fine in this specific case, because everything is local
> within a single function. In general, the trick to use a pointer to the
> element probably not a good idea.
> 
> The article/Linus does not explain the tradeoffs properly, which makes
> it dangerous advice.

I'd agree for some general language but considering it is Linus, C can
be reasonably assumed. And in C land it doesn't even count as "trick",
heavy nested pointer usage is widespread and even somewhat idiomatic -
being comfortable with such code can be expected from any non-newbie C
programmer.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20161027/db021896/attachment.sig>


More information about the Digitalmars-d mailing list