Live data from Hacker News

Kotlin Is Better

steve-yegge.blogspot.com

131–140 of 229 posts

Re: Kotlin Is Better

#131

Is there reason to choose Kotlin if you don't already live in the Java world? Put another way, is it a language that makes living in the Java environment less painful, and thus only of value to people who continue to need to live in the Java world? Why would someone who has never programmed in the Java ecosystem use Kotlin? I'm surely ignorant and prejudiced but when I read this I thought "Hey why not try Kotlin?", t…

You can compile Kotlin to Javascript, as a start. You get the benefits and drawbacks of static typing and object-oriented (or rather "class-oriented", if we call Javascript object-oriented) programming support.

But if you choose to stay with the JVM, you get:

- the JVM - multithreaded, highly tuned and high performance JIT VM, well documented and continuously being improved

- mature tools

- libraries from the Java ecosystem - for pretty much anything you can think of

- coroutines (with Kotlin 1.1) for async support.

XML configuration is being phased out slowly (I guess you are talking about Spring here), in the last ~10 years annotations have become much more popular. You still have to support those legacy apps though.

This made me laugh: "then I thought of Java and images came up in my head of thousands and thousands of files being installed" - well, don't check your node_modules directory then, or you might be in for a surprise :)

Re: Kotlin Is Better

#132
post #131

Is there reason to choose Kotlin if you don't already live in the Java world? Put another way, is it a language that makes living in the Java environment less painful, and thus only of value to people who continue to need to live in the Java world? Why would someone who has never programmed in the Java ecosystem use Kotlin? I'm surely ignorant and prejudiced but when I read this I thought "Hey why not try Kotlin?", t…

You can compile Kotlin to Javascript, as a start. You get the benefits and drawbacks of static typing and object-oriented (or rather "class-oriented", if we call Javascript object-oriented) programming support. But if you choose to stay with the JVM, you get: - the JVM - multithreaded, highly tuned and high performance JIT VM, well documented and continuously being improved - mature tools - libraries from the Java ec…

> You can compile Kotlin to Javascript

Java (GWT) has been compiling to JS years before Kotlin was even a twinkle in JetBrain's eye.

I can't think of a language that doesn't compile to JS.

Re: Kotlin Is Better

#134

Is there reason to choose Kotlin if you don't already live in the Java world? Put another way, is it a language that makes living in the Java environment less painful, and thus only of value to people who continue to need to live in the Java world? Why would someone who has never programmed in the Java ecosystem use Kotlin? I'm surely ignorant and prejudiced but when I read this I thought "Hey why not try Kotlin?", t…

For certain classes of problems the JVM just cannot be beat. Its a phenomenal bit of tech that laps the competition, especially with regard to large data sets, concurrency support, and instrumentation. Unfortunately, Java the language is fairly painful to work in (less so every release but still). Kotlin makes that particular problem less of an issue.

Even in plain Java though, your description of "the vast, lumbering Java engine cranking slowly and chugging and masses of XML configuration up the wazoo for everything" is largely only applicable in Enterprise software. Modern Java shops tend to eschew all those things and have for quite some time.

Re: Kotlin Is Better

#135

Earlier quoted context omitted.

Scala IDE support is bad? What IDE are you using? I find IDE support in IDEA almost on par with that of Java. It is very fast, has accurate error highlighting, very good smart autocomplete, understands advanced Scala features, supports most refactoring I care of, but most importantly works reliably.

I've used IntelliJ for Scala some time and did encounter way more IDE bugs than in Java. I think JetBrains did a good job, but Scala is not engineered towards tool support. That is one big flaw of the language. Kotlin is much more pagmatic (not only) in this regard, what is no surprise coming from a tool vendor.

I also encountered way more IDE bugs in Scala than in Java. Actually during the full last year of development of a real-world commercial Scala project I encountered 0 bugs in Java and 2 bugs in Scala.

What about more objective measures? Scala plugin issue tracker: 11667 issues. Kotlin plugin issue tracker: 17664 issues.

And this difference is despite Scala being longer on the market and being more popular than Kotlin.

It looks like Scala IDE support is actually better than that of Kotlin.

Re: Kotlin Is Better

#136
post #37
post #20

I've started to come around on a similar thought recently, after a few years avoiding static typing in python. I've been toying with C# specifically. C# with visual studio is, I think, the most productive environment I've come across in programming. It's ergonomically sound, straightforward, and the IDE protects me from all sorts of relevant errors. Steve mentioned Intellij is a bit slower than he'd hope typing somet…

> Sometimes they do exactly what you need, and 70% of the time they're just totally useless. I thought that but PyCharm scores way better than 70%. I even trust it to do automatic refactors. Sometimes... > The zippiness on reaction to my typing is another huge deal. If it's anything other than instantaneous, then I notice my editor in a negative light. Maybe I grew up on IDE's but I type stuff in full only if autocom…

I think part of that is that PyCharm is a JetBrains product. Those guys are the preeminent IDE makers out there at this point. Even Visual Studio is playing catchup to the stuff that they've been offering for years with ReSharper, and Rider is making a compelling case at becoming the best C# editor out there.

I cringe when I have to deal with one big legacy product of ours that still hasn't been converted from a Eclipse project to IntelliJ; it's an order of magnitude more painful to work with.

Re: Kotlin Is Better

#137
post #40

Earlier quoted context omitted.

I think I'm pretty sensitive to even a minor typing delay. That's not necessarily true for everybody, but it irks me. > I even trust it to do automatic refactors. Sometimes. Function extract refactors and the like are definitely within the realm of possibility. Once you want to refactor code across many files it becomes a lot harder in dynamically typed code, for sure. I guess for a long time I sort of had this view…

More often snippets like this can be even more straightforward: var somestuff = from x in someList where x.Id > 7 select x.Name

Except when you have to wrap it in parentheses and tack a .ToList() onto the end of it, or use something outside the subset that the query syntax supports, it starts looking considerably more ugly than chaining the functions together.

Re: Kotlin Is Better

#138

Earlier quoted context omitted.

But the thing is if you modify your habits, it's so much more efficient than most other languages. It's reasonable to have to learn knew coding style when paradigm-shifting languages. Why isn't it reasonable for there to be other new behaviors as well?

Because there are other languages, which also provide the benefits, but without these downsides.

Which ones?

Re: Kotlin Is Better

#139
post #71

Earlier quoted context omitted.

They're different ways of programming -- it's where you spend your brain power. You can see codebases that weren't built in IDEs: they generally don't have strong naming conventions in their classes/structures/functions. One of my hobby projects is in C, and I prefer using an editor to an IDE. Because of an accident of history, public methods tend to be named like `P_PlayerCommandRead`, where `P` means (generally) "p…

More recently I've come to the conclusion that most of naming must be influenced by "how you grew up". As someone who has mostly touched the Java and Python ecosystems while learning to program, I frequently run into names that seem "weird" to me, because they replace often-used technical words (from those ecosystems) through more obscure synonyms. C++ also often had that (replacing 'map' through 'transform' and so o…

> Same goes e.g. for LINQ, which was influenced by SQL instead of LISP-like collection transformation functions.

This was an explicit decision to make functional programming more palatable to mainstream developers.

Have you read the paper from Erik Meijer?

Re: Kotlin Is Better

#140
post #20

I've started to come around on a similar thought recently, after a few years avoiding static typing in python. I've been toying with C# specifically. C# with visual studio is, I think, the most productive environment I've come across in programming. It's ergonomically sound, straightforward, and the IDE protects me from all sorts of relevant errors. Steve mentioned Intellij is a bit slower than he'd hope typing somet…

I often use WebStorm (Intellij variant), and I am continually annoyed by its inability to keep up with my typing. I do like the IDE, but I do wish it was more responsive. It often feels like a heavyweight, taking long to do any operation, especially starting up.

I've never seen anything that tried to do intellisense in JavaScript that wasn't slower than molasses. The quickest way for me to get Visual Studio to crash is to open two or three small .js files, watch the memory usage skyrocket, and the editor speed grind to a halt.
Post reply on HN