🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c++
Article #924

Re: does an expression in a logical statement need parenthesis for proper evaluation?

#924
From: Chris M. Thomasson
Date: Wed, 18 Nov 2026 22:53
86 lines
5640 bytes
On 11/18/2026 2:40 PM, Lynn McGuire wrote:
> On 11/18/2026 1:11 AM, Chris M. Thomasson wrote:
>> On 11/10/2026 1:21 PM, Lynn McGuire wrote:
>>> On 11/10/2026 3:12 PM, Chris M. Thomasson wrote:
>>>> On 11/10/2026 12:48 PM, Lynn McGuire wrote:
>>>>> On 11/10/2026 12:25 AM, Chris M. Thomasson wrote:
>>>>>> On 11/9/2026 8:39 PM, Lynn McGuire wrote:
>>>>>>> On 11/9/2026 6:54 PM, Keith Thompson wrote:
>>>>>>>> Lawrence D’Oliveiro <ldo@nz.invalid> writes:
>>>>>>>>> On Mon, 9 Nov 2026 06:00:40 -0500, James Kuyper wrote:
>>>>>>>>>> I tend not to use unnecessary parentheses, and I know the grammar
>>>>>>>>>> well enough to correctly identify them - but many people don't 
>>>>>>>>>> know
>>>>>>>>>> the grammar that well, which might include the next person to
>>>>>>>>>> maintain my code.
>>>>>>>>>
>>>>>>>>> Even if they haven’t committed the precedence table to memory, 
>>>>>>>>> surely
>>>>>>>>> they have the ability to look things up online
>>>>>>>>> <https://en.cppreference.com/c/language/operator_precedence>.
>>>>>>>>>
>>>>>>>>> If someone has regular trouble with certain language features, why
>>>>>>>>> aren’t pages that clarify those very issues not already in their
>>>>>>>>> browser bookmarks?
>>>>>>>>
>>>>>>>> If I haven't memorized all the precedence levels, I greatly prefer
>>>>>>>> an expression I can read at a glance to one that requires me to
>>>>>>>> consult some document before I can be sure what it means, just so
>>>>>>>> I can continue to the next line of code.
>>>>>>>>
>>>>>>>> Just one example: I couldn't tell you whether `^` or `|` binds more
>>>>>>>> tightly without looking it up.  If you can, that's great.
>>>>>>>>
>>>>>>>> Preferences for *how many* strictly semantically unnecessary
>>>>>>>> parentheses are appropriate vary greatly, but few C programmers
>>>>>>>> would insist on none.
>>>>>>>
>>>>>>> I ship my software written in four different software languages. 
>>>>>>> C+ +, Fortran, Visual Basic, and C#.  Remembering the nuances of 
>>>>>>> each is tricky.  I find it best to be safe.
>>>>>>>
>>>>>>> I have shipped software in about a dozen software languages in my 
>>>>>>> 51 year career.  C++, Fortran IV (66), Fortran 77, Visual Basic, 
>>>>>>
>>>>>> VB 6? Do you use access as well?
>>>>>>
>>>>>>> C#, Turbo Pascal, Basic, Turbo C, Unix C, IBM 370 Assembler, 
>>>>>>> Intel x86 Assembler, AWK.  I think that I am leaving out a couple 
>>>>>>> that I cannot remember at the moment.
>>>>>>>
>>>>>>> Lynn
>>>>>
>>>>> Nope.  It is just a sample app with source code to show how to 
>>>>> connect to my DLLs using VB. 
>>>>
>>>> That's fine. Fwiw, I wrote a full blown specialized whole home/pool 
>>>> inspection system using VB 6, Access and Word 6 for my Dad way back 
>>>> in the day. What service pack are you using? Those were fun... ahh, 
>>>> back in the day... ;^o
>>>>
>>>>
>>>>> I have several samples apps including an Excel spreadsheet.  I have 
>>>>> never used Access.
>>>>
>>>> Actually, Access worked pretty damn good for my needs. Then, iirc, 
>>>> it got superseded by SQL server.
>>>>
>>>>
>>>>> All of my calculation software is currently Win32 DLLs so my 
>>>>> customers can easily use them for custom calculations.
>>>>
>>>> Well, that should work fine. Once they know the API, anybody should 
>>>> be able to use them. Iirc, it was a little strange to map DLL's 
>>>> created in C to the VB 6 data types. But, can be done for sure.
>>>
>>> VB6 SP5 IIRC.
>>
>> Nice. I think I still have a CD with a SP3. Going from VB to Win32 and 
>> back can be done, but its always felt odd to me.
> 
> I do not even have VB6 on my current Win 11 system.  I do have it on my 
> Win 7 system behind me.
> 
The little shit can run in dosbox. I had it on winnt, me and xp back in 
the day. I still have some legacy boxes, pentium 4's iirc, that have my 
old home/pool inspection system still running.
Technical Details
Message-ID: <11dlaa7$1pdln$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11cj4a0$23796$1@dont-email.me> <11crsub$11ikc$1@dont-email.me> <11cs94q$15ptp$1@dont-email.me> <11cti69$1lilf$5@dont-email.me> <11ctq02$1ohj1$1@kst.eternal-september.org> <11cu75a$1s1rc$1@dont-email.me> <11cudch$1tlc1$1@dont-email.me> <11cvvvl$2gap5$1@dont-email.me> <11d01ci$2grm3$1@dont-email.me> <11d01sn$2h00m$1@dont-email.me> <11djj31$147kt$1@dont-email.me> <11dl9g6$1p890$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com>
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Re: does an expression in a logical statement need parenthesis for
 proper evaluation?
Date: Wed, 18 Nov 2026 14:53:58 -0800
Organization: A noiseless patient Spider
Lines: 86
Message-ID: <11dlaa7$1pdln$1@dont-email.me>
References: <11cj4a0$23796$1@dont-email.me> <11crsub$11ikc$1@dont-email.me>
 <11cs94q$15ptp$1@dont-email.me> <11cti69$1lilf$5@dont-email.me>
 <11ctq02$1ohj1$1@kst.eternal-september.org> <11cu75a$1s1rc$1@dont-email.me>
 <11cudch$1tlc1$1@dont-email.me> <11cvvvl$2gap5$1@dont-email.me>
 <11d01ci$2grm3$1@dont-email.me> <11d01sn$2h00m$1@dont-email.me>
 <11djj31$147kt$1@dont-email.me> <11dl9g6$1p890$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 18 Nov 2026 22:54:00 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1881783"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18vXjBgnYjBrGW4OoDdMYl536iTVWL8zBI="; posting-host="893e20b5c86f3e4847392c6cf1971416"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:OrIsoIaRCps2Af47LpKobCJqOII= sha256:t9kYvDmIZYC55Ttciq75uyarbysEHIy7KwV/As0jgqo=
	sha1:2XLyCvsCuN5Iv+3pkRqhQu2r/1A= sha256:j/1Cubq23l6cwLMjmw19LkKBuUZ8M6Cyus90CYvMhHw=
Content-Language: en-US
In-Reply-To: <11dl9g6$1p890$1@dont-email.me>