Hacker News new | ask | show | jobs
by rmind 1410 days ago
It is very easy to say, retrospectively, in year 2022, that the decisions were horrible. You are talking about the language and decisions made in 1970s. The knowledge was different. The computers were different, their capability was different. Try running your Python on PDP-7, an 18-bit system! ASCII vs EBCDIC is a computer architecture issue and it's unfair to blame the language that it doesn't have automatic/transparent support for EBCDIC (stuff from 1960s, by the way!). Unicode simply didn't exist at that time. And so on and so forth.

On the contrary, I would say C aged really well for a language which was created to support an entire zoo of computers and operating systems. It is worth pointing out that the language has progressed a lot since then and you don't have to deal with many old headaches if you write C on a modern CPU architecture.

3 comments

On the surface that explanation might make sense, then we start diving into computer archeology and discovering what was being done outside Bell Labs with NEWP, JOVIAL, ALGOL variants, PL/I variants, BLISS, Mesa, Modula-2, PL.8, Lisp, Fortran,....

Naturally it tends to be forgotten, as most UNIX folks set the genesis of computing world in Bell Labs.

> On the contrary, I would say C aged really well for a language which was created to support an entire zoo of computers and operating systems.

This is the case only because the standardized C was more-or-less created as a superset of the many, many C variations that have sprung up until that point. It's also the reason why C leaves so many things up to the implementation or entirely undefined.

Ultimately, this made C a highly portable language, while writing conformant and portable C programs is very difficult.

I do not disagree with any point you made. Not at all.

I just think an introduction to the language in the year 2022 should at least aknowledge that the form of string handling shown in the first part of the book should not be imitated. I can see how those examples would make perfect sense in a different age. Maybe I can give the book the benefit of the doubt as it was published in 2012.

Do you have any book recommendations for a more modern C approach?

The 2nd Edition was published in 1988. I would guess that this this 2012 version just adds an extra foreword and some errata?
Ah that explains a lot thanks
"Modern C" by Jens Gustedt is an excellent book on a more modern approach to C.