为什么java如此招人厌恶 —— Quora版

快乐无极 , 2016/04/20 14:38 , 应用文档 , 评论(0) , 阅读(1320) , Via 本站原创 | |
引用

首先什么是Quora?

Quora是一个问答SNS网站,由Facebook前雇员查理·切沃(Charlie Cheever)和亚当·安捷罗(Adam D' Angelo)于2009年6月创办。在2009年12月推出测试版,随后在2010年6月21日向公众开放。2010年3月,Quora得到基准资本公司的创业资金,估价高达8600万美元。2012年5月, Quora在B轮筹资中募集了五千万美金。
Quora一开始采用邀请制,吸引了很多明星和智慧人士,比如Craig Newmark(分类信息网站Craigslist创始人)、Mark Zuckerberg(Facebook创始人)和Ashton Kutcher(美国知名演员)。Quora此后逐步开放,用户通过Google或者Facebook帐号即可登陆,这是为了防止搜索引擎索引内容,但同时又让大众都可以参与。创业企业孵化机构Y Combinator的风投合伙人Harjeet Taggar在回答Quora的一个问题时说:“我宁愿从1000个高质量的内容来源那里获取信息,也不愿从来源更多的整合性渠道获取信息。”Quora的“肯定”功能和投票决定答案排序的功能会对内容质量有帮助。不过用户可以控制的也仅限于此。Quora还需要人工监控和验证帐户 -- 会踢掉假冒的奥巴马,和整合重复问题。

为什么java如此招人厌恶?以下引用的是Quora中一些资深人士的人的说法:部分翻译,原文见 https://www.quora.com/Why-do-people-hate-Java

引用
Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function.

  
java中难以看到优雅的代码实现,有时你遍读源码,只能发现一个优雅的函数,只是一个函数,不是方法,不是类,更没有框架级别的雅致。-- John Carmack
  
引用
Back when I was starting out in computer science I thought by today we’d be writing a few lines of code to accomplish much. Instead, we write hundreds of thousands of lines of code to accomplish little.

  
当我刚刚开始在CS系学习编程时,我觉得我们使用很少的代码完成了太多的事情。现在,(java中),我们写了成百上千的代码却只实现了极少的功能。-- Lispian
引用
Such is modern computing: everything simple is made too complicated because it's easy to fiddle with; everything complicated stays complicated because it's hard to fix.

这就是现代计算(编程):简单的东西被摆弄的及其复杂;而复杂的东西继续复杂因为(缺少功力)难以使之简单。-- Rob Pike

Java is like a variant of the game of Tetris in which none of the pieces can fill gaps created by the other pieces, so all you can do is pile them up endlessly.
java就像俄罗斯方块游戏的变体(Tetris),没有任何一块能够填充到其他块的缝隙,你只能不停的将代码堆砌下去。-- Steve Yegge
  
Languages that try to disallow idiocy become themselves idiotic.
(Java)语言本来为了避免(程序员)愚蠢行为,本身却变得相当的白痴。-- Rob Pike
  
The problem with object-oriented languages is they've got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire
  
面向对象语言问题在于它们总是随意带出很多潜在的环境。你本来只想要一只香蕉,但最终你却得到整个丛林中一个拿着香蕉的大猩猩。-- Joe Armstrong
  
So much complexity in software comes from trying to make one thing do two things.
软件中太多的复杂性来源于让本来做一件事情的(方法/类)去做了两件(更多)事情。(缺少内聚)-- Ryan Singer
The purpose of software engineering is to control complexity, not to create it.
软件工程的目标是控制复杂性,而不是(像java)创建复杂性。-- Dr. Pamela Zave
  
"design patterns" are concepts used by people who can't learn by any method except memorization, so in place of actual programming ability, they memorize "patterns" and throw each one in sequence at a problem until it works.
  
设计模式是一帮只会死记硬背而毫无学习领悟的人使用的概念。他们没有真正的编程能力和技巧,只会在问题中按部就班的去尝试模式直到找到一个合适的套用。-- Jason Garrett-Glaser (a.k.a. Dark_Shikari)

Under the doubtful disguise of the holy "code reuse" an insane amount of gratuitous complexity is added to our environment, which makes necessary industrial quantities of syntactical sugar to make the ensuing mess minimally manageable.
在代码复用(令人质疑)的神圣外衣下,太多太多--令人发指的数量,毫无必要的复杂性加入到了我们的环境,导致了工业数量级别上的语法糖,不可避免的完全滑向混乱-- Uriel
  
It is not that uncommon for the cost of an abstraction to outweigh the benefit it delivers.
抽象带来的成本往往超过其收益,这十分普遍。-- John Carmack

The beauty of small and simple code is that you can bend or break the rules as long it stays small and simple. Rules allow people to write code without thinking. [And when] you dont think [...] you get bloated code that just concatenates stupid patterns. People stop thinking and questioning [and] then its just worshipping some rules without any pruporse.

代码的简洁之美在于你能遵从或者打破任何规则,只要代码保持足够的清晰简洁。规则模式让人们能够不假思索的写出代码。[但是]当你不加思考时,你的代码臃肿不堪,变成各种模式的拼接。人们停止思考和问为什么之后,就只能盲目的崇拜各种模式了。-- Cinap Lenrek

The object-oriented model makes it easy to build up programs by accretion. What this often means, in practice, is that it provides a structured way to write spaghetti code.
面向对象模式使得很容易通过累积来生成代码。在实践中,这意味着它提供了一种结构化的方法来生成意大利面条式的代码(杂乱纠缠的一堆东西)。-- Paul Graham  

we ignore the real problems and instead invent problems for which we know how to solve–and create a spaghetti tangled mess instead, thinking that our ‘invented’ problem is more interesting. We then even go on to congratulate ourselves for solving the “fake” problem, leaving the real problem alone.
我们看不到问题真正的症结所在,而是人为的去创造了一些我们已经解决方案的问题。(尝试解决真正的问题)不去构建一大堆糟糕透顶的代码,我们选择思考我们熟知的问题。我们声称我们已经解决了问题(假的),而将真正的问题搁置一边。William Woody
  
Brien Colwell, Java for research (Berkeley), profit ...
28 votes by Tracy Chou, Aaron Chiu, Richard Shin, (more)There's a culture of bloat in the Java community. Architectures like ,Spring Hibernate,OSGi, and even web frameworks like Play propagate this bloat with too many configuration files and too many abstractions. Configuration files offend the idea of static types, and too many parts offends basic human psychology that there's a limit to how many pieces of information can be in working memory. Each moving part is literally taking the place of some valuable work being done effectively. The next generation of JVM Languages like Scala eliminate some of that thinking in the language: make singletons easy, automate idioms, make it possible to write C-style "global" programs succinctly. I hope this direction continues for succinct, lean-and-mean libraries for the JVM.
臃肿不堪的代码已经成为了Java社区的风气。典型的例子有Sprint, Hibernate, OSGI的架构,甚至一些(本来应该轻量级)web框架也喜欢通过巨多的配置文件和巨多的抽象让自己膨胀起来。配置文件与静态类型的思想想左,而太多的组件和模块又完全不符合人类的心理感知能力--同一时间,只能处理一定量的信息。这些动态组件取代了本应该能高效完成的有价值的工作。基于JVM的下一代的语言比如Scala消除了很多语言中类似的思考障碍:单例很简单,自动化(构建)原则,可以写出类C风格的全局简洁代码。我希望这个趋势能够为JVM共享出简洁,简约和平衡的lib库。
  

Adam Smith, Entrepreneur, hacker
(I would have ended that last sentence with an exclamation mark, but my language doesn't allow me to use them. Hm. To achieve the same effect, I'll just repeat: it's way way way way way way way way, very way way way way, super way way way way way way toooooooooooooo verbose.)
Because it's way way way way way way way way, very way way way way, super way way way way way way toooooooooooooo verbose.
因为Java的方式方式方式方式方式方式方式方式,特别的方式方式方式方式,特别特别的方式方式方式方式方式方式实在太罗嗦了。
(我本来想用一个感叹号来结束强调,但java没有这样的支持。为了表达同样到效果,我只好采用重复的方式:方式方式方式方式方式方式方式方式,特别的方式方式方式方式,特别特别的方式方式方式方式方式方式实在太罗嗦了)
Tags: , ,
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]