swcai's blog

By swcai, 14 years ago, In English
I think one major difference of CodeForces.com from other ACM and programming contest is the support of python, ruby, php, haskell and etc. It makes things more interesting. But from my observation, few people used these new languages. Part of the reasons is people in the community are not familiar with these languages and some of the languages are hard to debug. And another reason, I believe, is CodeForces.com measures the submission with same criteria, same memory limits, same time limits. But the performance of the language are very different. It makes it impossible practically. Probably codeforces.com could consider to give different criteria for different language, based on some kind of language performance benchmark. This could encourage people to use different language and be more fair.
  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
14 years ago, # |
  Vote: I like it +3 Vote: I do not like it
Good idea! Can you help me? I wrote some language microbenchmark program. Currently I've implemented in on C++ and Java. Can you help me with other languages? Rewrited code should be one-to-one translated on other language and should do exactly the same things. Console output actually ignored, but it is good to see it.
14 years ago, # |
  Vote: I like it 0 Vote: I do not like it
Does the world programming contest accept these programming languages (such as PHP, Python, Ruby, etc.), because my region site does not?
14 years ago, # |
  Vote: I like it -16 Vote: I do not like it

In my opiniton the languages such as php, ruby, python etc. should not be allowed... Because it very hard to challenge the solutions wich are being written in these languages for those who don't know them (languages). For example, I can write code in C++ and Pascal. Also I usually able to understand Java code. But I understand nothing in PHP, Ruby etc., because they strongly differ from usual languages (I mean C/C++, Java and maybe Pascal). And it caused a problem for me in CF Alpha Round 20. Surely, the same problem had some of the other competitors.

Moreover, almost all the participants who use these languages also can write code in one (or more) of usual languages. So I think it's not necessary to accept the languages such as PHP, Ruby etc in such type of contests (with challenging).

It's only MY opinion, though. I can discuss this problem with those who don't agree with me.

  • 14 years ago, # ^ |
      Vote: I like it +26 Vote: I do not like it
    I like your logic "I don't know Python, forbid it" :o)
    By the same logic Pascal definitely should be forbidden, because
    1) It's syntax is completely different from C++-style languages and tough for understanding
    2) It's used (and, I believe, known) by much fewer number of programmers over the world than Python

    Even if I know 10 languages, it doesn't mean that I can effectively solve problems on all of them.
    If you don't want to improve your skills by learning at least basics of those languages, it is definitely your problem, and, moreover, it is bad for you in first place. Let me explain why.
    First of all, lets exclude PHP from this discussion, as it is C++-like language, and if you understand C++, you should understand PHP code as well.

    If you don't know Haskell (or any functional language at all), then you don't understand functional paradigm, and without understanding it I don't think you will succeed in new era of programming languages, when list comprehensive and lambda functions are becoming available in more and more languages (even new version of C++ contains lambda functions).

    If you don't know Python/Perl/Ruby/ some other scripting language, then basically you know, how are you going to solve some practical problems when you need to let's say to download 20 pages from web and extract some data, or to do some stuff with files on your machine.

    In other words, I don't say that every person must know all the languages and feel comfortable coding in all of them. But understanding of basics of functional programming, as well as knowing at least one scripting language, is reasonable, and it makes your concern meaningless
    • 14 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      > I like your logic "I don't know Python, forbid it"

      Firstly, it's a suggestion, not a requirement. Secondly, I think I'm not the only one who "I don't know Python".

      > By the same logic Pascal definitely should be forbidden

      Yes, maybe that's right. I didn't say Pascal must be allowed.

      > If you don't want to improve your skills by learning at least basics of those languages, it is definitely your problem, and, moreover, it is bad for you in first place.

      Agree. But while competing in CF first of all I want to improve my algorithm skills. CF is algorithm contest (or not?). Anyway, CF problems require algorithmic knowledge but not knowledge of different languages. And the fact that people use the languages such as Python sometimes prevents to improve algorithm skills.

      > But understanding of basics of functional programming, as well as knowing at least one scripting language, is reasonable, and it makes your concern meaningless

      I agree that it is reasonable. But it's not the aim of CF, is it?

      To sum it up, I want to say that first of all CodeForces is an algorithm competition. And it has challenging wich is the main advantage. For this reason, diversity of accepted languages is a disadvantage, imho.

      Anyway, I don't mind if you prove that I'm wrong.

    • 14 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      I used to be that way, that C++ was the best language and no other deserved my time. Then I learned python in some free time, and realized how wrong I was. Now I'm trying to learn Haskell, but I have to way until another free-time slot.
  • 14 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it
    In Alpha round #20 I wrote 3 solutions in 3 different languages (Ruby, Java and C++) just because it was more convenient. Although I could write the solution of A in some other language, but it would be slower and more error-prone. That's the main advantage of being a polyglot, not the ability of others to hack you.

    Let me draw an analogy. Suppose you aren't aware of some feature in a language you already know. (Variadic parameter list in Java or something.) If you see it in some solution, what will you do? I suppose, you'll learn about it and later, perhaps, will use it when it's convenient. The same thing with multiple languages.
    • 14 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it
      Yes, there are some advantages of the diversity of accepted languages. But it has a big disadvantage: it makes challenging opportunity less meaning. It's much easier to know 2 or 3 languages (and their features) than 7 or more.
      • 14 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it
        I think most solutions will still be in common languages, because people know them better.
        • 14 years ago, # ^ |
            Vote: I like it 0 Vote: I do not like it
          Most but not all of them. The solutions in other languages will rarely being hacked. For example, for the same reason code obfuscation is forbidden. (It's only an example, I don't equate code obfuscation and usage of different languages)
          • 14 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it
            And what if I use a rare algorithm that is easy to code but hard to prove? It presents the same problems. Should I be banned because I know this algorithm and use it, but others don't?
            • 14 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it
              Not that I think that GeLo is right, but what you say is defenately problemsetter bug
            • 14 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it
              If you use a rare algorithm then it's cool because you have advanced knowledge in algorithms. CF is algorithm programming contest, so it's not the same problem.
              • 14 years ago, # ^ |
                  Vote: I like it 0 Vote: I do not like it
                Please see what I replied below, CF is not only algorithm contest.
          • 14 years ago, # ^ |
              Vote: I like it 0 Vote: I do not like it
            To summarize what I think: it's already important to know language features during the hacking. Introducing 'rare' languages makes it only a little more important, since you'll rarely see them anyway.
            Code obfuscating, on the other hand, would be much more common, it can even be automated :)
            • 14 years ago, # ^ |
                Vote: I like it 0 Vote: I do not like it

              Well, pehraps you are right, although I don't agree with you. This conversation may be endless. You say that CF is not only algorithm contest while I say that it is. Seems most of people don't agree with me, so I won't continue this meaningless discussion. I don't want my contribution to be under -100 :)

              Anyway, I don't think my suggestion was so stupid that nobody agreed.