Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

kirjuri's blog

By kirjuri, history, 10 years ago, In English

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!

  • Vote: I like it
  • +7
  • Vote: I do not like it

| Write comment?
»
10 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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.

»
10 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

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

  • »
    »
    10 years ago, hide # ^ |
     
    Vote: I like it -25 Vote: I do not like it

    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
    
»
10 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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