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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why I Like The Verbosity of Java

6 点作者 fogus超过 13 年前

9 条评论

abarringer超过 13 年前
This line of thought from the 2000's<p>PHP was very easy to use.... So I didn’t bother to understand the underlying mechanics. Java forced me to.<p>Same line of thought circa 1996<p>"Java was very easy to use.... So I didn’t bother to understand the underlying mechanics. C forced me to."<p>Same line of thought circa 1990<p>"C was very easy to use.... So I didn’t bother to understand the underlying mechanics. Assembler forced me to."<p>Abstraction layers are not the problem, however understanding what do to when they start leaking is the solution.<p><a href="http://www.joelonsoftware.com/articles/LeakyAbstractions.html" rel="nofollow">http://www.joelonsoftware.com/articles/LeakyAbstractions.htm...</a>
floppydisk超过 13 年前
When I write code, I want to solve a problem, not write a book--that's what documentation is for.<p>Whenever I code in Java, I always feel the language ends up working against me. To get from point A --&#62; point B, the end result usually consists of having traveled through points C and D as well as having written a corpus of code whose length might rival that of War and Peace -- when working on a major project. Writing similar code in other languages, my LOC clock in at a fraction of the Java code. Personally, I've found the less LOC I have to deal with, the easier project maintenance gets, but that could just be me.
评论 #3424412 未加载
jiggy2011超过 13 年前
A few things that annoy me about Java:<p>Lack of an echo keyword. When I don't want to use the debugger but just print a few things to console, System.out.println("x = " + x) is a real mouthfull.<p>Exceptions: I end up with too many layers of indentation sometimes because of exceptions that I know will never be thrown anyway.<p>For example let's say you want to SHA1 hash something, you have a NoSuchAlgorithmException incase you are running on a JVM without a SHA1 hash function, which is something I know will <i>never</i> happen with my program.
PaulHoule超过 13 年前
Yikes.<p>I'll be leaving PHP as soon as PHP gets "Unicode Support".<p>The thing I hate the most about Java is that 2/3 of the time a junior programmer will write the wrong incantation when they open files, so Unicode characters will get scrambled. This gets missed by TimewastingDogmaticDevelopers (TDD) because they never write JUnit tests that read real files because they're too busy making mock objects. Instead, this problem gets discovered weeks or months after the fact.<p>I've never had Perl or PHP apps double-encode text that gets written to the database, but now it's on my checklist to check for double encoding whenever I smell a "bad smell" named Java.
mebassett超过 13 年前
While I can appreciate the author's experience - that learning lower-level technology gives on a great appreciation for the full stack and an ability to deal with leaky abstraction - I think he gets confused when he ties the lower-level implementation he's discovering with java's verbosity.<p>C is a lower level language that exposes a lot of stuff that's hidden in Java, but I've not read much C source code that makes me think it's too verbose. My experience with Java has contained far too many AbstractErrorCorrectingModalDialogueFactory classes for me to enjoy using it.
评论 #3424421 未加载
samirahmed超过 13 年前
I agree with the argument that more detail is conveyed in its verbosity.<p>But I fail to understand how type inference (like that seen in Scala, C# etc... doesn't clean up the verbose)<p>for example,<p><pre><code> HashMap&#60;String,ArrayList&#60;String&#62;&#62; map = new HashMap&#60;String,ArrayList&#60;String&#62;&#62; (); </code></pre> versus<p><pre><code> val map = new HashMap&#60;String,ArrayList&#60;String&#62;&#62; (); </code></pre> The latter conveys just as much information
评论 #3424216 未加载
评论 #3424273 未加载
评论 #3426518 未加载
jinushaun超过 13 年前
If I wanted to see how everything works, why would I need the abstraction of a higher level language? Why not just code in direct assembly? Abstraction has a value and I think it's a waste of time that it takes so much boilerplate code to do <i>routine</i> things in Java.
dchest超过 13 年前
You don't need the verbosity of Java to get good I/O or to understand how servers work. See: Go.
petrichor超过 13 年前
after doing some ruby work recently which required reading a lot of undocumented code that could have used some major refactoring, i really began to appreciate java's verbosity. even the most poorly written java leaves behind tons of clues as to what is happening. with ruby, if there is no documentation and no tests, you're SOL.<p>that said, there are still tons of things about java that really get on my nerves...