Tagged articles
BestPractices
15 articles · Page 1 of 1
This article explains how to replace repetitive null‑checks in Java with the appropriate utility classes—StringUtils for strings, ObjectUtils for objects, arrays, lists and maps, and CollectionUtils for collections—providing step‑by‑step guidance, code examples, and a discussion of each method's limitations.
BestPracticesCollectionUtilsJava
0 likes · 8 min read

This article explains how to replace repetitive !=null checks in Java with concise, type‑aware utility methods such as StringUtils, ObjectUtils, Collections, and CollectionUtils, providing code examples and discussing the underlying implementations and their limitations for different data types.
BestPracticesJavaNullPointerException
0 likes · 8 min read

This comprehensive guide explains the purpose and proper use of Java generic symbols T, E, K, V, and ?, covering their history, practical code examples, scope nuances, wildcard rules, advanced constraints, and best‑practice recommendations for writing safer, more flexible code.
BestPracticesGenericsJava
0 likes · 20 min read

This article explores how mutating the fields of an object used as a HashMap key corrupts its hash code, causing look‑ups to fail, and walks through the underlying source code of put, hash, getNode and related methods to reveal why this happens.
BestPracticesHashMapJava
0 likes · 17 min read

The article examines how Java Stream and Lambda, while powerful for concise code, can become cumbersome when overused, and offers practical tips such as proper line breaks, function extraction, predicate reuse, cautious Optional handling, and mindful use of parallel streams to maintain readability and performance.
BestPracticesCodeOptimizationJava
0 likes · 11 min read

This article introduces Java 8's Optional class as a robust solution for avoiding NullPointerException, explains its creation methods, demonstrates common operations such as get, isPresent, ifPresent, filter, map, flatMap, orElse, orElseGet, orElseThrow, and provides practical usage scenarios and cautions for developers.
BestPracticesJavaJava8
0 likes · 16 min read

This article summarizes the common pitfalls, monitoring techniques, configuration guidelines, naming conventions, and practical code examples for safely using Java ThreadPoolExecutor, helping developers avoid OOM, deadlocks, and performance issues while optimizing thread‑pool usage.
BestPracticesConcurrencyJava
0 likes · 17 min read

This article explains the core concepts of Java thread pools, walks through the ThreadPoolExecutor class hierarchy and key methods, analyzes thread‑pool states and execution flow, and provides practical guidelines for configuring parameters, avoiding memory leaks, handling task dependencies, and managing exceptions in production systems.
BestPracticesConcurrencyJVM
0 likes · 23 min read

This article summarizes the key pitfalls and recommended practices for creating, configuring, monitoring, and naming Java thread pools, including proper declaration, parameter tuning for CPU‑ and I/O‑bound workloads, avoiding OOM and deadlocks, and leveraging dynamic pool frameworks.
BestPracticesConcurrencyJava
0 likes · 17 min read

This article explains how Java 8's Optional class can be used to avoid NullPointerException by providing a comprehensive guide that covers creation, common methods, practical use‑cases, and recent JDK 9 enhancements, complete with code examples and best‑practice recommendations.
BestPracticesFunctionalProgrammingJava
0 likes · 14 min read

This article explains the internal workings of Java's ThreadLocal, including the ThreadLocalMap structure, weak reference handling, lazy initialization, and common pitfalls such as memory leaks in thread pools, and provides best‑practice guidelines for safe usage.
BestPracticesConcurrencyJava
0 likes · 7 min read

This article outlines several frequent MySQL query pitfalls—including missing table aliases in multi‑table operations, unsupported FULL JOIN syntax, unexpected REPLACE INTO side effects, auto‑increment edge cases, data‑type mismatches, nondeterministic functions, and warning‑driven query behavior—providing examples and best‑practice recommendations to prevent data loss and performance issues.
BestPracticesDataIntegrityMySQL
0 likes · 14 min read

In large iOS apps like Meituan, navigation‑bar transitions require a systematic approach—using viewWillAppear/WillDisappear to modify styles, employing fake bars during pushes and pops, and following best‑practice rules—to avoid hard‑coded hacks, reduce coupling, and maintain scalable, reliable UI state.
BestPracticesMobileDevelopmentNavigationBar
0 likes · 29 min read

This article explains Java's exception hierarchy, distinguishes checked from unchecked exceptions, illustrates common pitfalls of overusing throws, and provides best‑practice guidelines for handling, documenting, and wrapping checked exceptions to improve API design and application robustness.
APIDesignBestPracticesCheckedException
0 likes · 14 min read


21CTONov 30, 2015 · Backend Development
This article explains why APIs are valuable assets, outlines the essential traits of a good API, and provides a step‑by‑step design process—including requirements gathering, naming, documentation, performance considerations, exception handling, and refactoring examples—illustrated with Java code snippets.
APIBestPracticesDesign
0 likes · 14 min read
