Tagged articles
35 articles
Page 1 of 1
Su San Talks Tech
Su San Talks Tech
Nov 4, 2025 · Fundamentals

Master Defensive Programming: Prevent Crashes with Smart Code Practices

This comprehensive guide explains defensive programming concepts, core principles, practical rules, and advanced techniques—showing how to validate inputs, handle exceptions, manage resources, use immutability, and apply system‑level patterns like circuit breakers and rate limiting to build robust, maintainable Java applications.

Error HandlingResource ManagementSoftware Robustness
0 likes · 26 min read
Master Defensive Programming: Prevent Crashes with Smart Code Practices
FunTester
FunTester
Oct 31, 2025 · Fundamentals

Master Defensive Programming: Turn Failures into Manageable Events

This article explains why defensive programming is essential, outlines its core principles, presents common failure scenarios and practical guidelines, and shows how testing and observability can turn inevitable errors into controlled, recoverable events that keep systems stable and maintainable.

Error Handlingdefensive programmingobservability
0 likes · 9 min read
Master Defensive Programming: Turn Failures into Manageable Events
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Oct 4, 2025 · Backend Development

8 Essential Defensive Programming Patterns for Spring Boot 3

This article explains why defensive programming is crucial for production‑grade Spring Boot 3 applications and presents eight concrete patterns—ranging from Optional‑based NPE safety and collection handling to configuration validation, async management, transaction control, testing, exception handling, circuit‑breaker integration, and reactive programming—each illustrated with real‑world code examples and best‑practice recommendations.

Spring Bootbackend-developmentbest practices
0 likes · 15 min read
8 Essential Defensive Programming Patterns for Spring Boot 3
JavaScript
JavaScript
Aug 28, 2025 · Frontend Development

Why You Should Ban == in JavaScript: Mastering Implicit Type Coercion

This article explains why top tech companies forbid the loose equality operator (==) in JavaScript, detailing its unpredictable implicit type coercion, contrasting it with strict equality (===), and showing common pitfalls and safer alternatives for robust, maintainable code.

== vs ===Strict EqualityType Coercion
0 likes · 5 min read
Why You Should Ban == in JavaScript: Mastering Implicit Type Coercion
Java Backend Technology
Java Backend Technology
Jul 18, 2025 · Backend Development

Why Did My New Java Developer Trigger NPE? Lessons & Fixes

A new Java developer caused a production NullPointerException while matching third‑party data, and the article walks through reproducing the bug, analyzing each faulty line, and applying defensive programming techniques such as early returns, Optional, Objects.equals, and collection checks to prevent similar crashes.

Objects.equalscode qualitydefensive programming
0 likes · 6 min read
Why Did My New Java Developer Trigger NPE? Lessons & Fixes
macrozheng
macrozheng
Jul 16, 2025 · Backend Development

Debugging NPEs in Spring Boot: Real‑World Case Study and Fixes

A junior Java developer encounters a NullPointerException while integrating third‑party data into a Spring Boot backend, and the article walks through reproducing the bug, analyzing each faulty line, and presenting defensive‑programming, ternary, Optional, and utility‑class solutions plus a SonarLint recommendation.

NPEdebuggingdefensive programming
0 likes · 6 min read
Debugging NPEs in Spring Boot: Real‑World Case Study and Fixes
JD Tech
JD Tech
Oct 9, 2024 · Fundamentals

Defensive Programming: Concepts, Core Principles, and Practical Java Examples

This article explains defensive programming as a proactive coding paradigm that anticipates and mitigates errors through input validation, error handling, assertions, and continuous testing, and demonstrates its application with detailed Java examples covering pagination, loop safety, exception management, and boundary checks.

Error HandlingSoftware Robustnessdefensive programming
0 likes · 15 min read
Defensive Programming: Concepts, Core Principles, and Practical Java Examples
JD Tech Talk
JD Tech Talk
Jul 26, 2024 · Fundamentals

Defensive Programming: Concepts, Core Principles, and Practical Cases

This article introduces defensive programming, explains its fundamental concepts and core principles such as risk identification and input validation, and demonstrates practical applications through multiple Java code examples covering pagination, loop prevention, exception handling, boundary checks, and assertions to improve software robustness.

Error HandlingSoftware Robustnessbest practices
0 likes · 13 min read
Defensive Programming: Concepts, Core Principles, and Practical Cases
JD Cloud Developers
JD Cloud Developers
Jul 25, 2024 · Fundamentals

Master Defensive Programming: Strategies to Build Robust Software

Defensive programming is a proactive coding paradigm that anticipates errors and exceptions, emphasizing input validation, error isolation, assertions, thorough testing, and clear error handling, with practical examples ranging from pagination parameter checks to loop safeguards, illustrating how to enhance software robustness and stability.

Error HandlingSoftware Robustnessdefensive programming
0 likes · 16 min read
Master Defensive Programming: Strategies to Build Robust Software
Architecture Breakthrough
Architecture Breakthrough
Jul 1, 2024 · Fundamentals

Why Defensive Programming Is More Than Just Defensive Coding

The article explains how defensive programming extends beyond simple input checks to include comprehensive data validation, parameter verification, illegal data handling, and collaborative design practices that protect systems from both code errors and external misuse.

api-designcode qualitydefensive programming
0 likes · 7 min read
Why Defensive Programming Is More Than Just Defensive Coding
Architecture Digest
Architecture Digest
Jun 23, 2024 · Backend Development

Debugging and Preventing NullPointerException in Java Backend Data Processing

This article presents a real-world Java backend case where null pointer exceptions arise during data matching and batch insertion, analyzes the root causes in each code line, and offers defensive programming, ternary, Optional, collection checks, and utility methods to safely handle null values.

collection-utilsdefensive programmingnullpointerexception
0 likes · 5 min read
Debugging and Preventing NullPointerException in Java Backend Data Processing
Top Architect
Top Architect
Jun 20, 2024 · Backend Development

When and How to Use Null Checks in Java: Best Practices and Alternatives

This article discusses the proper use of null‑checking in Java, distinguishes between valid and invalid null returns, proposes alternatives such as returning empty collections, using assertions or throwing exceptions, and demonstrates the Null Object pattern with concrete code examples while also noting related community resources.

Null Objectdefensive programmingjava
0 likes · 9 min read
When and How to Use Null Checks in Java: Best Practices and Alternatives
Java Backend Technology
Java Backend Technology
May 29, 2024 · Backend Development

Why NullPointerExceptions Still Haunt Java Developers—and How to Defeat Them

Java developers constantly battle NullPointerExceptions, a historic flaw introduced by Tony Hoare, but modern JDKs provide clearer messages and defensive techniques—such as explicit null checks, utility methods, avoiding null returns, and using Optional—can dramatically reduce these runtime errors.

BackendError Handlingdefensive programming
0 likes · 6 min read
Why NullPointerExceptions Still Haunt Java Developers—and How to Defeat Them
dbaplus Community
dbaplus Community
Mar 21, 2024 · Fundamentals

Why NullPointerExceptions Haunt Java Developers and How to Defeat Them

The article explores the notorious Java NullPointerException, its historical roots in Tony Hoare's introduction of null, modern JDK 14 diagnostic improvements, and practical defensive programming techniques—including explicit null checks, avoiding null returns, and leveraging Optional—to write safer, more robust code.

defensive programmingjava8nullpointerexception
0 likes · 6 min read
Why NullPointerExceptions Haunt Java Developers and How to Defeat Them
macrozheng
macrozheng
Dec 24, 2023 · Fundamentals

Master Defensive Programming: Unconventional Naming Tricks & OOP Hacks

This article revisits defensive programming, explores quirky variable‑naming techniques—including single‑character, Chinese, and multilingual identifiers—and humorously breaks down core OOP concepts while stressing the developer’s irreplaceable role in modern software projects.

OOPdefensive programmingjava
0 likes · 7 min read
Master Defensive Programming: Unconventional Naming Tricks & OOP Hacks
Tencent Cloud Developer
Tencent Cloud Developer
May 15, 2023 · Operations

Taking Over and Stabilizing a Complex Legacy System: Tencent's Practical Experience

Tencent’s team successfully took over a 93‑service legacy content architecture, stabilizing it by building comprehensive monitoring, creating detailed code walkthrough documentation, fixing critical bugs, and streamlining R&D processes, which cut daily alerts from 159 to zero, reduced business incidents, and lowered on‑call staffing dramatically.

alert-governanceci/cdcode-quality
0 likes · 24 min read
Taking Over and Stabilizing a Complex Legacy System: Tencent's Practical Experience
Java Captain
Java Captain
Sep 27, 2022 · Backend Development

Understanding and Preventing NullPointerException in Java Backend Development

This article presents a real-world Java backend case where a newly hired developer caused a NullPointerException during data matching and batch insertion, analyzes each line of the problematic code, and offers defensive programming techniques such as null checks, Optional, and utility methods to avoid NPEs.

backend-developmentdefensive programmingjava
0 likes · 5 min read
Understanding and Preventing NullPointerException in Java Backend Development
Java Backend Technology
Java Backend Technology
Sep 15, 2022 · Backend Development

How to Prevent NPEs in Java: Defensive Coding Tips for New Developers

This article walks through a real‑world NPE incident in a Java SpringBoot service, demonstrates how four lines of code can cause three null‑pointer exceptions, and provides practical defensive‑programming solutions such as early returns, ternary checks, Optional, and utility methods to eliminate these bugs.

NPESpringBootdefensive programming
0 likes · 6 min read
How to Prevent NPEs in Java: Defensive Coding Tips for New Developers
Programmer DD
Programmer DD
Sep 14, 2022 · Backend Development

How to Prevent Java NPEs: Real‑World Debugging and Defensive Coding Tips

This article walks through a real production NPE incident in a Java backend, reproduces the faulty code, analyzes each null‑pointer cause, and presents defensive programming, ternary, Optional, and utility‑library solutions while recommending SonarLint for automatic detection.

NPEdefensive programmingjava
0 likes · 6 min read
How to Prevent Java NPEs: Real‑World Debugging and Defensive Coding Tips
Cognitive Technology Team
Cognitive Technology Team
Jul 2, 2022 · Fundamentals

Defensive Programming Principles and Practices

The article outlines defensive programming concepts, emphasizing input validation, error handling, resource management, isolation techniques, and design considerations such as thread safety, cache strategies, and interface versioning to build robust and resilient software systems.

Error HandlingResource ManagementSoftware Robustness
0 likes · 4 min read
Defensive Programming Principles and Practices
Alibaba Terminal Technology
Alibaba Terminal Technology
Feb 28, 2022 · Frontend Development

Mastering Defensive Programming in Front‑end Development: Prevent, Correct, Guide

This article explains defensive programming for front‑end developers, covering its definition, the three pillars of prevention, correction and direction, common UI and code crisis points, detailed code‑review checklists, CSS defensive rules, and responsive design considerations to build resilient, user‑friendly applications.

CSS best practicesCode reviewError Handling
0 likes · 30 min read
Mastering Defensive Programming in Front‑end Development: Prevent, Correct, Guide
Alibaba Cloud Developer
Alibaba Cloud Developer
May 19, 2021 · Backend Development

Mastering Elegant Parameter Validation with Hibernate Validator

This article examines the challenges of repetitive if‑else parameter checks, introduces Hibernate Validator as a JSR‑303 implementation, demonstrates how to build a reusable validation module, and shares best‑practice patterns for integrating elegant, decoupled validation into Java backend systems.

Hibernate ValidatorJSR-303Parameter Validation
0 likes · 10 min read
Mastering Elegant Parameter Validation with Hibernate Validator
Youku Technology
Youku Technology
Aug 3, 2020 · Fundamentals

Mastering Defensive Programming: Guard Clauses, Exceptions, and DRY in Java

This article explains how to write robust Java code by applying defensive programming techniques such as guard clauses, proper exception handling, validator usage, assertions, and the DRY principle, while illustrating each concept with clear code examples and practical guidelines.

DRY principleException Handlingcode quality
0 likes · 20 min read
Mastering Defensive Programming: Guard Clauses, Exceptions, and DRY in Java
Youku Technology
Youku Technology
Jul 17, 2020 · Backend Development

Defensive Programming, Exception Handling, and DRY Principle in Java

The article explains how defensive programming in Java—using guard clauses, validators, and side‑effect‑free assertions—prevents errors, outlines proper exception handling by distinguishing checked from unchecked exceptions, and reinforces the DRY principle, urging developers to abstract repeated logic after three occurrences.

DRY principleException Handlingcode quality
0 likes · 18 min read
Defensive Programming, Exception Handling, and DRY Principle in Java
Alibaba Cloud Developer
Alibaba Cloud Developer
Jul 14, 2020 · Fundamentals

Write Robust Java Code: Defensive Programming, Smart Exceptions & DRY

This article explains how to write robust Java code by applying defensive programming, using guard clauses, proper exception handling, validator patterns, assertions, and the DRY principle, offering concrete code examples and practical advice for building reliable software.

DRY principleException Handlingcode robustness
0 likes · 19 min read
Write Robust Java Code: Defensive Programming, Smart Exceptions & DRY
21CTO
21CTO
Feb 8, 2016 · Fundamentals

Master Defensive Programming in PHP: Prevent Errors Before They Happen

This article explains defensive programming concepts for PHP developers, illustrating why anticipating failures, never trusting user input, avoiding assumptions, maintaining narrow focus, and keeping consistent syntax can dramatically reduce bugs and improve code reliability.

Error HandlingPHPcoding best practices
0 likes · 8 min read
Master Defensive Programming in PHP: Prevent Errors Before They Happen
Qunar Tech Salon
Qunar Tech Salon
Nov 13, 2015 · Backend Development

Top 10 Useful Yet Paranoid Java Programming Techniques

After two decades of coding, the author shares ten defensive, often‑considered paranoid Java programming practices—such as placing constants on the left side of equals, guarding against NullPointerExceptions, treating -1 as a valid index, using final for methods, variables, and parameters, and handling switch statements—to promote more robust code.

BackendParanoid Codingdefensive programming
0 likes · 7 min read
Top 10 Useful Yet Paranoid Java Programming Techniques
Qunar Tech Salon
Qunar Tech Salon
Jan 16, 2015 · Fundamentals

Best Practices for Null‑Safe Programming in Java

To avoid NullPointerException in Java, use string literals with equals, prefer String.valueOf over toString, employ null‑safe libraries like Apache Commons StringUtils, return empty collections instead of null, annotate with @NotNull/@Nullable, prevent unnecessary autoboxing, define sensible defaults, and use Jackson's path method for safe JSON navigation.

Apache CommonsJacksondefensive programming
0 likes · 5 min read
Best Practices for Null‑Safe Programming in Java