Why new programming students aren't fairing well.
It has amazed me how poorly prepared students are for the more advanced programming classes I've taken, but recently I've had to go back and take a basic C course for my degree. Now I know why.
I thought I'd share some of my instructor's thoughts on C with you all.
int b = 5;
-b++ //will evaluate to -6 AND b will have -6 as its value after the expression
3. Any variable declared in main() is in scope in any function if it is written below main.
(a + b)++ //is apparently a valid expression
4. Functions should never return anything but exit status. Goodbye float, char, pointer, struct, etc. functions. And 0 means no error.
5. Formal parameters in a function definition are not local variables to that function, they are merely aliases to the actual parameters. They produce no overhead in other words. (Yay for infinite recursion).
6. For loops are counting loops, while and do/while are conditional. For loops are more efficient because of this.
7. Never, ever, ever use break or continue. ( I'm sure there are others who feel the same way on this ).
More to come, I'm sure. Sadly, after 10 weeks, the class has seen probably 30 lines of code all told.