‹ BackHN Continuity

Thread

C's Flexible Integer Sizes Were Not a Design Mistake

113 points · 166 comments · ibobev

  1. codedokode · · focus · HN ↗
    I think it didn't work out well, because "int" being different size makes programming difficult. For example, a system must manage up to 100 000 records. Can I use int for record number? What if it is 16 bits? What if I need to send data between machines, how can I use "int" if it can be different size?

    Probably someone noticed that it is inconvenient, and on 64-bit machine ints are still 32-bit and not 64.

    The computers with 16-bit ints or 9-bit bytes are long gone, but the language still has to carry that legacy.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.