TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

On the use of "pointerness" in typedef

1 pointsby fexlabout 13 years ago
Today I reached a pain threshold where I finally started using "typedef" in my code for a pointer type. Recall Linus Torvalds famous advice against doing this:<p>http://lkml.indiana.edu/hypermail/linux/kernel/0206.1/0402.html<p>In particular, he said:<p>~ PS. And never _ever_ make the "pointerness" part of the type. People who write<p><pre><code> typedef struct urb_struct * urbp_t; </code></pre> (or whatever the name was) should just be shot. ~<p>I took this advice seriously and held out to the bitter end. But today I released this code:<p>https://github.com/chkoreff/Fexl/commit/9e361240168151706bcc289b400059a37c5245d8<p>Look at the difference in that sample code in the commit message. Using typedef is so obviously better that I just have to ignore Linus' advice here.

1 comment

fexlabout 13 years ago
Here are the links:<p><a href="http://lkml.indiana.edu/hypermail/linux/kernel/0206.1/0402.html" rel="nofollow">http://lkml.indiana.edu/hypermail/linux/kernel/0206.1/0402.h...</a><p><a href="https://github.com/chkoreff/Fexl/commit/9e361240168151706bcc289b400059a37c5245d8" rel="nofollow">https://github.com/chkoreff/Fexl/commit/9e361240168151706bcc...</a>