Best Practices for Programming in C
An anonymous reader writes "Although the C language has been around for close to 30 years, its appeal has not yet worn off. It continues to attract a large number of people who must develop new skills for writing new applications, or for porting or maintaining existing applications. This article provides a set of guidelines that can help you with your coding."
Whitespace
"When a ball dreams, it dreams it's a frisbee"
If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
Here is a much better article about coding practices. It also covers broad topics, not just C in specific.
Oh what enlightenment!
- When you've learned all there is to know about C, find out how to simplify it a bit in C++. Notice the job security and look of awe when you master the ++.
- After mucking around in these low-density languages, step up to Perl and see how a language built by a task-oriented person stomps one built by a system-oriented person. See your project file sizes shrink before your very eyes!
- Now take your newfound magic ability to learn new languages and apply it to whipping out pages with PHP and MySQL for all your friends quickly! You'll be the talk of the C crawlers crowd! Hey! Gimmie some content! Aw, forget it - let me just play!
- Now plumb the depths of (supposed) machine-independent laguanges by writing some Java and finding out what "Sun-certified" means! (hint: Sun owns it)
- Optional: Head back to school to get a PhD in autoprogramming theory and self-construction methods. Sequester yourself away to your dorm room for endless hours of experiments training a neural net to convert tasks to code using the most efficient method possible.
- Finally, wrap up your technical life by examining all these related language nuances holistically and achieve the zen of programming: "there is no language"
Ahem...
1. Indent properly.
2. Make Your code readable.
3. Use_good_variable_names.
4. Avoid buffer *overflows.
5. for (;;x = "Avoid using statements like goto.") {;}
Moneyed corporations, non-working 'poor' and criminal prisoners are turning productive citizens into tax-slaves.
No, sucky code is always left by bad programmers.
they probably left out some #define's that make it valid C :-)
Jilles
I prefer
while (*dest++ = *src++) malloc(1000);
how long until