Sunday, January 1, 2017

Happy New Year! Welcome, 2017! Welcome Back!


/* Happy New Year - This program uses a function two display a message to
   my visitors. */

#include "Utility.h"

/* Prototype: Display greeting */
void displayGreeting();

int main()
{
   /* Call: displayGreeting */
   displayGreeting();

   pauseSystem();
   return 0;
}

/* **********************************************************
   Definition: displayGreeting

   This function wishes all my visitors a HAPPY NEW YEAR
   ********************************************************** */
void displayGreeting()
{
   cout << "HAPPY NEW YEAR!\n";
   cout << "新年おめでとうございます!\n";
   cout << "Pase yon bon nouvel àne!\n";
   cout << "Gelukkige nuwe jaar\n";
   cout << "Bonne annèe\n";
   cout << "Ein frohes Neues Jahr!\n";
}

Last year I made a promise not to start working on chapter 6 until after new year has begun, and obviously didn't keep it ... Then again, it wouldn't be me to take a break, so i started with this chapter the very next day i uploaded my last blog-post. Above code fits the topic perfectly. Functions, functions everywhere ... Lots of new terminology such as parameters, arguments, and so forth. The first two or three sub-chapters were illuminating, as i could clearly see how functions might make life a whole lot easier when used correctly. Then, around sub-chapter 6.5 my mind drew a blank, what with all the new concepts, and how-to-do-this-how-to-do-that, when-to-use-this-when-that ... I still managed to work my way through the Review Questions and Exercises, the Algorithm Workbench, and to solve the first two Challenges.

A New Chapter, A New Year, A New Commenting Style


I must confess that my code comments were too painstakingly long and detailed ... My intention was all good, it just got a little overboard. It is one thing to make clear what parts of the code do, while writing the code it helped me to understand, and when looking at my code I thought it would help others who learn as well. This has now changed. I still write comments, but they are more to the point, yet still helpful in understanding what goes on in my code.

Enough of words, time for more coding action! Back to the drawing ... err-IDE-board. 

No comments:

Post a Comment