Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×

Comment Re:because - (Score 1) 793

...I still don't particularly like C, mostly because I find the syntax clunky. Specifically...

* Semi-colon line endings are stupid--they serve little purpose besides making compilers easier to write

It's more than just for stupid compilers, otherwise a newline would serve that purpose as it does in other languages. Sometimes I like writing multi-line single statements (e.g. a function call with huge parameter count) and not have to conversely write a special character to denote a line continuation after carriage return.

* for (...;...;...) syntax is less intuitive than eg. VB.NET's "for a = 1 to 10" or numerous alternatives

Perhaps if you limit "for" to linear iterations. I kind of prefer the "for (init;true;post) ..." format as a clearer "init;while(true){...;post;}"

* declarations are unintuitive (and complicated; see post above for example)

True, #define, typedef, standard declares mix me up sometimes.

* I'm not fond of curly braces--I like Python's indentation better

I'm with you on this, if you want everything on its own line.

* Why make logical operators symbols instead of words?

The same reason mathematical ones are symbols, I suppose. It was logical ;) Real-world match actually uses symbols for logic as well.

* operator precedence can be unintuitive

There is a PEMDAS going deeper to include logic. Use parenthesis to make it stupidly clear if unsure.

* = vs. == causes bugs (many languages have the same trouble though)

Only for those coming from different-styled languages. The = as both a value assign and zero/nonzero check has come in handy many times, and shortens code both visually and compiled.

* comments (//) use two characters instead of one

Can't argue that. C and SQL are the only langs I can think of with double commenters.

* switch's use of break is worse than eg. Ruby's case statement with commas

(I have other issues, like disliking how many mundane details you have to specify in C compared to other languages, but you need a language like C for certain tasks and it'll need lots of mundane details to translate almost directly into assembly anyway.)

What's wrong with the break statement in switch? I like the comma listing cases over multiple stacked cases.

Slashdot Top Deals

Always draw your curves, then plot your reading.

Working...