Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mac OS X Java Performance



Peter Wayner wrote:

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.

Your point is valid in terms of CPU-efficiency, but there is also the problem of programmer-efficiency. By calling a library routine you are reducing the amount of new code which needs to be written, validated and maintained (since the library should hopefully be correct and maintained by others), and your programmer can basically do more work.

Then, if profiling shows that code to be a bottleneck, it can be optimized, but before that I would also consider the library call to be elegant and efficient :)

--
Thorbjoern Ravn Andersen Scandiatransplant
Skejby Sygehus, indgang 3
+45 89 49 53 01 DK-8200 AArhus N
http://biobase.dk/~tra _______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.
References: 
 >Re: Mac OS X Java Performance (From: Todd Blanchard <email@hidden>)
 >Re: Mac OS X Java Performance (From: Thorbjørn Ravn Andersen <email@hidden>)
 >Re: Mac OS X Java Performance (From: Peter Wayner <email@hidden>)



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.