c
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
c [2015/12/31 02:28] – [Return an error code] admin | c [2015/12/31 02:32] – [Use goto] admin | ||
---|---|---|---|
Line 12: | Line 12: | ||
Do it even when it looks stupidly simple - later, when the routine is made more elaborate, then the logic is in place and you will remember to cleanup: | Do it even when it looks stupidly simple - later, when the routine is made more elaborate, then the logic is in place and you will remember to cleanup: | ||
- | < | + | < |
/* @return 0 if file is foobarable. Otherwise 1. | /* @return 0 if file is foobarable. Otherwise 1. | ||
*/ | */ | ||
Line 85: | Line 85: | ||
Functions must fit on a single editor page. OK I have a hi-res screen and get 70 lines on it, but that's OK. I also stick to K&R code layout (as above) so more context fits on a single screen. | Functions must fit on a single editor page. OK I have a hi-res screen and get 70 lines on it, but that's OK. I also stick to K&R code layout (as above) so more context fits on a single screen. | ||
====valgrind==== | ====valgrind==== | ||
- | You're not done until valgrind says you're done!! | + | You're not done until valgrind says you're done and your program leaks no memory!! |
====Keep it simple==== | ====Keep it simple==== | ||
- | As Kernighan' | + | As Kernighan is reputed to have said, debugging (and tuning) is twice as hard as coding so if you code to the limit of your ability, then by definition, |
====Have it reviewed==== | ====Have it reviewed==== | ||
- | I've learned so much from having others (contructively) critique my code. | + | I've learned so much from having others (constructively) critique my code. |
====Links==== | ====Links==== | ||
Here's someone who thinks the same way: | Here's someone who thinks the same way: |
c.txt · Last modified: 2020/10/17 03:05 by 114.119.151.1