Deutsch   English   Français   Italiano  
<v596uj$ban8$6@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!2.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: David Brown <david.brown@hesbynett.no>
Newsgroups: comp.lang.c
Subject: Re: Baby X is bor nagain
Date: Sun, 23 Jun 2024 15:11:47 +0200
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <v596uj$ban8$6@dont-email.me>
References: <v494f9$von8$1@dont-email.me>
 <v49seg$14cva$1@raubtier-asyl.eternal-september.org>
 <v49t6f$14i1o$1@dont-email.me>
 <v4bcbj$1gqlo$1@raubtier-asyl.eternal-september.org>
 <v4bh56$1hibd$1@dont-email.me> <v4c0mg$1kjmk$1@dont-email.me>
 <v4c8s4$1lki1$4@dont-email.me> <20240613002933.000075c5@yahoo.com>
 <v4emki$28d1b$1@dont-email.me> <20240613174354.00005498@yahoo.com>
 <v4okn9$flpo$2@dont-email.me> <v4p37r$k32n$1@dont-email.me>
 <v4pei3$m5th$2@dont-email.me> <v523iu$2nli8$4@dont-email.me>
 <v53lmh$34g49$1@dont-email.me> <v53v0q$36coc$1@dont-email.me>
 <v540hi$368vf$2@dont-email.me> <v54pu3$3bas6$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 23 Jun 2024 15:11:48 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="5355e1e2ebba64f698c289003534b1d6";
	logging-data="371432"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+3/uLDU1qXJ/49a/BUCFcIrHqLKkDtxGw="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:nqkSpxpAm+WzaLcvlJQXD87ZZGw=
Content-Language: en-GB
In-Reply-To: <v54pu3$3bas6$1@dont-email.me>
Bytes: 4058

On 21/06/2024 23:05, bart wrote:
> On 21/06/2024 14:51, David Brown wrote:
>> On 21/06/2024 15:25, bart wrote:
> 
>>> (Which is why I think they should just be included anyway.)
>>
>> That would be a terrible idea for many reasons.
> 
> Such as? It can't be compilation time, since headers ten times the size 
> or more apparently instantly.

Namespace pollution.  C does not have namespaces, so everything gets 
dumped in the global namespaces.  There is always a risk that user code 
has identifiers that are used by later versions of the C standards, even 
when they try to avoid the names in the reserved list.  As each standard 
gets more standard headers, and more identifiers in them, the risk of 
conflicts if you always included all standard headers would be huge.

> 
> One delight in using my language is that its standard library is always 
> available. But if you don't want it, it can be disabled. With C I spend 
> a big chunk of my time writing include lines.

That sounds like inefficient coding practices.  You do know that file 
inclusion is recursive?  So if most of the files in your project use 
<stdbool.h>, <stdint.h>, <stdlib.h>, <stddef.h> and <string.h>, you can 
put all these in a file "common.h" and include that?  But if you never, 
or almost never, use <setjmp.h>, <complex.h>, <wctype.h>, <fenv.h>, then 
you don't bother with them in the "common.h" file.

Such practices eliminate any perceived benefit of putting all the 
headers inside the compiler.

> 
> First I need stdio. Then string. Then stdlib. Then there's always ones I 
> can't quite remember.

There are some pretty good references available.  Some compilers will 
even tell you which include files are missing, at least in some common 
cases.


> 
> Or I need to debug someone's code, and it needs stdio to define 
> 'printf', FFS. Would the world stop turning if it was just available?

I sometimes want to define my own "printf".  You can disagree, but 
certainly /I/ am glad of the flexibility C offers.

> 
> I just don't believe that things defined in the headers need to be 
> micro-managed to that extent, most of the time.
> 

Most languages require declarations of libraries or modules that are 
used.  C, being fairly low-level and with a smaller core language than 
most, might require such declarations a little more than most languages. 
  But it works well enough in practice.