This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
ch03-places-to-put-things [2017/08/24 02:02] mithat [Variable initialization] |
ch03-places-to-put-things [2017/08/24 02:03] mithat [Potential pitfalls] |
||
---|---|---|---|
Line 380: | Line 380: | ||
char firstInitial, secondInitial; | char firstInitial, secondInitial; | ||
</code> | </code> | ||
- | declare two variables---''%%firstInitial%%'' and ''%%secondInitial%%''---which are both character types. Notice the comma between the two variable names. | + | declare two variables, ''%%firstInitial%%'' and ''%%secondInitial%%'', which are both character types. Notice the comma between the two variable names. |
You can even combine variable initialization and multiple declaration in the same statement: | You can even combine variable initialization and multiple declaration in the same statement: | ||
Line 389: | Line 389: | ||
==== Potential pitfalls ==== | ==== Potential pitfalls ==== | ||
- | Syntactic sugar can be a tricky thing. On the one hand, syntactic sugar makes it easier to write your programs---it increases **writability**. When done right, it also makes programs easier to read--it increases **readability**. However, when a language has too much syntactic sugar, then the number of ways to express the same idea increases to such a level that it ends up making it //harder// to read--because the reader has to know all the intricacies of all the different possible ways of doing things. | + | Syntactic sugar can be a tricky thing. On the one hand, syntactic sugar makes it easier to write your programs---it increases **writability**. When done right, it also makes programs easier to read---it increases **readability**. However, when a language has too much syntactic sugar, then the number of ways to express the same idea increases to such a level that it ends up making it //harder// to read because the reader has to know all the intricacies of all the different possible ways of doing things. |