Tagged articles
46 articles
Page 1 of 1
FunTester
FunTester
Oct 17, 2025 · Fundamentals

Why Does var Print 2 Twice? Unraveling JavaScript’s Function Scope and Hoisting

This article explains why a JavaScript function using var prints “2” twice, by detailing var’s function scope, variable hoisting, the compilation and execution phases, and contrasting the behavior with let and const, while offering practical coding recommendations to avoid common pitfalls.

JavaScriptVarconst
0 likes · 9 min read
Why Does var Print 2 Twice? Unraveling JavaScript’s Function Scope and Hoisting
Code Mala Tang
Code Mala Tang
Oct 1, 2025 · Fundamentals

Master Python’s LEGB Rule: Scope Secrets for Faster, Safer Code

This article explains Python’s LEGB rule—Local, Enclosing, Global, Built‑in scopes—detailing each namespace with clear code examples, demonstrating name resolution order, performance impacts, and practical best‑practice tips such as minimizing globals, using nested scopes, and avoiding built‑in overrides.

LEGBNamespacebest practices
0 likes · 12 min read
Master Python’s LEGB Rule: Scope Secrets for Faster, Safer Code
Liangxu Linux
Liangxu Linux
Aug 20, 2025 · Fundamentals

Unlock the Power of C’s static Keyword: Memory, Scope, and Real‑World Uses

This article explains the C static keyword, showing how it gives local variables persistent memory, restricts global symbols to a single file, and enables shared data across structs, with clear code examples, common patterns like singletons and cached Fibonacci, and important pitfalls to avoid.

CMemoryprogramming fundamentals
0 likes · 12 min read
Unlock the Power of C’s static Keyword: Memory, Scope, and Real‑World Uses
php Courses
php Courses
Jul 18, 2025 · Fundamentals

Master C++ Functions: Definitions, Calls, Parameters, and Scope Explained

This article provides a comprehensive guide to C++ functions, covering their definition syntax, various calling methods, parameter passing mechanisms, return value handling, and variable scope rules, supplemented with clear code examples and practical demonstrations.

CParameter PassingReturn values
0 likes · 6 min read
Master C++ Functions: Definitions, Calls, Parameters, and Scope Explained
Code Mala Tang
Code Mala Tang
Apr 21, 2025 · Fundamentals

Unlock Python’s Secrets: Master Namespaces and Scope Explained

This article demystifies Python namespaces, explaining how names map to objects, distinguishing them from scope, detailing the LEGB rule, illustrating built‑in, global, local, and nested namespaces, their lifecycles, and showing practical debugging techniques with locals() and globals().

NamespacesPythonscope
0 likes · 9 min read
Unlock Python’s Secrets: Master Namespaces and Scope Explained
JavaScript
JavaScript
Mar 2, 2025 · Frontend Development

Why ‘var’ Is Dangerous and How let/const Solve Its Pitfalls

This article examines why the traditional JavaScript var keyword should be avoided, explains the subtle pitfalls of its function scope, hoisting, and global leakage, and highlights the essential, often overlooked features of let and const—including temporal dead zone, true block scope, and immutability nuances.

JavaScriptVarconst
0 likes · 8 min read
Why ‘var’ Is Dangerous and How let/const Solve Its Pitfalls
IT Services Circle
IT Services Circle
Nov 16, 2023 · Frontend Development

Upcoming CSS Features: text-wrap, @scope, form-sizing, view-transition, light-dark(), and Nesting

This article introduces several upcoming CSS specifications—including text-wrap with balance and pretty values, the @scope rule for scoped styling, form-sizing for auto‑resizing textareas, view‑transition for seamless page transitions, the light‑dark() function for theme‑aware colors, and native CSS nesting—explaining their purpose, usage, and browser support.

CSSNew Featureslight-dark
0 likes · 6 min read
Upcoming CSS Features: text-wrap, @scope, form-sizing, view-transition, light-dark(), and Nesting
Cognitive Technology Team
Cognitive Technology Team
Jul 23, 2023 · Backend Development

How to Resolve Maven JAR Dependency Conflicts

This article explains common Maven JAR dependency conflict scenarios and presents four practical solutions—including using Exclusions, configuring dependency scopes, applying the Maven Shade plugin for class relocation, and employing class‑loader isolation strategies—to help developers choose the appropriate method for their build and runtime environments.

ExclusionsShade Plugindependency management
0 likes · 4 min read
How to Resolve Maven JAR Dependency Conflicts
php Courses
php Courses
Jul 5, 2023 · Frontend Development

Understanding var, let, and const in JavaScript

This article explains the differences between JavaScript's var, let, and const declarations, covering their scopes, hoisting behavior, and mutability, and provides clear code examples for each. It also highlights how const variables can still be modified when they hold objects or arrays, helping developers choose the right keyword for reliable code.

JavaScriptVarconst
0 likes · 5 min read
Understanding var, let, and const in JavaScript
AI Cyberspace
AI Cyberspace
Mar 4, 2023 · Fundamentals

Master C Variables, Constants, and Scope: From #define to static

This article explains C variables and constants, their three components, key differences, how to define symbolic constants with #define, use the const keyword, understand various scopes, the static storage class, and the distinction between declarations and definitions, all illustrated with code examples.

CConstantsVariables
0 likes · 12 min read
Master C Variables, Constants, and Scope: From #define to static
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Nov 9, 2022 · Fundamentals

Understanding JavaScript Variable Lookup and Scope from the ECMAScript Specification and V8 Engine Perspective

The article explains how JavaScript variable lookup and lexical scope are determined during compilation by the V8 engine, covering the language's compiled‑and‑interpreted nature, JIT optimizations, AST generation, lazy parsing, dynamic lookups, and bytecode creation to demystify runtime performance.

CompilationECMAScriptJIT
0 likes · 14 min read
Understanding JavaScript Variable Lookup and Scope from the ECMAScript Specification and V8 Engine Perspective
Python Programming Learning Circle
Python Programming Learning Circle
Sep 24, 2022 · Fundamentals

Common Python Pitfalls: Dynamic Typing, Mutable Default Arguments, Scope, and List Modification

This article examines several confusing behaviors in Python—including implicit variable declarations, mutable default arguments, class variable inheritance, scope rules, and list‑modification during iteration—illustrating each with code examples and offering practical solutions for developers.

Class VariablesPythondynamic typing
0 likes · 9 min read
Common Python Pitfalls: Dynamic Typing, Mutable Default Arguments, Scope, and List Modification
Top Architect
Top Architect
Mar 14, 2022 · Backend Development

Understanding Spring Controller Scope: Singleton vs Prototype and Best Practices

This article explains why Spring MVC controllers are singleton by default, demonstrates the thread‑unsafe behavior of using instance fields, shows how applying @Scope("prototype") changes the behavior, and provides practical recommendations such as avoiding mutable fields, using prototype scope or ThreadLocal for safe controller design.

ControllerJavaSingleton
0 likes · 6 min read
Understanding Spring Controller Scope: Singleton vs Prototype and Best Practices
Architect's Tech Stack
Architect's Tech Stack
Aug 29, 2021 · Backend Development

Mastering Maven: 7 Essential Topics for Java Project Build Management

This article explains Maven’s repository types, dependency declaration, conflict resolution strategies, best‑practice tips, standard directory layout, lifecycle phases, and scope definitions, providing Java developers with the knowledge needed to use Maven confidently in multi‑module projects.

Build ToolJavaProject Structure
0 likes · 10 min read
Mastering Maven: 7 Essential Topics for Java Project Build Management
360 Tech Engineering
360 Tech Engineering
Aug 3, 2021 · Fundamentals

Common Go Pitfalls: Loop Variable Capture, := Scope, Goroutine Pools, and Struct Memory Alignment

This article examines several subtle Go programming issues—including unexpected loop variable addresses, the scope nuances of the := operator, proper handling of goroutine concurrency with worker pools, and how struct field ordering affects memory alignment—providing code examples and practical solutions to avoid these pitfalls.

GoGoroutineLoop Variable
0 likes · 15 min read
Common Go Pitfalls: Loop Variable Capture, := Scope, Goroutine Pools, and Struct Memory Alignment
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jul 1, 2021 · Backend Development

Mastering Spring @Scope: Custom Scopes, Prototypes, and Injection Techniques

This guide explains how Spring's @Scope annotation determines bean lifecycles, shows the underlying source code handling singleton and prototype scopes, demonstrates creating and registering a custom scope, and provides practical examples of using custom and prototype-scoped beans with proper proxy configuration in Spring Boot.

Custom Scopedependency-injectionprototype
0 likes · 7 min read
Mastering Spring @Scope: Custom Scopes, Prototypes, and Injection Techniques
ELab Team
ELab Team
Apr 21, 2021 · Frontend Development

Master JavaScript Scope, Context, and Closures: From Basics to React

This article explains JavaScript’s scope types, execution context, activation objects, and the lifecycle of functions, illustrating how closures retain memory, how garbage collection works, and provides practical solutions for common closure pitfalls in React functional components.

JavaScriptReactclosure
0 likes · 12 min read
Master JavaScript Scope, Context, and Closures: From Basics to React
Top Architect
Top Architect
Dec 8, 2020 · Backend Development

Understanding Thread Safety of Spring Beans: Singleton vs Prototype Scope

This article explains why Spring beans are not inherently thread‑safe, compares the singleton and prototype scopes, shows how stateless beans can be safe, demonstrates the impact of static fields and injected beans, and provides practical code examples and recommendations for achieving thread safety in Spring applications.

JavaSingletonbean
0 likes · 11 min read
Understanding Thread Safety of Spring Beans: Singleton vs Prototype Scope
Senior Brother's Insights
Senior Brother's Insights
Dec 1, 2020 · Backend Development

How to Slim Down Maven Builds Using Optional and Scope Settings

This guide explains how misusing Maven's optional and scope elements can bloat JAR/WAR files and slow compilation, and shows practical configurations—including code examples and dependency inheritance scenarios—to reduce artifact size, improve build speed, and avoid version conflicts.

Build OptimizationJavamaven
0 likes · 9 min read
How to Slim Down Maven Builds Using Optional and Scope Settings
Selected Java Interview Questions
Selected Java Interview Questions
Jul 27, 2020 · Backend Development

Understanding Spring Controller Scope and Thread Safety

The article explains why Spring MVC controllers are singleton by default, demonstrates the resulting thread‑unsafe behavior with example code, shows how applying @Scope("prototype") makes them prototype scoped, and provides best‑practice recommendations and a summary of Spring bean scopes.

ControllerSingletonbean
0 likes · 5 min read
Understanding Spring Controller Scope and Thread Safety
Python Crawling & Data Mining
Python Crawling & Data Mining
May 8, 2020 · Fundamentals

Master Python Functions: From Basics to Advanced Usage

This article explains what Python functions are, why they are useful, how to define and call them, the different ways to pass parameters—including positional, keyword, default, *args and **kwargs—covers return values, variable scope, and provides numerous code examples with illustrations.

Return valuesfunctionsparameters
0 likes · 8 min read
Master Python Functions: From Basics to Advanced Usage
Java Captain
Java Captain
Jun 24, 2019 · Backend Development

Understanding Maven: From Pre‑Maven Days to Dependency Management and Configuration

This article explains the historical problems Maven solves, describes Maven repository types, default settings, project structure, common commands, pom.xml elements, dependency scopes, transitive dependencies, conflict resolution strategies, and how to exclude unwanted artifacts, providing a comprehensive guide for Java developers.

Build ToolDependency ConflictJava
0 likes · 12 min read
Understanding Maven: From Pre‑Maven Days to Dependency Management and Configuration
Ops Development Stories
Ops Development Stories
Dec 29, 2018 · Fundamentals

Master Python Functions: From Basics to Advanced Techniques

This comprehensive guide explains Python functions—their purpose, definition syntax, scope rules, built‑in statements like def, return, global, nonlocal, and lambda, various argument types, recursion, higher‑order functions, and functional tools such as map, filter, and reduce—complete with runnable code examples.

LambdaRecursionarguments
0 likes · 20 min read
Master Python Functions: From Basics to Advanced Techniques
Tencent IMWeb Frontend Team
Tencent IMWeb Frontend Team
Aug 13, 2017 · Frontend Development

Top 13 Tricky JavaScript Interview Questions with Detailed Answers

This article presents a curated set of thirteen challenging JavaScript interview questions, each accompanied by the original code snippet, the correct answer, and an in‑depth explanation of why the answer is what it is, helping front‑end engineers sharpen their understanding of functions, scope, hoisting, and the this binding.

Coding Questionsanswersfunctions
0 likes · 11 min read
Top 13 Tricky JavaScript Interview Questions with Detailed Answers
21CTO
21CTO
Mar 8, 2016 · Frontend Development

Master JavaScript Scope & Context: From Basics to Advanced Patterns

This article explains the fundamental differences between scope and context in JavaScript, covers variable scope, execution contexts, the scope chain, closures, module patterns, call/apply/bind methods, and ES6 arrow functions, providing clear code examples for each concept.

BINDExecutionContextJavaScript
0 likes · 14 min read
Master JavaScript Scope & Context: From Basics to Advanced Patterns
Java High-Performance Architecture
Java High-Performance Architecture
Oct 20, 2015 · Frontend Development

Mastering JavaScript’s ‘this’: Common Pitfalls and Clear Examples

Understanding JavaScript’s ‘this’ keyword can be confusing, so this guide breaks down its core concept as the current object’s owner and walks through three illustrative examples that reveal how ‘this’ resolves to the global object, a specific object, or remains undefined in various contexts.

JavaScriptfrontendfunction context
0 likes · 3 min read
Mastering JavaScript’s ‘this’: Common Pitfalls and Clear Examples
Java High-Performance Architecture
Java High-Performance Architecture
Oct 13, 2015 · Frontend Development

Understanding JavaScript Hoisting: Why console.log(test) Returns Undefined

JavaScript executes code by first compiling function and var declarations within a scope, then running statements top‑to‑bottom, which explains why accessing a var‑declared variable before its assignment yields undefined while referencing an undeclared variable throws an error, as illustrated through detailed examples.

JavaScriptVarexecution
0 likes · 4 min read
Understanding JavaScript Hoisting: Why console.log(test) Returns Undefined