Блог пользователя kirjuri

Автор kirjuri, история, 9 лет назад, По-английски

I have been experimenting with Kotlin lately, and it's a very simple and comfortable alternative to Java (at least in the scope of programming contests, I cannot find a case where some solution written in Kotlin would be uglier than the Java equivalent). Moreover, Codeforces supports Scala, which also runs on JVM, it's a much more expressive language with more advanced features, although they are useless for the competitive programming context: thus is makes more sense to add Kotlin (also|instead).

I would like to know what people think about it, and if I can contribute anyhow to make it possible, I would like to know as well. Thanks!

  • Проголосовать: нравится
  • +7
  • Проголосовать: не нравится

»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Totally agree! This way, we can learn not only coding skills but also a programming language on Codeforces. If possible, please also consider Julia too.

»
9 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Well, creating several dimension array (3d for example) is (or at least was) uglier than in Java

  • »
    »
    9 лет назад, # ^ |
      Проголосовать: нравится -25 Проголосовать: не нравится

    Why Java is ugly?

    C++:

    int threedim[5][10][4];
    memset(threedim, 0, sizeof(threedim));
    

    Java:

    int threedim1[][][] = new int[10][5][8]; // (1)
    int[][][] threedim2 = new int[10][5][8]; // (2)
    

    C#:

    double[,] twodim = new double[10,9];
    double[, ,] threedim = new double[10,9,5]; // (1)
    
    double[][] twodim2 = new double[10][]; // (2)
    for (int i = 0; i < twodim2.Length; i++)
    	twodim2 [i] = new double[5];
    

    Python:

    w, h = 8, 5. 
    twodim = [[0 for x in range(w)] for y in range(h)] # What the hell
    
»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

It would be a great idea. It was already supported in the surprise language contest before so it won't be a huge work :D