Thread: Why I hate c
View Single Post
  #14   Spotlight this post!  
Unread 26-02-2004, 19:05
velocipenguin velocipenguin is offline
Registered User
#0246 (Overclocked)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Boston, MA
Posts: 77
velocipenguin is on a distinguished road
Send a message via AIM to velocipenguin
Re: Why I hate c

C is one of my favorite languages. While it can be VERY unforgiving at first, it's not too difficult once you get used to the language. I used to make lots of simple errors (forgetting parentheses, failing to end statements with semicolons, etc.), but the frequency of that sort of error decreases significantly once correct C syntax becomes habitual. C is tremendously powerful without being nearly as arcane as assembler; it allows one to easily combine useful low-level operations with high-level procedural and algorithmic code in a syntax that's clear and human-readable. It took me a long time to get used to C, but I now find that it's my language of choice for many programming tasks. Don't blame the language because you made an error. Certain errors may look like obvious mistakes once you find them, but those errors are often similar or identical to operations that one might perform in order to obtain useful results.

For example:
Code:
if(file_handle = fopen("foo.bar","r"))
{
       herr_doktor_function();
}
That's a valid use of the single equality sign in a conditional. It checks to make sure the fopen was successful before executing herr_doktor_function. This could be written in a slightly clearer way, but it's a good example of why C has such lenient error-checking.

Last edited by velocipenguin : 26-02-2004 at 19:15.