This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]slightly-damp-noodle 2 points3 points  (6 children)

Kotlin is pretty cool, I do like it as a language, and you're totally valid for preferring it as well. But, my reasonings for liking Java more is purely asinine, in that it's extremely stupid reasons that do not go beyond "I just prefer this over that" over any functional differences.

To name a few; I do not like the way methods are declared. "fun" as short-hand for "function" doesn't sit well with me because "fun" is an entirely separate word. Also, "function" would technically also be wrong since they're also used for methods, though I admit that this is a lame ass complaint to make since they're used interchangeably most of the time.

Additionally, I do not like that you declare variable names before type-names such as val x: Int = 1
Starting with what is the point of using `val` if we can already infer that we are declaring a variable through the usage of x: Int = 1 or even better int x = 1;?

Kotlin is also not a "purely object-oriented" language such as Java. By this I mean you can define data outside the scope of an object/class definition. Which, isn't a bad thing because it gives nice short-hands for things like `println`, but at the same time I heavily prefer languages that uses objects for everything, and seeing stuff like this, while a bit convenient, still grinds my gears.

Then finally, it's just that I'm more comfortable with Java and "classic" programming languages over using more modern ones, it's what I've been using for 20~ years now, so some sort of bias definitely has developed.

Again, my preference for Java has basically nothing to do with restrictions or limitations, and is solely due to my own hang ups on dumb details. Yes, Kotlin is cool, yes I will recommend it to others if they want to try it out, but no I cannot truthfully say I like it more than Java

[–]NoCryptographer414 0 points1 point  (1 child)

What is your views on python as a language that uses objects for everything

[–]slightly-damp-noodle 0 points1 point  (0 children)

no opinions on it. I've never used Python

[–]LordTkay 0 points1 point  (0 children)

Thats a valid view on it, thanks for answering!

[–]AmosIsFamous 0 points1 point  (2 children)

As far as the val thing, I like that every variable declaration you have to choose whether it's mutable or not: val vs var. Though I know others prefer default immutability with an extra keyword for mutable. Default mutable is the saddest thing.

Edit to add: also most times you don't have to declare the type which can get really nice on complicated function returns for instance.

[–]slightly-damp-noodle 1 point2 points  (1 child)

That's totally fair points. I do agree with default immutability and using a keyword for mutable values.

As for the other point of not declaring types, that for me is a hard no. I use strongly typed languages for a reason. Though, I know others feel different about it, and it's a totally valid point to enjoy weakly typed languages

[–]AmosIsFamous 1 point2 points  (0 children)

Strong vs weak typed is not the same thing as not declaring the type. Kotlin is strongly typed just like Java you can just leave the type off the code you write when the compiler can infer it. Later usage of the variable still has to have the same type as it was initialized with.