Kevin Tew wrote:
> 1) *s should go right next to the type in function declarations and
> definitions
> 
> /* incorrect */
> do_thaw(Parrot_Interp interpreter, PMC * pmc, visit_info *info)
> /* correct */
> do_thaw(Parrot_Interp interpreter, PMC* pmc, visit_info* info)

Disagree. Consider:

char* foo ()
{
  char* str1, str2;
  ...
}

As compared to:

char *foo()
{
  char *str1, *str2;
 ...
}

I seen this error many times. Because of the way C associates the * with
the variable, not the type, you should write the code that way.

> 
> 2) All structs should be typedefed
> 
> 3) Single line if and elses are acceptable
> 
> /*old*/
>    if (!info->thaw_result)
>          info->thaw_result = pmc;
>    else
>          *info->thaw_ptr = pmc;
> 
> /*new*/
>    if (!info->thaw_result)  info->thaw_result = pmc;
>    else                               *info->thaw_ptr   = pmc;

Disagree. Subsequences should always be blocked.

if( ! info->thaw_result ){
  info->thaw_result = pmc;
}else{
  info->thaw_result = pmc;
}

Reasons:

1. It clear what is associated with what.
2. It's closer to what Perl does.
3. Statements can be added eaiser.

> 
> 
> 4) c89 allows declaration and initialization on the same line right?
> INTVAL counter = 0;
> 
> Kevin
> 


-- 
__END__

Just my 0.00000002 million dollars worth,
   Shawn

"For the things we have to learn before we can do them, we learn by
doing them."
  Aristotle

"Where you find the greatest fear, you find the greatest courage."

BRIAN: You're all individuals!
CROWD: We're all individuals!
LONE VOICE IN THE BACK: I'm not!

Reply via email to