Skip to content
HomeVideosBooksBlogs
AllTop postsTopics
Podcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    J

    Jens Gustedt

    gustedt.wordpress.com · Personal blog · on HN since 2012

    Jens Gustedt, a C standards contributor, writes about the C language, upcoming C standard revisions, and the book Modern C.

    Visit blogRSSHN submissions
    Languages & CompilersProgramming
    What HN says

    HN commenters recommend his Modern C book as an opinionated, sane guide for learning C, and cite his posts on unsigned loops and variably modified types.

    Stats for nerds
    52HN people shared it
    71linked in comments
    2.5Kstory points
    Nov 2025last shared
    2013people per year2025

    Top posts on HN

    1. 1
      Modern C, Second Edition
      2 people · 597 points · first shared 2019 · 233 comments on HN
    2. 2
      The C23 edition of Modern C
      1 person · 515 points · first shared 2024 · 347 comments on HN
    3. 3
      The provenance memory model for C
      1 person · 225 points · first shared 2025 · 143 comments on HN
    4. 4
      A Defer Mechanism for C
      4 people · 187 points · first shared 2020 · 244 comments on HN
    5. 5
      C2x: the next real revision of the C standard
      4 people · 175 points · first shared 2018 · 184 comments on HN
    6. 6
      C: Simple Defer, Ready to Use
      1 person · 175 points · first shared 2025 · 152 comments on HN
    7. 7
      Modern C is now feature complete
      4 people · 127 points · first shared 2016 · 1 comments on HN
    8. 8
      Contracts for C
      3 people · 118 points · first shared 2025 · 111 comments on HN
    9. 9
      White space does matter in C23
      1 person · 103 points · first shared 2024 · 52 comments on HN
    10. 10
      Braiding the spaghetti: implementing defer in the preprocessor
      1 person · 41 points · first shared 2024 · 14 comments on HN

    What HN people wrote when they linked it

    • AlbertoGPApr 2021

      I’m actually implementing that right now for my own use, as a pre-processor.

      There is a much more advanced design and implementation at “A defer mechanism for C” (December 2020): https://gustedt.wordpress.com/2020/12/14/a-defer-mechanism-for-c/

      For my own purposes, I think I can live without handling stack unwinding so I continue working on my pre-processor.

      Since the pre-processor is not yet finished, there I use a vector¹ of {.pointer, .destructor} where I put objects after initialization, with one macro at the end of each managed scope that calls the destructors for that scope in reverse order, then another macro meant for the function exit points that calls all the destructors in that vector. This has been built many times before by other people of course, it’s just an exercise to see which difficulties arise.

      ¹ Vector, growable array: I did my own trivial type-generic growable array, with the classic {.capacity, .len, .items}, but again there are many previous implementations. The two I’ve found more interesting are:

      - “C Template Library (CTL)”: https://github.com/glouw/ctl

      - “Klib: a Generic Library in C”: https://github.com/attractivechaos/klib/

    • enriqutoFeb 2020

      I follow regularly these people, these are mostly slow-going blogs or websites:

      1. Fabrice Bellard: https://bellard.org/ This is not really a blog, but a traditional website with links to the work of its author (who is probably one of the top programmers ever). It updates rarely, but when it does, it is to expose yet another monumental piece of computing work that will blow your universe.

      2. Linus Akesson: https://www.linusakesson.net/ He's always onto some funny crazy things: obfuscated programming, underhanded programming, c64 emulation, chiptunes...

      3. Uriel l'Étranger: http://cat-v.org/ The only self-described "philosopher of software" that I have ever seen. His website is of course not updated anymore, but you can re-read it many times and always learn something new.

      4. Ted Unangst: https://flak.tedunangst.com/ Nice to follow some cool news about openbsd development

      5. Andy Chu: http://www.oilshell.org/blog/ Who has embarked in an amazing quest to turn the unix shell into a cleaner tool

      6. Jens Gustedt: https://gustedt.wordpress.com/ If you really want to be up to date about the evolution of the C language

    • binarycrusaderJan 2013

      I wouldn't call it a "need", more like "occasionally desirable". The short version is that it's a convenient method of letting the compiler handle resource management when you have a variable number of values and sufficient stack space. As others pointed out, it's particularly handy for multi-dimensional arrays.

      There are also some possible applications here:
      http://gustedt.wordpress.com/2011/01/13/vla-as-function-arguments/

      In fairness, I've used them only rarely, but those few times I've used them have saved me a bit of grief.

      I could easily live without them if required...

    • mananaysiempreAug 2022

      As Jens Gustedt points out[1], the following intentional unsigned overflow works perfectly for downwards iteration (even when length is 0 or SIZE_MAX), though it looks a bit confusing at first:

      for (size_t i = length - 1; i < length; i--) ...

      You are also free to start at any other (not necessarily in-bounds) index, just like with ascending iteration.

      [1] https://gustedt.wordpress.com/2013/07/15/a-praise-of-size_t-and-other-unsigned-types/

    • stephen82Feb 2021

      I think "defer" is coming [1], along with other goodies that simplified the life of C++ developers, but time will tell.

      I really hope they approve the following:

      * auto
      * constexpr
      * lambda function
      * __typeof__ used as typeof; it behaves like decltype

      It would lead to cleaner code without excessive macro magic; only where would be needed.

      [1] https://gustedt.wordpress.com/2020/12/14/a-defer-mechanism-for-c/

    • anilakarSep 2017

      Beej's guides are the best way to get started quickly (i.e. in the time frame of a university course). For a more thorough introduction, one should probably read "Advanced Programming in the UNIX Environment" and "UNIX Network Programming", both from Richard Stevens.

      Jens Gustedt has also written a rather nice ebook on how to program in modern C: https://gustedt.wordpress.com/2016/11/25/modern-c-is-now-feature-complete/

    Related

    ThePhDthephd.dev112 people

    Embed is in C23

    ThePhD
    Personal · last shared 2026
    John Regehrblog.regehr.org401 people

    Teaching C

    John Regehr
    Personal · last shared 2026
    cor3ntincor3ntin.github.io32 people

    The Problem with C (2020)

    cor3ntin
    Personal · last shared 2026
    Arthur O'Dwyerquuxplusone.github.io64 people

    Slack’s new WYSIWYG input box is terrible

    Arthur O'Dwyer
    Personal · last shared 2026
    Brian Callahanbriancallahan.net28 people

    OpenBSD has two new C compilers: chibicc and kefir

    Brian Callahan
    Personal · last shared 2026
    Philippe Gaultiergaultier.github.io23 people

    You've just inherited a legacy C++ codebase, now what?

    Philippe Gaultier
    Personal · last shared 2026
    EmbeddedRelatedembeddedrelated.com59 people

    Chebyshev Approximation

    EmbeddedRelated
    Publication · last shared 2026
    Chris Wellonsnullprogram.com295 people

    Why Aren't There C Conferences?

    Chris Wellons
    Personal · last shared 2026