17 Soul Questions on Java cover

17 Soul Questions on Java

No rating yet
Chapters
17

Tags

Summary

17 Soul Questions on Java is an interpretive e-book by tech blogger Hollis (an Alibaba technical expert and co-author of Three Courses for Programmers), built around the Java Development Manual (Songshan Edition). Its full title is often written as 17 Soul Questions on the Java Development Manual (Songshan Edition), and it was released as an e-book by the Alibaba Cloud Developer Community. Rather than attempting to cover all of Java syntax, the book starts from the mandatory and recommended rules in the manual that give conclusions without explaining reasons, and probes the principles behind them one by one: why BigDecimal's equals must not be used for value comparison, why double must not be used to construct BigDecimal directly, why the year in date formatting must be written as lowercase y, why the ternary operator must have aligned types, why an initial capacity should be specified when creating a HashMap and what value is appropriate, why Executors must not be used to create thread pools, why subList should be used with caution, why elements must not be added or removed inside a foreach loop, why SimpleDateFormat must not be defined as static, why serialVersionUID should not be changed at will, and why count(*) is preferable to count(column_name). The book is organized as question, source-code symptom, principle analysis, and correct usage, with diagrams and code examples that clarify the type system, collection implementations, concurrency, and serialization mechanisms behind the rules, helping readers move from memorizing the rules to understanding them. Concise in length, it serves well as a companion Q&A reader after going through the Java Development Manual.

Editor's review

《Java开发手册》在国内团队里几乎是“人手一份”,但多数人只把它当检查清单:照着改,却说不清为什么。这本《灵魂17问》正好补上缺失的那一半——把 17 条最常见的强制规约还原成 17 个可以独立阅读的技术问题,每一个都从“代码跑出来的意外结果”讲到“语言与框架层面为什么如此”。 它的价值有三层:一是纠错,比如 BigDecimal 用 equals 比较会因 scale 不同而返回 false、SimpleDateFormat 作为静态变量在多线程下会串数据,这些都是线上事故的高发点;二是补基础,HashMap 容量与扩容、subList 的视图语义、foreach 中增删元素触发 fail-fast,都是面试与实战反复出现的考点;三是给方法,作者示范了“看文档—看源码—写最小复现—总结结论”的探究路径,比记住 17 个答案更有用。 全书篇幅小、门槛适中、示例集中,适合当作工具书按需翻查,也适合团队做规约培训时的讨论材料。需要提醒的是:它是一本围绕规约展开的答疑小册,而非系统教程,也不覆盖 Java 语言的全部新特性。

Who it's for

A good fit for

  • 已能写 Java 业务代码、想弄懂开发手册规约背后原因的中初级开发者
  • 准备 Java 面试、需要梳理集合、并发、基础类库高频考点的求职者
  • 需要给团队做代码规范培训、寻找讨论素材的技术负责人
  • 接手规范化要求较高项目、想快速规避常见坑的转型开发者

Not a good fit for

  • 零基础、还没写过 Java 程序、需要系统入门教程的读者
  • 希望系统学习 Java 21 及以上语言新特性或框架原理的读者
  • 只想找题库背答案、不愿看源码与原理分析的应试者

Reading tips

  1. 先通读《Java开发手册(嵩山版)》原规约,再逐条对照本书,理解“为什么”,记忆效果更好。
  2. 每读完一问,回到自己的项目里搜一遍对应写法(如 static SimpleDateFormat),把知识落到代码。
  3. 遇到讲述原理的章节,动手写最小复现代码验证现象,比只看结论更扎实。
  4. 可将其作为团队 Code Review 的参考清单,每周围绕一到两个问题做简短技术分享。

Contents

  1. 01 Why is using BigDecimal's equals method for value comparison prohibited?
  2. 02 Why is using double to construct BigDecimal directly prohibited?
  3. 03 Why is using Apache Beanutils for property copying prohibited?
  4. 04 Why must y be used to represent the year in date formatting, and not Y?
  5. 05 The types of the ternary operator must be the same
  6. 06 Why is it recommended to initialize the capacity of a HashMap?
  7. 07 The Java Development Manual recommends setting an initial capacity when creating a HashMap, but what value is appropriate?
  8. 08 Using Executors to create thread pools is prohibited
  9. 09 Why is cautious use of ArrayList's subList method required?
  10. 10 Why is using "+" for string concatenation in a for loop not recommended?
  11. 11 Why are remove/add operations on elements in a foreach loop prohibited?
  12. 12 Why are engineers prohibited from directly using the APIs of logging systems (Log4j, Logback)?
  13. 13 Why is defining SimpleDateFormat as a static variable prohibited?
  14. 14 Why are developers prohibited from using isSuccess as a variable name?
  15. 15 Why are developers prohibited from modifying the value of the serialVersionUID field?
  16. 16 Why are developers advised to use inheritance with caution?
  17. 17 Why is using count(column_name) or count(constant) instead of count(*) prohibited?

FAQ

这本书和《阿里巴巴Java开发手册》是什么关系?
它是围绕《Java开发手册(嵩山版)》撰写的解读读物,常被称作《〈Java开发手册(嵩山版)〉灵魂17问》,逐条讲解手册中 17 条规约背后的原理;原手册给结论与条款,本书给原因与代码示例,两者配合阅读效果最好。
这本书是正式出版的纸质书吗?
从公开资料看,它主要以电子书形式在阿里云开发者社区等渠道发布和传播,未见正式出版社与 ISBN 信息,因此本书目数据中出版社、出版年、ISBN 均留空,购买或引用时请以官方电子版来源为准。
全书只有 17 个问题,内容会不会太薄?
它定位是答疑小册而不是系统教程,每一问都围绕一个真实踩坑点展开,涉及 BigDecimal、日期格式化、HashMap 容量、线程池、fail-fast、序列化等内容,信息密度较高,适合按需查阅与反复回顾。
读完能直接提升面试通过率吗?
其中不少问题正是 Java 面试的高频考点,理解原理确实有帮助;但它覆盖面有限,不涉及 JVM 调优、并发框架、框架原理等大块内容,建议与系统教材和项目实践配合使用。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

Top rated in the same category