/*============================================
FirstLine
displays the first line of the message
============================================*/
void FirstLine (void)
{
cout << "Welcome to BIS4221:\n";
}
Note the following about the layout of this function.
void FirstLine (void)
{
cout << "Welcome to BIS4221:\n";
}
Other people prefer to put the opening brace on the same line as the function, like this:
void FirstLine (void){
cout << "Welcome to BIS4221:\n";
}
Personally, I prefer my way of doing it, but it's all a matter of taste. The three schemes shown above are all identical to the computer and equally acceptable. What is not acceptable, however, is to use inconsistent layout styles or, worse, no layout at all. For example, I could have arranged the function FirstLine like this:
void
FirstLine (
void) {cout
<< "Welcome to BIS4221:\n";
}
and the program would still work. I hope you will agree that this is much more difficult for a human reader to follow.
Start as you mean to go on
From the very first programs you write, even if they are only a few lines long,
you should get into the habit of adopting a consistent layout.
©1994-2003 Kevin Boone, all rights reserved