Thread View: comp.lang.c
1 messages
1 total messages
Started by Tim Rentsch
Thu, 15 Oct 2026 06:36
Re: = vs. == (again!) (Was: c needs this sign)
Author: Tim Rentsch
Date: Thu, 15 Oct 2026 06:36
Date: Thu, 15 Oct 2026 06:36
26 lines
2552 bytes
2552 bytes
gazelle@shell.xmission.com (Kenny McCormack) writes: > In article <117ophj$3il1$1@kst.eternal-september.org>, > Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote: > ... > >> If I were creating a new language, I might use ":=" for assignment >> and "==" for comparison. I'd use "==" rather than "=" only to >> cater to programmers accustomed to C and the languages it influences. >> And I'd discuss that language elsewhere. > > Note that another way to solve this problem is simply to not allow > assignments to be expressions. This has been suggested at various > times in the past on this newsgroup. > > The fact that assignments are expressions is one of the nifty > features of C (and C-like) language(s) and allows for nifty, > clever, compact code that is dazzling to the eye (and confusing > to the newbie). [...] They also can be used in ways that are straightforward, not hard to understand, and not confusing to new programmers. Like most aspects of programming languages, using assignment expressions effectively requires a certain amount of taste and good judgment. If every potentially confusing language feature were thrown out there would be almost nothing left.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads