<div dir="ltr"><div dir="ltr">Em ter., 2 de set. de 2025 às 12:54, Archie Cobbs <<a href="mailto:archie.cobbs@gmail.com">archie.cobbs@gmail.com</a>> escreveu:</div><div class="gmail_quote gmail_quote_container"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">Re: Semantics:</div><div class="gmail_quote"><div>- "no one knows what + means without looking it up" - isn't that already the case today?</div></div></div></div></blockquote><div><br></div><div>This reminds of an old criticism of C++, that one does not "know without looking up" the meaning of local variable declarations, that constructor functions are "magic". The criticism usually went like this: in C you know what is the effect of a local variable declaration, you know it allocates space for a struct with Foo layout, but in C++ you don't know what is the effect of a variable declaration, because it may run a constructor function, which may do anything it likes -- and this not knowledge is a problem because it is "magic".</div><div><br></div><div>I learned to program bare metal directly in C++ without going through C first -- I learned and started practising both C and C++ at approximately the same time. The above criticism never made any sense to me: the existence of constructor functions were part of my early training and the need to look up the effects of constructors were part of my habit while reading foreign code. The fact that I needed to look up an initializer line or a function call line was just the same.</div><div><br></div><div>I think this is a type of problem much less important then, say, the short circuit problem -- that in C++ primitive operator&& short circuits but overloaded operator&& does not. One could apply the same kind of observation -- that one must lookup the meaning of code -- but to me knowing if and in what order a machine evaluates subexpressions is a very different kind of thing than knowing what is the definition of an operator. I think one must know, just by looking at code, if and in what order a machine evaluates subexpressions, without knowing what the actual definition of each subexpression; operator && must either always short circuit or never short circuit.</div><div><br></div><div>--</div></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Pedro Lamarão</div></div></div></div>