nor's blog

By nor, 2 years ago, In English
  • Vote: I like it
  • +136
  • Vote: I do not like it

| Write comment?
»
2 years ago, # |
  Vote: I like it -26 Vote: I do not like it

Bullshit.

  • »
    »
    2 years ago, # ^ |
      Vote: I like it +42 Vote: I do not like it

    Least you can do is act like an adult and explain what's wrong.

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Great blog.

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

The moment I read the title of the blog, I was anticipating rainboy pun.

»
2 years ago, # |
  Vote: I like it +32 Vote: I do not like it

While I really like C, and I have been using along with (or it instead of) C++, I think it must be said that C basically worse than C++ for competitive programming. People who use it instead of C++ are just doing it for the extra challenges.

That being said, wouldn't a worse version of C (C11) provide even more challenge, compared to a version without defects (C17)? There are solution for the defects in C11, so it's not like those are impossible to live with.

Personally I support the addition of C17 or newer C in the future, but I think C11 should not be lost for that to happen ("abandoned in favor of C17"). Once upon a time (pre 2017), C++98 and C++11 was available here, but they are now gone. From C++11 to C++14 there might not be much of a change, but from C++98 to C++11 is a massive different, some C++98 code wouldn't compile under C++11 for example. My reasons for preserving old versions of languages in general are:

  • It's better to have more options

  • Bureaucracy in onsite contests often means that newer versions of the language might not be available, personally, I have participated in onsite contests (in 2016-2017 or so) that only support C++98. Some contests also doesn't say anything about the version of the language (no feedback until the contest is over), so the best option is to write code that will compile and work in all the standards. Tldr: Some time people are forced to use old version of the languages, and it's good to have those version available for practicing.

  • »
    »
    2 years ago, # ^ |
    Rev. 3   Vote: I like it +26 Vote: I do not like it

    Thanks for the detailed comment.

    Regarding your first point, the main reason why I say that C is relevant is basically getting some sort of a handicap while coding, in the hope that it will force you to think more towards the solution rather than starting implementing it right away -- I find it very easy to do in C++ but not in C. Of course, in actual competitions (and training to make implementation faster), it is strictly better to use C++.

    The C11 defect reports I mentioned are mostly concerned with some rare weird behavior (and weird edge/ambiguous cases that needed to be ironed out), and are almost irrelevant for competitive programming, so it should be fine to have C11 (64 bit) in most cases. The reason I suggested using C17 for the new option on CF was that C17 has a more sane set of defaults in those edge cases (and fixing defect reports is in fact the only change that happens; no new features whatsoever). C is a much more stable language than C++, and the changes from C11 to C17 are nowhere near as significant as those from any revision of C++ to another.

    I agree with you on not removing C11 (but only adding C17 (64 bit) as a new option) -- I should have phrased that in a better manner.

»
2 years ago, # |
  Vote: I like it +25 Vote: I do not like it

Joke on you I'll just compete in Pascal.

»
2 years ago, # |
  Vote: I like it +45 Vote: I do not like it

Reading your "Why you would want to code in C" completely convinced me. That is, convinced me that I made the correct choice going for C++