Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sizeof()

30 views
Skip to first unread message

gdo...@gmail.com

unread,
Dec 19, 2022, 12:12:37β€―PM12/19/22
to
should be consider a function not an operator?
I'm thinking the trend to lambda functions, or no named function makes it ok to call it a function? but ok it's an operator. looks like a function, πŸ˜‚πŸ€£πŸ˜Ž
<=> is cute, spaceship. lol. looks like upper and lower teeth to me and the corners of a mouth. I guess I would have called it grin.
lol, way too many versions of integers, but I get why there are, but still, way too many versions going forward. but fine. there should be a reason C++/ C programmers make the big bucks. πŸ€”πŸ™‚

hey and if we are going to have revisions how about adding yes and no, we now have true and false.

if ( isThisACharacter( c ) )... seem to me one would yes this is a character as opposed to true this is a character. oh well :
good grief.

if ( (isThisACharacter( c ) ) == yes ) { }
lol.

and how about ending the idea that any other value then 0 will make something true. with the addition of bool let's be strict. lol you talk about breaking some code. hey hey we need the jobs anyway. lol

we may as well dump static arrays all together.
#define is gone and I kinda liked it. well soon to be gone. πŸ€·β€β™‚οΈ
#define yes 1
#define no 0

const int yes = 1;
const int no = 0;
--- or ---
const bool yes = true;
const bool no = false;

oh my! yes I guess one just needs to think. lol, lol

I'm reading a book on C++ and the author I think has gone a bit over board with 'declare a variable right before you need it'. to me it makes the code feel hacked. like, I'm programming while I type, so oh yeah I need this so let me stick it in. plus it, to me, makes the code harder to read. hard to get the overall thought cause he keeps pulling rabbits, variables, out of his hat, so to write. πŸ€¦β€β™‚οΈπŸ™ƒ memory is plentiful and cheap, relatively speaking.

πŸ˜‡

Keith Thompson

unread,
Dec 19, 2022, 1:03:13β€―PM12/19/22
to
"gdo...@gmail.com" <gdo...@gmail.com> writes:
> should be consider a function not an operator?
[...]

No, sizeof is an operator. A function cannot take a type as an
argument, nor can it fail to evaluate its argument(s).

The sizeof operator seems odd because its symbol is a keyword rather
than a punctuation symbol.

--
Keith Thompson (The_Other_Keith) Keith.S.T...@gmail.com
Working, but not speaking, for XCOM Labs
void Void(void) { Void(); } /* The recursive call of the void */

Juha Nieminen

unread,
Dec 19, 2022, 1:13:20β€―PM12/19/22
to
gdo...@gmail.com <gdo...@gmail.com> wrote:
> should be consider a function not an operator?

It's no more a function than eg. 'return' is. It doesn't even
require parentheses (at least for expressions).

In C++11 it could theoretically be a function, but not prior to that,
nor in C, because it needs to be evaluated at compile time.

Tony Oliver

unread,
Dec 19, 2022, 7:35:38β€―PM12/19/22
to
You are fir and I claim my Β£5.

Γ–ΓΆ Tiib

unread,
Dec 20, 2022, 4:37:02β€―AM12/20/22
to
On Monday, 19 December 2022 at 19:12:37 UTC+2, gdo...@gmail.com wrote:
>
> hey and if we are going to have revisions how about adding yes and no, we now have true and false.

The "true"/"false" sound most neutral, abstract and mathematical. Every other
dual meaning like "yes"/"no", "on"/"off", "in"/"out", "is"/"isn't", "correct"/"incorrect",
"enabled"/"disabled" etc. are context-dependent and confusing in other context.
As we have boolean it is pointless to add those others to language for confusion.
0 new messages