IMHO, the only thing that makes C-style syntax popular is that most people know it. And thus, using C-style for a new language makes it possible to apply old habbits (like naming conventions). This is a good thing! Although I think, the syntax is the least concern for learning a new language. But a good syntax can help to avoid errors.
Microsoft did a lot of effort to make VB.NET as important as C# (remember all the "null (Nothing in Visual Basic)" in the MSDN, which quite annoys me), but still C# is the dominant language for the .NET platform. It seems that VB.NET has a problem with the bad reputation of its predecessors. And still, using C-style seems to make a more professional look.
After all, one of C's design goals was to make the compiler easy to implement. It was easier to use a preprocessor than defining a new language construct for constants. Or the semantics of a[5]. This does not apply to C++, which is very difficult to implement, partly because it tries to stay compatible with C.
Examples:
- Case sensitiveness, although case insensitivity is more natural to humans (NOT to computers). This doesn't mean that you should spell identifiers differently than they have been declared (beware!), but can lead to confusion. Real-world example (Java): getWhiteSpace() or getWhitespace()?
EDIT: Another nice example: What is the worst gotcha in C# or .NET?.
But of course, once you are used to it and with the help of an IDE, this isn't much of a problem anymore, sometimes even more natural because it resembles better how computers actually work.
Operator precedence
= for assignment and == for comparison. if (a = b) anyone? Similar, the && and &, || and |, (!
answered 2009-05-16T17:22:39.860