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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Revisiting Java in 2021 – Part II

108 点作者 avanwyk超过 3 年前

15 条评论

dboreham超过 3 年前
The comments about Scala resonated. I&#x27;ve been working in a a large Scala codebase for the past few months. I&#x27;ve become a partial fan of the language, however: there have been multiple conversations like : (in screen share with colleague) &quot;See that double right arrow there? What&#x27;s that mean? (after attempts to find answer in books, SO, etc, and trying to guess based on the three&#x2F;four other uses the language makes of double right arrow that I&#x27;ve already grokked). Colleague: &quot;Uhh, dunno, beats me&quot;.<p>On reflection, I think if the Scala creators had been a bit less obsessed with symbology and had either a) used keywords rather than symbols more often or b) consistently only ever used a symbol for the same one purpose; the outcome would have been significantly better.<p>There are just too many symbols to cover them all in a short book or cheat sheet, and symbols are very SEO-unfriendly. And even if you do find the relevant medium article, it&#x27;s not necessarily clear that you&#x27;re looking at the same use case for that particular symbol.
评论 #28585290 未加载
评论 #28585309 未加载
评论 #28585475 未加载
评论 #28585236 未加载
评论 #28585314 未加载
评论 #28589963 未加载
评论 #28585497 未加载
hn_throwaway_99超过 3 年前
I think when Project Loom comes out that Kotlin on top of the JVM will be a tough combo to beat.<p>Kotlin is basically the language Java <i>should</i> be after 20 years of lessons learned, e.g. language-supported Optionals. The JVM is a battle tested platform. Once Project Loom comes out, you&#x27;ll get the &quot;best of both worlds&quot; - the easier (i.e. &quot;no functions &#x27;colors&#x27;&quot;) programming model of multiple threads like in Java, but the scalability and performance of things like async in NodeJS.
评论 #28586733 未加载
评论 #28585604 未加载
评论 #28586240 未加载
vbezhenar超过 3 年前
Thanks for article. Today I learned about Project Leyden, whose primary goal will be to address the long-term pain points of Java’s slow startup time, slow time to peak performance, and large footprint.<p>I just recently started to explore Quarkus, GraalVM to optimize Java microservices for cloud architecture. It&#x27;s good to know that Java moves into that direction.<p><a href="https:&#x2F;&#x2F;mail.openjdk.java.net&#x2F;pipermail&#x2F;discuss&#x2F;2020-April&#x2F;005429.html" rel="nofollow">https:&#x2F;&#x2F;mail.openjdk.java.net&#x2F;pipermail&#x2F;discuss&#x2F;2020-April&#x2F;0...</a>
评论 #28585578 未加载
da39a3ee超过 3 年前
&gt; There are ... many well-written books on how to program it effectively<p>Would anyone be able to recommend a good resource for quickly learning modern Java for experienced programmers that already know, let&#x27;s say, one of {Python,Javascript} AND one of {Go,Rust,C,C++}, but have zero JVM experience?<p>(Ideally the resource would also teach some relevant things about the JVM itself rather than the Java language specifically.)
评论 #28585095 未加载
评论 #28585273 未加载
评论 #28585346 未加载
评论 #28585203 未加载
评论 #28584998 未加载
jillesvangurp超过 3 年前
One point that the author fails to mention regarding Jetbrains is that they developed Kotlin and that Intellij at this point is largely implemented in it. Their whole strategy features a lot of Kotlin at this point. So, the best IDE for Java is built by the company that develops a drop in replacement for it. Not a minor point to make. The IDE that Oracle acquired along with Sun (Netbeans) is still there of course but it&#x27;s rare that I meet someone who even knows what that is.<p>This is actually also a weakness because there is no good competition in terms of alternative Kotlin IDEs. Eclipse and VS Code have Kotlin plugins but they are nowhere near as good as their Java support. Nice in a pinch if you really can&#x27;t be bothered to install Intellij.<p>Java undeniably has great alternative IDEs. I think it&#x27;s still unrivaled in the wide variety of very decent IDEs and by pretty much every other language. And that has been the case for a long time. Eclipse and Netbeans are still around and both still do a fine job. If you use emacs or vi, there are decent plugins for those as well. VS Code of course has pretty decent support. Kotlin support for all of those is not at the same level.<p>But one positive thing that has come out of Kotlin (and Scala) keeping the pressure on Oracle is that they have rapidly rolled out a lot of new Java and JVM features in the last few years. JDK 17 is a nice piece of technology with lots of under the hood changes that benefit all JVM languages. So is Graal. I think the efforts to make Java more usable are also going to be nice for people with Java code bases.<p>Like the author though, Kotlin is my main language at this point.
评论 #28585871 未加载
评论 #28586069 未加载
0xCMP超过 3 年前
I&#x27;m not a huge fan of Java, but a lot of the improvements being worked on here are promising.<p>I&#x27;m 90% certain I would only really start working on a project if we could use Kotlin just because the ergonomics are vastly superior. If that requires the trial-by-error mentioned ITA to figure out the best practices of various approaches available I think I&#x27;d take that trade off.
评论 #28586141 未加载
评论 #28585068 未加载
javajosh超过 3 年前
I use Java every day, but we&#x27;re stuck with Java 8 because of the confusing and frankly scary licensing around later JDKs. I would love to move to 17 but I need something to show to the C-levels that gives them warm and fuzzies around the license. Does such a thing exist?<p>EDIT: I find it quite depressing that so many want to attack people for being confused around Java licensing. I submit that it is confusing on its face, but moreover insiders seems to understand how confusing it is, too:<p><a href="https:&#x2F;&#x2F;softwareengineering.stackexchange.com&#x2F;questions&#x2F;119436&#x2F;what-does-gpl-with-classpath-exception-mean-in-practice" rel="nofollow">https:&#x2F;&#x2F;softwareengineering.stackexchange.com&#x2F;questions&#x2F;1194...</a><p><a href="https:&#x2F;&#x2F;medium.com&#x2F;@javachampions&#x2F;java-is-still-free-2-0-0-6b9aa8d6d244" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;@javachampions&#x2F;java-is-still-free-2-0-0-6...</a>
评论 #28585491 未加载
评论 #28585078 未加载
评论 #28585485 未加载
评论 #28585100 未加载
评论 #28585963 未加载
daxfohl超过 3 年前
Changing companies led me from C# to Java. I feel so much less productive in Java, so much extra boilerplate everywhere. C# is just as mainstream as Java, so learning curves and nicheness arguments don&#x27;t apply, it&#x27;s just better.<p>I wonder if MSFT will ever make C# run on JVM.
评论 #28586213 未加载
评论 #28590822 未加载
评论 #28585621 未加载
评论 #28589505 未加载
评论 #28586341 未加载
geokon超过 3 年前
1 -<p>I just do some Clojure programming, and I&#x27;m not deep into JVM things - but why does Android not even make a mention? Isn&#x27;t it the most widely used JVM platform..?<p>2 -<p>&gt; This does come with some restrictions and caveats; for example, it&#x27;s not as straightforward to use Reflection in your Java code.<p>Is GraalVM going to push Reflections out of Java&#x2F;JVM?<p>I guess my angle is I&#x27;d like to use the JVM to make (desktop) apps. Last I did, using cljfx&#x2F;JavaFX reflections were a huge sore point. Ever dependency would drag in the whole kitchen sink - and reflections are an ugly wart that prevent unused classes&#x2F;namespaces from being pruned.<p>I know technically there is Proguard.. but it&#x27;s clunky and ugly I&#x27;ve never gotten it to work with Clojure. Graal native looked like a sort of light at the end of the tunnel.<p>3-<p>Whats the story with WASM and the JVM? Both designs seem eerily similar - but I don&#x27;t know if the gap between the two is too large to bridge
评论 #28592951 未加载
评论 #28586883 未加载
评论 #28586859 未加载
carltheperson超过 3 年前
This was a great read! Think I might pick up Kotlin
nsonha超过 3 年前
Boy JDK really accelerated their releases in recent years did they. 6 years ago when I&#x27;ve just graduated, Java 9 was around the corner.
pharmakom超过 3 年前
Java is not expressive enough to do without reflection for some complex problems. I suppose you might resort to code generation instead?
tomohawk超过 3 年前
&gt; Build tools such as Maven and Gradle are fast, stable and effective<p>Exactly the opposite of what comes to mind when I think of these.
评论 #28587073 未加载
评论 #28590841 未加载
rnentjes超过 3 年前
Alternative way to count the vowels in Kotlin:<p><pre><code> val numVowels = countVowels(getDTO()?.string ?: &quot;&quot;)</code></pre>
评论 #28586232 未加载
smallerfish超过 3 年前
Overall, good, but I quibble in favor of Kotlin with a couple of points:<p>&gt; Building large teams (think hundreds or thousands of developers) requires talent, and talent is easier to find if more people know the language (although, if you want the absolute best people, you might be better off choosing a more niche language).<p>It&#x27;s very easy to hire good Java devs and crosstrain them to Kotlin.<p>&gt; Java also arguably has the best tooling in the business. I&#x27;d argue that IntelliJ IDEA (and family) is the best IDE out there, more so if you are coding Java. Even if you prefer VS Code, Java is well supported.<p>Jetbrains of course make Kotlin also, and theoretically their Kotlin IDE support will be better than Java&#x27;s once they complete the mainlining of the Kotlin plugin into the IDE code base. (Right now the Kotlin plugin has recurrent stability issues.)