Path: ...!weretis.net!feeder9.news.weretis.net!i2pn.org!i2pn2.org!.POSTED!not-for-mail From: Richard Damon Newsgroups: comp.lang.c Subject: Re: question about nullptr Date: Mon, 8 Jul 2024 07:18:18 -0400 Organization: i2pn2 (i2pn.org) Message-ID: <361be2220e25f56edb8511175ae5eadcf9115703@i2pn2.org> References: <20240706054641.175@kylheku.com> <877cdyuq0f.fsf@bsb.me.uk> <2ckiO.19403$7Ej.4487@fx46.iad> <87plrpt4du.fsf@bsb.me.uk> <9bCiO.7108$sXW9.3805@fx41.iad> <87jzhwu5v9.fsf@bsb.me.uk> <20240708001722.280@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 8 Jul 2024 11:18:18 -0000 (UTC) Injection-Info: i2pn2.org; logging-data="2565031"; mail-complaints-to="usenet@i2pn2.org"; posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg"; User-Agent: Mozilla Thunderbird In-Reply-To: <20240708001722.280@kylheku.com> Content-Language: en-US X-Spam-Checker-Version: SpamAssassin 4.0.0 Bytes: 2048 Lines: 21 On 7/8/24 3:19 AM, Kaz Kylheku wrote: > On 2024-07-07, Ben Bacarisse wrote: >> I find myself completely out of step with many posters here about >> "explicit code" should look like. I think >> >> char *p = 0; >> >> is explicit enough and, in fact, I consider it a plus point if someone >> reading it goes "hey, what's going on here?" and ends up learning that 0 >> is null pointer constant in C. > > And if that person is on the C or C++ langauge committee, that bit of > learning could just prevent a superfluous non-invention like nullptr. > Remember, it was invented on the C++ side, where it has some very useful uses due to overloading. And then brought over to C to minimize the differences. Nothing made it manditory, so if you want to make your reader learn more about C, go ahead and use things that are somewhat obscure.