| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
At 2:36 PM +0200 7/31/03, Thorbjxrn Ravn Andersen wrote:Todd Blanchard wrote:
Anyhow, it is true that Gosling was trying to create a language that appealed to C++ developers and pretended to prevent a number of classes of stupid mistakes. It does. At the expense of preventing a large number of elegant solutions.
Could you please provide some examples of the elegant solutions which are prevented?
I would like to know what I miss, since I have only programmed in plain C, where string handling is a bit cumbersome.
Consider language Foo with neat function/method/subroutine Bar. Can you do Bar in one line of Java code? Can you do Bar in only three characters with Java? Nope. I bet not. Ergo Java is not as elegant as Foo.
I was once at a programming interview. One geek, who didn't want to hire me, was giving me questions. He asked me to solve some problem so I wrote out 20 lines using primitives. He announced that I was obviously a loser because there's a library routine that could accomplish the same task in one line of code. One Line! That's elegance and efficiency.
After a few minutes I realized that no one knew how many primitives the library routine would execute. It could be hundreds because the library routine was pretty general and designed to handle regular expressions. After I pointed this out, the question of elegance and efficiency was dropped.
I think elegance is an important concept. It's great when people aim to make their solutions as elegant as possible, but I think it's hard to compare solutions and try to decide which is more elegant. Unlike execution speed, there's no good metric.
| References: | |
| >Re: Mac OS X Java Performance (From: Peter Wayner <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.