Comparison : Java and K

| Tags: dev, programming-language

OK, I know nothing about the programming language K. So I won’t criticize K itself. What I want to talk about is the comparison of Java and K.

I don’t get it why people always think that if they need fewer lines to write a program in one language than in another that the said language is better than the other one. The comparison shows fairly clearly that this is no good metric for comparing programming languages. While the Java program takes up 37 lines of code and the K program only one, the K program is far worse to understand since it’s one line of curly parenthesis, other special characters and some variables. I can learn all those special characters for all those special functions I need only rarely. Do I want to do that? No! I prefer to know that a class contains a specific kind of functionality and that I can find those functions with the autocompletion support of my IDE if I need them.

I’d also surmise that refactoring the K program would be somewhat more difficult than refactoring the Java program. I prefer the Java program because of its better readability and extendability.

K has probably its fields of use where it’s far better suitable than Java. Definition of mathematical algorithms is probably one of them, but that’s not the point here. I have no need for a comparison of two languages that have totally different uses.

Please stop those “I can express this in X in 1 line of code where Y needs 100 lines of code, so X is the better language”. It’s boring.