The cost of Java's EnumSet

29 · Christopher Wellons · April 23, 2021, 9:28 p.m.
Summary
It’s been about a decade since I last worked in Java and much has changed. I thought I’d brush up by re-reading Effective Java by Joshua Bloch which has since received a new edition. It was once my guiding star for Java. However, after an additional decade of experience in a variety of languages and platforms, this book frequently made me shake my head. I strongly disagreed with 20% of its items. One conflicting topic was enumerations, particularly item 36: “Use EnumSet instead of bit fields.” T...