Skip to main content

Articles

2025


Why Do Python Scripts Use if __name__ == "__main__"?

Python
4 mins
Have you ever written a Python script, run it successfully, and then imported it into another program only to watch it behave strangely? Maybe it printed a prompt you didn’t expect or started an expensive computation as soon as you imported it.

Why Do Java Methods Modify Objects but Not Primitives?

Java
5 mins
Many new Java developers are surprised when a method quietly modifies an object but leaves a primitive variable untouched. Java parameter passing is always by value, but understanding how that works with objects versus primitives will help you avoid unexpected behavior.

3 Annotations to Speed Up Spring Bean Startup

Java
7 mins
Without having to radically change the Beans in your Spring Boot application, you can significantly speed up Spring bean startup times, just by using Annotations such as @Lazy, @Async, and @Profile.

Understanding the LEGB Rule for Variable Scope in Python

Python
5 mins
Python variables have different scopes: local, enclosing, global, and built-in, organized by the LEGB rule. Use globals() and locals() to inspect variable scope, and follow best practices to avoid naming conflicts

4 meta-programming techniques in Python

Python
5 mins
Meta-programming in Python allows developers to write code that manipulates code itself, enabling dynamic behavior and advanced programming techniques. Examples include decorators, metaclasses, and dynamic class creation.

How to Enforce Type Checking in Python

Python
7 mins
while Python does not enforce variable types at runtime, developers can use type hints in conjunction with static analysis tools or third-party libraries to impose type constraints.