How to pass a struct to a function

B

Beej Jorgensen

Al Balmer said:
Did you trim the part I replied to for the sole purpose of making the
above remark seem sensible?

Yup! It was a play off the way you trimmed Bill's post to make, "Are
you commenting on Keith's signature block?" seem sensible. I thought
you were joking about that--forgive me if I was mistaken.

But I did, in my defense, put a winky face up there.

Ah, but it's too nice a day out for all this. Let's forget it. I owe
you a pint.

-Beej
 
A

Al Balmer

Yup! It was a play off the way you trimmed Bill's post to make, "Are
you commenting on Keith's signature block?" seem sensible. I thought
you were joking about that--forgive me if I was mistaken.

Of course not. I though my intentions were clear - Bill's reply made
no sense in context, and I echoed his phrase in an attempt to make it
clear what I was referring to. Apparently I failed. Probably due to my
lazy habit of trimming by paragraph, even when it really shouldn't
have been a paragraph :)
But I did, in my defense, put a winky face up there.

Ah, but it's too nice a day out for all this.

Actually, it's still cold here in Phoenix - only 68 F. But the sun is
shining, and it will warm up tomorrow.
Let's forget it. I owe
you a pint.

I don't think we have pints here. A couple of mugs will do.
 
C

CBFalconer

Ben said:
Doesn't a closing brace at the left margin, on an otherwise blank
line, do the same thing? I would suspect that making the line
longer actually makes it harder to see the end of a function,
because then the form of the line is less distinct.

Not to me. It also serves to identify the immediately northward
function, if I want to scan its code.
 
C

CBFalconer

Al said:
.... snip ...


I don't think we have pints here. A couple of mugs will do.

Yes we do. They just aren't normally used for beer, and are
considerably smaller (about 20%) than an Imperial pint. About a
half-litre. :)
 
R

Richard Heathfield

Beej Jorgensen said:
I'm with Chuck on this one. There are blank lines all over the code.
While it is certainly possible to see the start of the function no
matter how much whitespace is about, having a horizontal comment in
there REALLY makes it stand out and, IMO, doesn't detract from
readability.

And I'm with Chris. If it's an unadorned closing brace in column one,
it's hard to see what else it could be but a function-closing brace (in
any sane layout style). And if I desperately want to know which
function and it isn't immediately obvious, % takes me right there. In
any case, in many code shops nowadays you can easily tell when a
function ends because it's followed by something like this...

/***************************************************************
*
* function: foo
*
* author: J Random Programmer
*
* date: 2 June 1856
*
* purpose: frobnitzes bar quotients to get mean quux ratio
*
* etc etc etc.
 
C

Chris Dollin

Beej said:
I'm with Chuck on this one. There are blank lines all over the code.

Not in my code. (I don't mean I don't have them; I mean that their
appearance is strongly constrained. In particular, they separate
big things -- like not-inside-a-function definitions and declarations --
and make an appearance in functions when there are big switches.
Switches don't happen much, so in general my function bodies contain
no blank lines, and my rule of thumb is "if a function is so big that
it needs blank lines, it's big enough to split into smaller functions".)
 
R

Richard Heathfield

Chris Dollin said:

Switches don't happen much, so in general my function bodies contain
no blank lines, and my rule of thumb is "if a function is so big that
it needs blank lines, it's big enough to split into smaller
functions".)

Heh - well, that's one way of looking at it.

But you made me wonder what Usenet articles would be like if we split
our articles into paragraphs and submitted each one separately.

Okay, so in some cases that would actually be an improvement. :)
 
A

Army1987

Beej Jorgensen said:
I'm with Chuck on this one. There are blank lines all over the code.
While it is certainly possible to see the start of the function no
matter how much whitespace is about, having a horizontal comment in
there REALLY makes it stand out and, IMO, doesn't detract from
readability.

If you really have code with a closing brace on column 1 on an otherwise
blank line, immediately followed by a completely blank line, anywhere else
but at the end of a function...

And a comment such as /* -------------------- */ looks very silly to me.
 
R

Richard Bos

Beej Jorgensen said:
This has not been true for many months. Google Groups in its stock
configuration makes quoting as easy as it is with any other newsreader.

Imprimis, the still too vast number of quoteless Google posts on Usenet
belie this theory; secundis, even when you do, you still get those
strange and irritating "-- hide quoted text --" markers pasted _into_
the post, which is a clear sign of incompetence; and all the worse
because they come in many different languages; and quite unacceptable
because they are partly pasted into the _quoted_ text, making it appear
to those who are not aware of Google Groups Beta's depth of brokennes as
if the quoted poster had written that nonsense.

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top