Chinaunix首页 | 论坛 | 博客
  • 博客访问: 987937
  • 博文数量: 158
  • 博客积分: 4380
  • 博客等级: 上校
  • 技术积分: 2367
  • 用 户 组: 普通用户
  • 注册时间: 2006-09-21 10:45
文章分类

全部博文(158)

文章存档

2012年(158)

我的朋友

分类: C/C++

2012-11-26 16:06:22


译者 applewood
Sergei Turin, EECS student at Cal (引用了很多其他人的话)199 votes by Shaan Batra, Hiroshi Ono, Horia Tu, (more)


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

SimpleBeanFactoryAwareAspectInstanceFactory

--



SimpleBeanFactoryAwareAspectInstanceFactory

AbstractInterceptorDrivenBeanDefinitionDecorator

AbstractSingleonProxyFactoryBean

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 36 votes by Rishabh Sharma, Paul Artois, Eunji Choi, (more)

(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没有这样的支持。为了表达同样到效果,我只好采用重复的方式:方式方式方式方式方式方式方式方式,特别的方式方式方式方式,特别特别的方式方式方式方式方式方式实在太罗嗦了)



Joshua Levy, Trust me. I'm a professional.18 votes by Joshua Engel, Charles Banas, Robert Rapplean, (more)

I think Steve Yegge illustrated Java's noun-oriented thinking most colorfully with his adaptation of this classic nursery rhyme [1] as recited in Javaland. His article is one of the best explanations I've seen about Java's shortcomings, and worth reading in full [2].

我认为Steve Yeg通过下面首借用修改的儿歌很好的说明出了java的面向名词思考的风格。他的文章是我见过的对java不足的最后说明之一,值得全文拜读。



See also:

What are the main weaknesses of Java as a programming language?

For the lack of a nail,

throw new HorseshoeNailNotFoundException("no nails!");

For the lack of a horseshoe,

EquestrianDoctor.getLocalInstance().getHorseDispatcher().shoot();

For the lack of a horse,

RidersGuild.getRiderNotificationSubscriberList().getBroadcaster().run(

new BroadcastMessage(StableFactory.getNullHorseInstance()));

For the lack of a rider,

MessageDeliverySubsystem.getLogger().logDeliveryFailure(

MessageFactory.getAbstractMessageInstance(

new MessageMedium(MessageType.VERBAL),

new MessageTransport(MessageTransportType.MOUNTED_RIDER),

new MessageSessionDestination(BattleManager.getRoutingInfo(

BattleLocation.NEAREST))),

MessageFailureReasonCode.UNKNOWN_RIDER_FAILURE);

For the lack of a message,
阅读(1918) | 评论(5) | 转发(0) |
给主人留下些什么吧!~~

zhengb3022013-01-03 14:19:18

灰常同意,用Java,就整天想着那些设计模式,UML神马神马的,结果半天却干不了半点儿活。

flyingzhang_cu2012-11-27 10:48:00

一个东西之所以变得复杂,而且一大堆聪明的人投身其中却使得它变得更加复杂,是有其根本原因的,变得复杂的原因是为了用它来突破人类自身对复杂能力的掌控能力的极限:用比较复杂的东西来构建更复杂的系统的构件,而不是直接用最原始的东西来处理。想想当初直接用assembler的人也有不少对于C这种东西嗤之以鼻,现在不知道还有多少人认为可以直接用Assembler就搭建出目前我们所能看到的这些常见复杂度的软件系统。当然,也有很多人在突破极限之前就已经迷失了,那是另外一个问题。

Bean_lee2012-11-26 22:05:48

看到了我崇拜的大神 John Carmack。
没学过Java.,不好评价,但是不想学这门语言, 更喜欢python ,shell , lisp.

网友评论2012-11-26 16:07:12

hero is zero
Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function.



java中难以看到优雅的代码实现,有时你遍读源码,只能发现一个优雅的函数,只是一个函数,不是方法,不是类,更没有框架级别的雅致。-- John Carmack  

这个是一一对应翻译的吗?
虽然我英语不太好,但是如果上面的回答是“是”,那么这个翻译应该是错的

网友评论2012-11-26 16:07:03

yqever
基本同意。