mroughan / LinePicking

Numerical code for geometric probability problems, in particular density functions for the "line picking" problem.
0 stars 1 forks source link

The C keyword "return" is not a function call !!!! #11

Closed lamestllama closed 12 years ago

lamestllama commented 12 years ago

So it doesn't need go be written as if it is one!!!

i.e., we don't need to write

return (-1);

we can simply write

return -1;

Can we stop doing this please?

mroughan commented 12 years ago

Why does it matter (I ask out of interest)?

On 28/08/12 12:12, Eric Parsonage wrote:

So it doesn't need go be written as if it is one!!!

i.e., we don't need to write

return (-1);

we can simply write

return -1;

Can we stop doing this please?

— Reply to this email directly or view it on GitHub https://github.com/mroughan/LinePicking/issues/11.

lamestllama commented 12 years ago

The main way people learn to code is by example. The more examples that exist that write it as if it were a function call the more people will erroneously believe it is.

The way people understand how the code generated by the compiler is impacted by this. Think through what the compiler would need to generate in each case.