Deutsch   English   Français   Italiano  
<vegnfd$ngn6$1@dont-email.me>

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

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.lang.c
Subject: Re: constexpr keyword is unnecessary
Date: Sun, 13 Oct 2024 17:03:08 +0200
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <vegnfd$ngn6$1@dont-email.me>
References: <veb5fi$3ll7j$1@dont-email.me> <vedv0a$5m19$1@dont-email.me>
 <veeqhi$ar0c$2@dont-email.me> <veg59o$kolq$1@dont-email.me>
 <vegbeb$llri$2@dont-email.me>
 <vegc3l$lqrd$1@raubtier-asyl.eternal-september.org>
 <vegevc$m5na$1@dont-email.me>
 <vegg4q$mdj0$1@raubtier-asyl.eternal-september.org>
 <veggq8$mbh9$1@dont-email.me>
 <vegh32$mi48$1@raubtier-asyl.eternal-september.org>
 <vegia7$mofs$1@dont-email.me>
 <vegj0r$mrl5$1@raubtier-asyl.eternal-september.org>
 <veglom$n8io$1@dont-email.me>
 <vegm6g$n9q7$1@raubtier-asyl.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 13 Oct 2024 17:03:10 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="0f256deb82ef31f28ec6905b9c2da414";
	logging-data="770790"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/W8y9OBKlAUu16mEeCfz7Q"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Thunderbird/45.8.0
Cancel-Lock: sha1:unhHgKdONjP8iA16G65m40snq5g=
X-Enigmail-Draft-Status: N1110
In-Reply-To: <vegm6g$n9q7$1@raubtier-asyl.eternal-september.org>
Bytes: 3152

On 13.10.2024 16:41, Bonita Montero wrote:
> Am 13.10.2024 um 16:33 schrieb Janis Papanagnou:
> 
>> This is not the least convincing. Since you seem to express only a
>> language/compiler-internal theme, not any application programmers'
>> demand.
> 
> I don't understand how people can argue so desperately against a
> feature that is so simple and that makes the code more readable.

I'm aware that you are obviously in battle-mode and thus completely
missed that I'm not "against a feature" but just try to understand
the rationale for that. - Again you evaded answering that question,
and I see my suspicion confirmed that there is no gain.

For me, writing  int i = 0;  and  const int i = 0;  is perfectly
readable, and (unnecessarily!) adding another keyword degrades
readability.

As a programmer I expect a compiler to be able to detect constant
expressions, I don't want to litter my program code with technical
constructs to individually tell - on a per-statement basis - the
compiler that a specific constant expression should be evaluated
during compile-time and not postponed to run-time. To support a
simple compiler I think it's okay to instruct him explicitly to
spend more effort pre-evaluating constant expressions, say be a
compiler option. But certainly not by spreading keywords across
the code thereby making the code _less readable_.

(And, as you can derive from what I wrote, I find '_Static_eval'
also not increasing readability.)

Janis