Tag

result pattern

1 views collected around this technical thread.

Code Mala Tang
Code Mala Tang
Mar 27, 2025 · Fundamentals

Why Returning None Is Bad and Better Ways to Handle Missing Values in Python

Returning None for missing data can cause unexpected crashes, so this article explains why that approach is problematic and demonstrates safer alternatives in Python, such as using default values with dict.get, raising exceptions when appropriate, and employing result objects to clearly indicate success or failure.

None handlingPythondefault values
0 likes · 3 min read
Why Returning None Is Bad and Better Ways to Handle Missing Values in Python
Top Architect
Top Architect
Jul 17, 2024 · Backend Development

Designing a Unified API Response Structure with Annotations and Interceptors in Spring Boot

This article explains how to design a unified API response format in Spring Boot, defining a JSON result structure with code, message, and data, organizing status codes, using @ResponseResult annotation, implementing interceptors and ResponseBodyAdvice to automatically wrap controller outputs, and offers optimization tips for clean backend development.

API designAnnotationsInterceptors
0 likes · 10 min read
Designing a Unified API Response Structure with Annotations and Interceptors in Spring Boot