Reply to post: C considered harmful

When customers try to be programmers: 'I want this CHANGED TO A ZERO ASAP'

MacroRodent

C considered harmful

One strand in many programming horrors is that they are in C. I know C well, have used it almost daily around 25 years, used to love it, but now believe it should be used only by specially licensed people, or not at all. The reason is NOT that it allows low-level access, buffer overruns etc, but because its syntax and semantics are chock full of completely unnecessary pitfalls (many of which have unfortunately been inherited by its successors like C++, Java and Javascript). Don't believe? Quick, what does this totally valid fragment of C print:

typedef enum {val1, val2, val3} mytype;

mytype var = val2;

switch (var) {

val1:

puts("1"); break;

val2:

puts("2"); break;

val3:

puts("3"); break;

}

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon