The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: dds@aueb.gr (Diomidis Spinellis)
Subject: [TUHS] Comments on "C"
Date: Fri, 9 Sep 2016 09:06:41 +0300	[thread overview]
Message-ID: <4a7fc027-ad96-29c4-99c7-042fcc204caf@aueb.gr> (raw)
In-Reply-To: <B977CD6B-17FB-4B2C-A503-0DE3F40F6E42@ronnatalie.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2345 bytes --]

On 09/09/2016 06:02, Ronald Natalie wrote:
>> On Sep 8, 2016, at 6:06 PM, Dave Horsfall <dave at horsfall.org> wrote:
>> On Thu, 8 Sep 2016, Ron Natalie wrote:
>>> Most of my complaints about C are because it's "standard" library was
>>> awful back in the seventies and it really didn't improve much over the
>>> years.
>>
>> That "portable I/O" library was certainly atrocious, but at least STDIO
>> was an improvement.
>
> Not much.   The functions have all of their portable IO library ugliness.   Don’t get me started on fread/fwrite.
> Ane why gets and fgets have different semantics and all the various functions take the stream parameter in
> different places.

Let's put things into perspective.  A rarely talked-about innovation of 
C was that the language was separate from the libraries.  At the time 
each language came with built-in commands for performing I/O and (if you 
were lucky) handling strings.  These were part of the language's syntax 
and semantics;  any additional facilities provided through libraries 
were second class citizens.  C gave us a lean language that could be 
implemented and run without the overhead of its "library" facilities. 
This made it suitable for writing an OS kernel and later for writing 
embedded systems applications and for porting to other operating 
systems.  It also made any add-on library a first class citizen.  In a 
program there's no difference between calls to the "standard" stdio.h or 
string.h functions and calls to add-on libraries such as those in dbm.h 
or mp.h.

The C library may be deficient, but when its interfaces were devised it 
was not "The C Library", but a number of functions and headers that (I 
guess) the people at Bell Labs whipped together to simplify their life 
when writing application code.  It doesn't show the careful design that 
went into other places (the C language, the Unix system calls, the 
shell), because I think it was expected that people would quickly come 
up with better alternatives.  In the end this "good enough" design 
spread widely and then got standardized (by removing Unix-specific 
functionality and a few rough edges) into what we now call the C 
Standard Library.

My complaint is that some APIs that were designed later, such as the C++ 
STL and the Python libraries, didn't adopt more consistent naming 
conventions.



  reply	other threads:[~2016-09-09  6:06 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08 13:30 Noel Chiappa
2016-09-08 14:22 ` Tony Finch
2016-09-08 19:20   ` Ron Natalie
2016-09-08 22:06     ` Dave Horsfall
2016-09-09  3:02       ` Ronald Natalie
2016-09-09  6:06         ` Diomidis Spinellis [this message]
2016-09-09 21:15 ` Mary Ann Horton
  -- strict thread matches above, loose matches on Subject: below --
2016-09-09  2:43 Doug McIlroy
2016-09-08 12:35 Doug McIlroy
2016-09-09 17:07 ` scj
2016-09-01  9:17 Norman Wilson
2016-09-01 15:11 ` Clem Cole
2016-09-01 21:47 ` Tim Bradshaw
2016-09-02  0:11   ` Mary Ann Horton
2016-09-02  7:10     ` Steve Simon
2016-09-02 10:02       ` Steve Nickolas
2016-09-02 14:13       ` Random832
2016-09-02 21:23 ` Dave Horsfall
2016-09-04 17:03   ` scj
2016-09-05 13:07     ` Ron Natalie
2016-09-04 22:24   ` Nemo
2016-08-28 18:21 Dave Horsfall
2016-08-29  0:37 ` Marc Rochkind
2016-08-29  0:42   ` Larry McVoy
2016-08-29  1:54     ` Steve Nickolas
2016-09-08  1:19     ` Blake McBride
2016-08-29  3:16   ` Greg 'groggy' Lehey
2016-08-31 10:02     ` Tim Bradshaw
2016-08-31 12:59       ` John Cowan
2016-08-31 13:32         ` Ron Natalie
2016-08-31 14:37           ` John Cowan
2016-08-31 13:57   ` Brantley Coile

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4a7fc027-ad96-29c4-99c7-042fcc204caf@aueb.gr \
    --to=dds@aueb.gr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).