TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Kotlin Is Better

538 点作者 praxxis大约 8 年前

36 条评论

bpicolo大约 8 年前
I&#x27;ve started to come around on a similar thought recently, after a few years avoiding static typing in python. I&#x27;ve been toying with C# specifically.<p>C# with visual studio is, I think, the most productive environment I&#x27;ve come across in programming. It&#x27;s ergonomically sound, straightforward, and the IDE protects me from all sorts of relevant errors. Steve mentioned Intellij is a bit slower than he&#x27;d hope typing sometimes. I totally agree with that. I think Visual Studio doesn&#x27;t quite suffer from that (though I haven&#x27;t worked on huge projects, and that may well affect it). My main problems with IDEs are twofold: for non-static languages like Python, they&#x27;re just not very good. Sometimes they do exactly what you need, and 70% of the time they&#x27;re just totally useless (which is a knock on the programming languages more than the IDEs). The zippiness on reaction to my typing is another huge deal. If it&#x27;s anything other than instantaneous, then I notice my editor in a negative light. When you pair a tremendous IDE with a good language though, the productivity loss of typing becomes pretty much negligible, and the gains for all the other reasons start to become apparent.<p>Changing one parameter or type on a class or function to refactor, and then just following the chain of compiler errors, reaching the end, and seeing that everything just works exactly how you want it to was a big eye opener to me.<p>Definitely going to give kotlin a go some time as well.
评论 #14365234 未加载
评论 #14366604 未加载
评论 #14364148 未加载
评论 #14364915 未加载
评论 #14365392 未加载
评论 #14366479 未加载
评论 #14364715 未加载
评论 #14365950 未加载
评论 #14365711 未加载
cromwellian大约 8 年前
The only problem with Steve&#x27;s rant is that he starts out describing his experience with APIs, but then it turns into an issue of better languages.<p>Presumably Kotlin doesn&#x27;t wrap the entire Android API with some kind of better API, but most Android API calls would be direct Kotlin-&gt;Java calls, so how does Kotlin solve the nasty API issue?<p>Really, this seems to be another Java critique by Steve. He&#x27;s also written critiques against typed languages in general, including Scala.<p>Android&#x27;s API issues are language independent I think. Compare the design of Guava vs Android, you can make well designed and easy to use Java APIs, it just takes thoughtfulness.
评论 #14364481 未加载
评论 #14363851 未加载
评论 #14372826 未加载
评论 #14366021 未加载
评论 #14364111 未加载
barrkel大约 8 年前
Other language built around IDE support: Delphi.<p>The compiler was built with callbacks to provide code completion; it runs in process, as a DLL, as part of the IDE.<p>No accident that Hejlsberg also design C#, and innovated further with TypeScript&#x27;s language server. He wrote the original Turbo Pascal (IDE + Compiler in the same executable) in assembler, so he&#x27;s been building IDE + language combos all his life.
评论 #14363886 未加载
评论 #14366506 未加载
评论 #14364382 未加载
评论 #14377285 未加载
shawkinaw大约 8 年前
Two thoughts. First, I also thought Android programming was horrible at first, but have since come to see it as no worse on average than iOS programming. The only really sucky thing about it IMO is the lack of ability to pass an object to another activity without serializing it (or maybe there is one I don&#x27;t know about.) But since everything is done with fragments now that&#x27;s moot anyway.<p>Second, I tried Kotlin and liked it a lot, but found it so much like Swift that my brain kept thinking it <i>was</i> Swift, so I ended up making mistakes and getting frustrated. That would probably go away with experience though.
评论 #14363670 未加载
评论 #14364277 未加载
评论 #14365183 未加载
评论 #14365750 未加载
runT1ME大约 8 年前
Does anyone remember when he wrote this?<p><a href="http:&#x2F;&#x2F;steve-yegge.blogspot.com&#x2F;2008&#x2F;06&#x2F;rhinos-and-tigers.html" rel="nofollow">http:&#x2F;&#x2F;steve-yegge.blogspot.com&#x2F;2008&#x2F;06&#x2F;rhinos-and-tigers.ht...</a><p>And in the comments section he got lit up because he was unfamiliar with Haskell&#x2F;Scala&#x2F;OCaml type languages...<p>and here he is 9 years late to the party touting a baby version of these statically typed FP languages. I actually laughed out loud reading this blog post.
评论 #14364147 未加载
评论 #14364329 未加载
评论 #14364020 未加载
评论 #14364023 未加载
评论 #14363985 未加载
评论 #14363901 未加载
andrewstuart将近 8 年前
Is there reason to choose Kotlin if you don&#x27;t already live in the Java world?<p>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?<p>Why would someone who has never programmed in the Java ecosystem use Kotlin?<p>I&#x27;m surely ignorant and prejudiced but when I read this I thought &quot;Hey why not try Kotlin?&quot;, then I thought of Java and images came up in my head of thousands and thousands of files being installed, and the vast, lumbering Java engine cranking slowly and chugging and masses of XML configuration up the wazoo for everything and I shuddered and thought &quot;I&#x27;ll stick with JavaScript, where the pain of configuration is merely excruciating, as opposed to the pain of Java configuration which is similar to bowing before throne of the Java king of ninth level of hell awaiting punishment for a lifetime of sin.&quot;.
评论 #14366274 未加载
评论 #14366336 未加载
pje大约 8 年前
The &quot;ew gross weird&quot; reaction to Scala and Clojure is tremendously disappointing (especially coming from someone whose thesis is basically &quot;give this new language a chance&quot;)
评论 #14364342 未加载
评论 #14364435 未加载
评论 #14364422 未加载
ufmace大约 8 年前
I&#x27;m glad to hear Steve Yegge&#x27;s take on Kotlin. I&#x27;ve played with it some and thought it was quite interesting, and I wouldn&#x27;t mind doing a project in it sometime. Although I don&#x27;t use Java much, I&#x27;m more into Rails for personal projects, and I&#x27;m not about to switch any of them to JVM just to play with Kotlin.<p>Anyways, I broadly agree with his take that it adds all of the cool toys you could ever want to Java without the difficulty and mental overhead of learning Clojure or Scala. Strong compatibility with the existing Java ecosystem seems like a plus, but I&#x27;ve never dug into it deep enough to notice that.<p>I did find myself really wanting to know what he figured out to make Android UI programming non-awful though. I&#x27;ve messed with it some, and I don&#x27;t see how adding in Kotlin would make it much nicer. Maybe he loved Kotlin so much that he was able to forget about the Android UI API.
BJanecke将近 8 年前
Kotlin is really nice and I am very happy to have more than one great&#x2F;fun&#x2F;productive language however I feel like mentioning typescript might be worthwhile (yes I know it&#x27;s &quot;just&quot; a superset of JS and you have a personal gripe with whatever you think JS is but hear me out).<p>* Runs everywhere js&#x2F;asm<p>* MIxed bag of tooling, but generally you can find something amazing and you won&#x27;t have to venture to sourceforge or similar to submit a patch<p>* Doesn&#x27;t suffer from the coljure&#x2F;scala &quot;We can totally use other JVM libraries but we only really do that If we have no other option&quot;<p>* Absolutely beautiful generics and spot on inference<p><pre><code> ``` function pluck&lt;T&gt;(key: keyof T, from: T[]) { return from.map(item =&gt; item[key]); } ``` </code></pre> * First class functions<p>* Incredible flexibility<p><pre><code> * sketch in js then annotate * decide on strict nulls * decide on implicit types * various approaches to composition </code></pre> * Amazing IDE support(VSCode)(This technically falls under tooling ;))<p>* One of the few cross-platfrom languages that feel pretty much identical on all the platforms<p>[edit] Formatting
Tharkun将近 8 年前
Yet Another Java Rant.<p>In my book, Java is a fine language, and has been since Java SE 6 was released back in 2006. It keeps getting better, too. &quot;Glacial&quot; pace or not.<p>Whenever any kind of discussion about Java comes up, people start ranting about XML configuration or annotations. These are not language problems. These are developer problems. If you don&#x27;t like XML or annotations, then don&#x27;t use them. Problem solved. Very few Java features require the use of either.<p>I rarely run into issues with the Java language, syntax or productivity wise. I&#x27;ve run into a couple of Sun&#x2F;Oracle&#x2F;IBM bugs in my 17 years of Java development. I&#x27;ve greatly appreciated productivity-increasing features like try-with-resources and Streams, but the lack of those features have never held me back as a developer.<p>Given the sheer amount of Java code out there, I would say it deserves a little more praise and a little less negativity.
评论 #14372756 未加载
评论 #14366989 未加载
jakub_g将近 8 年前
Side note: Even if you&#x27;re not interested in Kotlin, or don&#x27;t know Steve Yegge, give a read to this blog post.<p>The writing is as good and hilarious as in the old good times when he used to write way more often. Lots of fun for the morning.<p>For aspiring blog-writers, it&#x27;s also a good study how to write blogs to keep readers engaged. I only know 2 people writing in that style, him and Joel Spolsky, but it&#x27;s highly effective.
nemothekid大约 8 年前
&gt;<i>And Android has some pretty big red-light APIs. Fragments, for example, are a well-known Flagship Bad API in Android.</i><p>Ugh. I left Android development right around Honeycomb - where Fragments were supposed to be the cool way to manage your app and you&#x27;d get screen orientation and device screen configuration all for almost free. In practice I found Fragments far more confusing to use than the already complex Activity lifecycle. To hear that 3 years later that everyone may think Fragments were a bad idea doesn&#x27;t leave me feeling good.
评论 #14364270 未加载
评论 #14366488 未加载
评论 #14363924 未加载
bartread将近 8 年前
It&#x27;s impressive to see Kotlin finally getting some traction. The first time I heard of it was years ago: I was doing a piece of competitor analysis at Red Gate and I clearly remember reading about it and having a distinctly &quot;whatever&quot; reaction.<p>Part of that was because every time I&#x27;d seen some (relatively) small shop invent a language or platform in the past, it sort of sucked. But JetBrains are a rather different animal. They&#x27;ve done a great job of getting the right kind of people on board, with the right background and experience, to do language design well. They also have a talent for making long-term plays and consistently investing in them; they&#x27;re patient about achieving long-term success (examples: IntelliJ, TeamCity, even YouTrack), which isn&#x27;t so common. I probably shouldn&#x27;t be surprised to see the same happening with Kotlin - they&#x27;ve been plugging away at it for about 6 years, I think. Great work.
charlieflowers大约 8 年前
The biggest news is: Yegge is blogging again! Glad to see it!
评论 #14366031 未加载
andrewstuart将近 8 年前
A few people have said that IntelliJ is slow.<p>Why is this so, if Java is not inherently slow?<p>Sure JetBrains are some of the smartest developers around and yet their IDE is still slow.<p>I can&#x27;t help but feel that Java is slow and problems with performance in something like IntelliJ do nothing to dispel that feeling.
评论 #14367303 未加载
评论 #14372466 未加载
评论 #14372907 未加载
agentgt将近 8 年前
What makes me nervous about Kotlin is it could become Scala (or even Groovy) again.<p>Don&#x27;t get me wrong I&#x27;m a huge fan of Scala and highly expressive language but on the other hand there is something to be said for simple consistent and not that expressive languages. It pains me to say it but less choices and not more.<p>That is I want Kotlin, or Scala, or Java to be a little more like Go (and I&#x27;m not a fan of Go). The development consistency with Go with gofmt and other build tools as well as having fairly good default concurrency (Java as a myriad of concurrency practices: eg. streams, actors, rx) help ramp up time.<p>The ramp up time for all JVM languages is pretty awful compared to C# or Go. There are so many tools and libraries and different way people do things. I love the choices but it really hurts bringing on new talent.<p>Luckily Kotlin is backed by a tools provider so perhaps extreme consistency will happen but when I look at the Spring 5.0 examples (also on the HN right now) I get nervous and think oh this is becoming Scala academic DSL confusion all over.
RandyRanderson将近 8 年前
So this guy has [0]:<p>. advocated Javascript on the server-side<p>. tried to get goog to support Ruby<p>. is active in Lisp, enough to get it mentioned in wikipedia twice<p>And now is enough of an expert in Java and Koltin to instruct us on which is &quot;better&quot;. That&#x27;s a lot of languages to be an expert in! It&#x27;s almost unbelievable.<p>If someone who&#x27;s been working in Java for years and then has done a significant Koltin project (100k plus SLOC) that&#x27;s in production and they told me &quot;Koltin is ?&quot; I would listen to them. Otherwise I might be tempted to believe someone&#x27;s writing another clickbait article.<p>Regardless, looking to his wiki history, it seems he&#x27;s, charitably, outspoken. Not someone i&#x27;d look to for a sober technical analysis.<p>[0] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Steve_Yegge" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Steve_Yegge</a>
codecamper将近 8 年前
Just wanted to point out that Kotlin is not from Russia. It&#x27;s from Prague, Czech Republic. Almost the furthest west you can go and still be Slavic.<p>Maybe the founders of Jetbrains are Russian. Not sure.<p>edit: aha Kotlin is in fact developed in Russia. From Russia with love!
askvictor将近 8 年前
Fwiw, jetbrains originates in Prague not Russia; although the kotlin dev team is based in Russia.
wisty大约 8 年前
It seems to mostly be compared to Java. Sure, if you don&#x27;t like functional languages or dynamic languages (Jython, Groovy, JRuby) then I guess it&#x27;s the best high profile JVM language.
评论 #14364340 未加载
zengid将近 8 年前
&gt;How many languages can you name that were built with IDE support from the ground up?<p>Visual Studio Code is pretty nice with TypeScript. I&#x27;ve enjoyed having the autocomplete for my little Phaser game.
sigi45将近 8 年前
Awesome article! Not one practical comparison between java and Kotlin.<p>Anyway as any hype like scala and co. Java works very well, has small issues and no issue which really hurts me.
grunca将近 8 年前
You can and should build your domain language on whatever base language you happen to like&#x2F;use. This is where most failures happen on big projects. If you treat your solution as a script or glue code, and your complexity needs to scale, you will quickly reach a stalling point. A good, well thought structure &amp; design is required,there is no language available (yet) that will replace that.
ensiferum将近 8 年前
How exactly does kotlin fix the bad Android apis? You&#x27;d imagine that you still have to deal with the apis.<p>&quot;Whereas Kotlin is made by world-class IDE vendors, so right from the start it has the best tooling support ever.&quot;<p>And then...<p>IntelliJ doesn&#x27;t like it when you type fast. Its completions can&#x27;t keep up and you wind up with half-identifiers everywhere.<p>So sounds like the tool support really isn&#x27;t great.
chrisallick大约 8 年前
Great article. Slamming android and talking about Russian software. Click bait to boot? Sold.<p>My only issue is with his comment on swift. Which also sucks. Objective-C is wonderful and delightful. I&#x27;m sad to see it losing favor.<p>Oh well, off to try Kotlin. Maybe I&#x27;ll finally make an android app... no.
评论 #14363815 未加载
newsat13将近 8 年前
I don&#x27;t get it. How does Kotlin actually solve Android&#x27;s fragment&#x2F;activity issues?
评论 #14370157 未加载
i386将近 8 年前
Kotlin wouldn&#x27;t be happening if Java was shipping things developers actually cared about.
zebra9978将近 8 年前
the title has been made politically correct - the actual title is &quot;Why Kotlin Is Better Than Whatever Dumb Language You&#x27;re Using&quot;. I wonder if that was intentional editorial oversight.
评论 #14366238 未加载
sandGorgon将近 8 年前
i wonder what server side platform are they using ? there&#x27;s been a lot of buzz around vertx+kotlin or Reactor ... and with android support, it is a very compelling stack to have for android focused startups.<p>if they begin to build first class hooks for tensorflow in kotlin (as they might already have, considering Tensorflow Lite on android), i think it could replace python as the first language for data scientists.
rev_null将近 8 年前
Better than Java seems like a pretty low bar.
评论 #14372924 未加载
gigatexal将近 8 年前
Makes bold claims, but shows no code.
anjanb将近 8 年前
Anyone knows how it performs versus, say, Clojure for server-side development ?
评论 #14407900 未加载
awinter-py将近 8 年前
intellij is soooo sloooow
r3m3mb3rm3将近 8 年前
Having all parameters to be read-only is a deal breaker for me.
评论 #14366141 未加载
评论 #14367107 未加载
gankgu将近 8 年前
golang is better.
dozzie大约 8 年前
Why my programming languages are smarter than whatever dumb writer that knows nothing about my toolset and my needs is at hand with his trivial cliches.
评论 #14363726 未加载
评论 #14363432 未加载
评论 #14363531 未加载
评论 #14363454 未加载