Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
C Syntax
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="C# Learner, post: 1712071"] I believe that I appreciate the reasons for these features. What I'm saying is that I think that there are better (in terms of allowing the user of the language to write readable code) alternatives that could have been implemented instead. a) Valid C syntax: if (foo && bar) { foobar(); } b) Similar code to the above but using my suggested syntax changes: if foo && bar: foobar(); Why wouldn't (b) be feasible here? Everything from 'if' to ':' is considered the condition. After the newline after ':', whitespace is required to form a code block. The only way in which they seem odd to me is that they make code much less readable than it could be, in my opinion. Okay, if you don't agree with the 'if'..':' idea, then how about changing the parentheses required for test conditions for a different pair of characters? An ideal pair would be a pair that isn't used elsewhere in the language, for readability's sake. My point is that a different construct could be substituted in each case. So those who invented C's syntax are necessarily brighter than those who invented, say, Python's syntax? I honestly wonder what that reason is. Regards [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
C Syntax
Top