O'Reilly logo

Code Craft by Pete Goodliffe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Get Thinking

A detailed discussion of the following questions can be found in the "Appendix A" section on page 474.

Mull It Over

  1. Are these good variable names? Answer with either yes (explain why, and in what context), no (explain why), or can't tell (explain why).

    1. int apple_count

    2. char foo

    3. bool apple_count

    4. char *string

    5. int loop_counter

  2. When would these be appropriate function names? Which return types or parameters might you expect? Which return types would make them nonsensical?

    1. doIt(...)

    2. value(...)

    3. sponge(...)

    4. isApple(...)

  3. Should a naming scheme favor the easy reading or easy writing of code? How would you make either easy?

    1. How many times do you write a single piece of code? (Think about it.) How many times do you read it? Your answers should give some indication ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required