
Java 谜题
Java puzzlers
Joshua Bloch · 初版 2005 年
12人推荐
20位读者提及
21次提及
为什么值得读
- 深入剖析容易误导开发者的语言隐蔽盲区
- 由语言核心贡献者编写且兼具趣味与深度
- 案例带来的逻辑思考对其他语言程序员也有益
本书基于 Bloch 与 Gafter 在 JavaOne 上座无虚席的 Java Puzzlers 演讲,其核心内容涵盖了 100 多个 Java programming language 谜题:这些挑战智力的烧脑难题不仅能启发思维,还能提醒程序员注意潜伏在 Java platform 阴暗角落里的陷阱、漏洞以及 corner cases。作者在广受欢迎的 JavaOne 演讲中的所有谜题均收录其中,此外还有许多从未公开发表过的谜题。书中的谜题主要分为两大类。大部分谜题都以简短程序的形式呈现,看似要做某件事,实际上却在做另一件事……
Hacker News 上怎么说
正在加载完整评论……
……但对该模式的理解是,关键在于别让其他对象把对你 peer 的引用给顺走,而这里恰恰就是在这个地方出了问题。(顺便说一句:Josh Bloch 的《Effective Java》和《Java Puzzlers》都神作。不管你用什么语言写代码,都非常值得一读。)
…understanding of that pattern, however, is that the key is not letting some other object walk off with a reference to your peer, which is exactly what has gone wrong here. (Aside: Josh Bloch's Effective Java & Java Puzzlers are fantastic. They are worth reading for programmers who use any language.)
《Java Puzzlers》[0] 里有几个类似这样的条目。有些条目与其说是奇葩怪异现象,不如说是容易让人踩坑(但逻辑上讲得通)的东西,不过读起来很有意思。注意这本书是 2005 年出的……
Java Puzzlers[0] has a few entries similar to this. Some of the entries are things that would trip you up (but logically makes sense) rather than oddities, but it's an interesting read. Note that the book is from 2005…
别忘了同样是 Bloch 写的《Java Puzzlers》:http://www.javapuzzlers.com/ 不仅读起来很有趣,而且深入剖析了 Java 语言各种阴暗角落的案例。
Don't forget Java Puzzlers, also by Bloch: http://www.javapuzzlers.com/ Not only is it a fun read, but it delves very deeply into case studies of the dark corners of the Java language.
……4. Bash FAQ 作为一名 Unix 系统程序员,我会选:1. 《人月神话》(Mythical Man-Month) 2. Jon Bentley 的《编程珠玑》(Programming Pearls) 3. K&R C 和 Stroustrup 的 C++ 4. 一本最新的 Java 参考书和 Bloch 的《Java Puzzlers》 5. 你自选语言(Python、Ruby、Perl 等)的参考书和 cookbook 6. Google 的代码风格规范(style guides)
…4. Bash FAQ As a Unix systems programmer I would choose 1. Mythical Man Month 2. Jon Bentley's Programming Pearls. 3. K&R C and Stroustrup C++ 4. A recent Java reference and Bloch's Java Puzzlers 5. a reference and cookbook for the language of your choice -- Python, Ruby, Perl, etc. 6. Google's style guides
《Java Puzzlers》这本书里指出了更多 Java 语言的奇葩特性。作者之一是 Joshua Bloch,他是 Java 语言和标准库的核心贡献者。http://www.javapuzzlers.com/
Many more Java language oddities are pointed out in the book "Java Puzzlers". One of its authors is Joshua Bloch, a major contributor to the Java language and libraries. http://www.javapuzzlers.com/
Joshua Bloch 和 Jeremy Manson 写的《Java Puzzlers》相当引人入胜。作为一个相当中规中矩的大路货语言,Java 却也有一些奇特刁钻的角落:https://www.youtube.com/watch?v=wbp-3BJWsU8
Java Puzzlers by Joshua Bloch and Jeremy Manson are pretty entertaining. For a pretty bog standard language, Java has some more exotic corners: https://www.youtube.com/watch?v=wbp-3BJWsU8