Tagged articles
72 articles
Page 1 of 1
Lisa Notes
Lisa Notes
Mar 27, 2026 · Fundamentals

Python Learning Day 60: Mastering pass, while/for Loops, break‑continue and String Operations

This tutorial‑style note walks through Python’s pass statement, the mechanics of while and for loops (including nested loops and common pitfalls), the use of break and continue, and a comprehensive overview of string creation, slicing, case conversion, searching, replacement, and encoding, all illustrated with concrete code examples and expected outputs.

PythonSlicingString Manipulation
0 likes · 23 min read
Python Learning Day 60: Mastering pass, while/for Loops, break‑continue and String Operations
Lisa Notes
Lisa Notes
Mar 19, 2026 · Fundamentals

Python Basics: Using break, continue, and Nested Loops

This tutorial explains how break and continue control loop execution in Python, provides concrete while‑loop examples with their outputs, and demonstrates both for‑ and while‑based nested loops for printing multi‑row patterns, illustrating syntax and behavior step by step.

Pythonbreakcontinue
0 likes · 4 min read
Python Basics: Using break, continue, and Nested Loops
JavaScript
JavaScript
Dec 24, 2025 · Frontend Development

Beyond the Classic for Loop: Modern JavaScript Iteration Techniques

This article examines why traditional JavaScript for loops are often suboptimal and introduces more readable, functional, and powerful alternatives such as array methods, for...of, for...in, and the spread operator, while also outlining scenarios where the classic for loop still shines.

JavaScriptarray methodses6
0 likes · 7 min read
Beyond the Classic for Loop: Modern JavaScript Iteration Techniques
macrozheng
macrozheng
Nov 8, 2025 · Backend Development

Should try‑catch Be Inside or Outside a for Loop? Pros, Cons, and Performance

This article explains how placing a try‑catch block inside or outside a Java for loop affects exception handling, loop termination, and performance, providing code examples, execution results, memory analysis, and practical guidance for choosing the appropriate approach based on business needs.

Exception Handlingfor loopperformance
0 likes · 5 min read
Should try‑catch Be Inside or Outside a for Loop? Pros, Cons, and Performance
JavaScript
JavaScript
Oct 29, 2025 · Frontend Development

Why Traditional JavaScript for Loops Are Losing Ground—and What to Use Instead

While the classic JavaScript for loop remains fundamental, modern ECMAScript features and array methods like forEach, map, filter, and newer constructs such as for…of and the spread operator offer more readable, functional, and often more efficient alternatives, each suited to different scenarios.

JavaScriptarray methodses6
0 likes · 7 min read
Why Traditional JavaScript for Loops Are Losing Ground—and What to Use Instead
php Courses
php Courses
Sep 19, 2025 · Backend Development

Master PHP Functions: Define, Pass, Loop, and Return Arrays

This guide explains how to define, pass, iterate over, and return arrays within PHP functions, covering array creation with array(), parameter passing, traversal using both for and foreach loops, and returning modified arrays, complete with full code examples for each step.

ArraysBackend DevelopmentCode Tutorial
0 likes · 5 min read
Master PHP Functions: Define, Pass, Loop, and Return Arrays
JavaScript
JavaScript
Sep 4, 2025 · Frontend Development

Beyond the Classic for Loop: Modern JavaScript Iteration Techniques

This article examines why the traditional JavaScript for loop is often suboptimal and explores newer, more readable and functional iteration methods such as array helpers, for...of, for...in, and the spread operator, while also outlining scenarios where the classic for loop still shines.

JavaScriptarray methodses6
0 likes · 7 min read
Beyond the Classic for Loop: Modern JavaScript Iteration Techniques
Code Mala Tang
Code Mala Tang
Jul 21, 2025 · Fundamentals

Why Python’s Loop‑Else Isn’t a Mistake: The Hidden Power of Else in for/while

Python’s else clause, often misunderstood as part of if‑else, actually executes only when a for or while loop completes without encountering a break, offering a concise way to handle search patterns, break detection, and post‑loop actions, but it can confuse developers unfamiliar with this subtle feature.

Code PatternsControl Flowfor loop
0 likes · 7 min read
Why Python’s Loop‑Else Isn’t a Mistake: The Hidden Power of Else in for/while
php Courses
php Courses
Jul 15, 2025 · Fundamentals

Master C++ Loops: When to Use for, while, and do-while

Learn the three core C++ loop structures—for, while, and do-while—including their syntax, practical examples, control statements like break and continue, plus common pitfalls to avoid for reliable programming.

CLoopscontrol statements
0 likes · 6 min read
Master C++ Loops: When to Use for, while, and do-while
php Courses
php Courses
May 26, 2025 · Backend Development

Flow Control in Go (Golang): if/else, for, switch, break, continue, and goto

This article explains Go's flow‑control constructs—including conditional statements, loops, switch branches, and special statements like break, continue, and goto—provides syntax details, highlights key characteristics, and offers multiple code examples to help developers write clear and efficient Go code.

Flow ControlGoGolang
0 likes · 9 min read
Flow Control in Go (Golang): if/else, for, switch, break, continue, and goto
Code Mala Tang
Code Mala Tang
Apr 15, 2025 · Fundamentals

What Really Happens Inside a Python for-loop? Uncover the Magic of Iterators

This article demystifies Python’s for-loop by explaining how iterable objects and iterators work under the hood, illustrating the iterator protocol with code examples, and providing practical custom iterator implementations, common pitfalls, and tips for efficient data processing.

IterablePythondata-processing
0 likes · 9 min read
What Really Happens Inside a Python for-loop? Uncover the Magic of Iterators
Selected Java Interview Questions
Selected Java Interview Questions
Jan 16, 2025 · Backend Development

Ten Reasons to Prefer Traditional for Loop Over Stream.forEach for List Traversal in Java

Through benchmark tests, memory analysis, and code examples, this article presents ten compelling reasons why using a traditional for loop to traverse Java Lists often outperforms Stream.forEach in terms of performance, memory usage, control flow, exception handling, mutability, debugging, readability, and state management.

BenchmarkDebuggingJava
0 likes · 16 min read
Ten Reasons to Prefer Traditional for Loop Over Stream.forEach for List Traversal in Java
JavaScript
JavaScript
Jan 15, 2025 · Frontend Development

Why Traditional JavaScript for Loops Are Obsolete and Better Alternatives

Although the classic JavaScript for loop remains fundamental, modern ECMAScript features and array methods like forEach, map, filter, and newer constructs such as for…of provide more readable, functional, and concise ways to iterate, while the traditional loop still has niche uses where precise control or performance matters.

JavaScriptes6for loop
0 likes · 7 min read
Why Traditional JavaScript for Loops Are Obsolete and Better Alternatives
Top Architecture Tech Stack
Top Architecture Tech Stack
Nov 5, 2024 · Backend Development

When to Place try‑catch Inside or Outside a for Loop in Java

This article explains the functional differences, performance impact, and practical considerations of placing a try‑catch block either outside or inside a Java for loop, illustrating each approach with code examples, execution results, and recommendations based on business requirements.

Backend DevelopmentException HandlingJava
0 likes · 6 min read
When to Place try‑catch Inside or Outside a for Loop in Java
Code Mala Tang
Code Mala Tang
Oct 4, 2024 · Frontend Development

Which JavaScript Loop Is Fastest? Benchmark Results Revealed

This article benchmarks various JavaScript looping constructs—including for, while, do‑while, for‑of, forEach, map, filter, reduce, some, every, and find—by moving 50 million items between arrays and measuring execution time to determine the fastest approaches.

BenchmarkMAPfor loop
0 likes · 8 min read
Which JavaScript Loop Is Fastest? Benchmark Results Revealed
Architecture Digest
Architecture Digest
Sep 26, 2024 · Backend Development

Should try‑catch be placed inside or outside a for loop in Java?

The article explains the trade‑offs of placing a Java try‑catch block inside versus outside a for‑loop, illustrating both approaches with code examples, and advises choosing the placement based on whether you need unified error handling or per‑iteration resilience, while also noting a free book promotion.

Backend DevelopmentException HandlingJava
0 likes · 4 min read
Should try‑catch be placed inside or outside a for loop in Java?
macrozheng
macrozheng
Aug 14, 2024 · Backend Development

When to Put try‑catch Inside or Outside a for Loop? Practical Insights

This article explains the different effects of placing a try‑catch block inside versus outside a for loop in Java, covering usage scenarios, performance impact, memory consumption, and practical recommendations for choosing the appropriate approach during development.

Backend DevelopmentException HandlingJava
0 likes · 6 min read
When to Put try‑catch Inside or Outside a for Loop? Practical Insights
Test Development Learning Exchange
Test Development Learning Exchange
Jul 11, 2024 · Fundamentals

Master Python Control Flow: If, For, While Explained with Real Examples

This guide walks beginners through Python's control flow structures—if statements, for loops, and while loops—explaining their syntax, demonstrating multiple conditional checks, iteration over sequences, and combined usage with clear code examples that illustrate filtering, accumulation, and prime number detection.

Control Flowfor loopif statement
0 likes · 4 min read
Master Python Control Flow: If, For, While Explained with Real Examples
Liangxu Linux
Liangxu Linux
Jun 17, 2024 · Frontend Development

JavaScript Control Flow Essentials: Loops, Conditionals, and Hidden Password Tricks

This article showcases practical JavaScript snippets—including a 40‑iteration for‑loop, various if‑statement patterns, hidden password field tricks, complex else chains, while‑loop limits, and odd/even detection—illustrated with screenshots and commentary to help developers understand control flow and coding style nuances.

Code ExamplesControl FlowJavaScript
0 likes · 4 min read
JavaScript Control Flow Essentials: Loops, Conditionals, and Hidden Password Tricks
php Courses
php Courses
Jan 12, 2024 · Backend Development

Four Ways to Reverse an Array in PHP

This article demonstrates four methods to reverse a PHP array—including the built‑in array_reverse() function, a manual for‑loop swap, an array_reduce() technique, and a combination of array_multisort() with array_column()—explaining their usage, code examples, and output results.

BackendPHParray_column
0 likes · 6 min read
Four Ways to Reverse an Array in PHP
Architect
Architect
Jan 2, 2024 · Fundamentals

Should try‑catch Live Inside or Outside a Loop? A Detailed Java Analysis

This article compares placing a try‑catch block inside versus outside a Java for‑loop, showing concrete code examples, execution results, memory‑usage measurements, and practical recommendations based on how exceptions affect loop termination and performance.

Exception HandlingJavaMemory Usage
0 likes · 7 min read
Should try‑catch Live Inside or Outside a Loop? A Detailed Java Analysis
Java Architect Essentials
Java Architect Essentials
Dec 10, 2023 · Fundamentals

Common For‑Loop Optimizations in Java

This article presents more than ten practical techniques for writing faster, cleaner Java for‑loops, covering basic size caching, reverse iteration, iterator usage, enhanced for‑loops, nested loop reduction, exception handling placement, and method‑call minimization to improve overall program performance.

Javacoding best practicesfor loop
0 likes · 8 min read
Common For‑Loop Optimizations in Java
Java Interview Crash Guide
Java Interview Crash Guide
Nov 1, 2023 · Backend Development

10+ Proven Ways to Supercharge Java for‑Loops for Faster Code

This article outlines over ten practical techniques for optimizing Java for‑loops, including caching list size, using reverse iteration, employing iterators, leveraging enhanced for‑each loops, minimizing method calls, and handling exceptions efficiently, helping developers write cleaner and more performant code.

best-practicescodingfor loop
0 likes · 7 min read
10+ Proven Ways to Supercharge Java for‑Loops for Faster Code
Top Architect
Top Architect
May 11, 2022 · Fundamentals

Why Java’s for(;;) Loop Exists and Its Bytecode Equivalence to while(true)

The article explains the origin of Java’s for(;;) infinite loop syntax, compares it with while(true) through source‑code searches and bytecode analysis, and concludes that both constructs compile to identical bytecode, making performance differences negligible while also providing related promotional links.

JDKJavafor loop
0 likes · 5 min read
Why Java’s for(;;) Loop Exists and Its Bytecode Equivalence to while(true)
Sohu Tech Products
Sohu Tech Products
Dec 22, 2021 · Fundamentals

The Fastest Way to Loop in Python: Using Built‑in Functions and Math Instead of While/For Loops

This article demonstrates that in Python, plain while and for loops are significantly slower than using built‑in functions like sum or applying a direct mathematical formula, because the former execute extra Python‑level boundary checks and increments, making the latter the most efficient looping alternatives.

Sumbuilt-in functionsfor loop
0 likes · 7 min read
The Fastest Way to Loop in Python: Using Built‑in Functions and Math Instead of While/For Loops
macrozheng
macrozheng
Dec 3, 2021 · Backend Development

i++ vs ++i in Java: Which Is Faster in Loops? Bytecode Deep Dive

An interview question about choosing i++ or ++i in a for‑loop leads to a bytecode‑level analysis that reveals both forms compile to the same ++i instruction after JVM optimization, making their performance essentially identical in typical Java loops.

Javabytecodefor loop
0 likes · 8 min read
i++ vs ++i in Java: Which Is Faster in Loops? Bytecode Deep Dive
Programmer DD
Programmer DD
Oct 27, 2021 · Backend Development

Why Removing Elements from a Java List Often Fails and How to Fix It

This article explains common pitfalls when deleting elements from a Java List—such as index shifting, ConcurrentModificationException in foreach loops, and the difference between removing by index versus by object—and provides reliable solutions using index adjustment, reverse iteration, and Iterator.remove().

ConcurrentModificationExceptionIteratorJava
0 likes · 8 min read
Why Removing Elements from a Java List Often Fails and How to Fix It
21CTO
21CTO
Sep 2, 2021 · Fundamentals

7 Proven Ways to Supercharge Java For‑Loops and Slash Execution Time

Learn how to dramatically improve Java for‑loop performance by applying seven practical techniques—including caching list size, using combined loop variables, iterating backwards, leveraging Iterator, enhanced for‑each syntax, minimizing nested loops, and moving exception handling outside—each with clear pros, cons, and code examples.

codingfor loopoptimization
0 likes · 5 min read
7 Proven Ways to Supercharge Java For‑Loops and Slash Execution Time
Java High-Performance Architecture
Java High-Performance Architecture
Aug 3, 2021 · Frontend Development

Which JavaScript Loop Wins? A Speed and Use‑Case Battle of for, forEach, map, for…in and for…of

This article compares five JavaScript iteration constructs—classic for, forEach, map, for...in and for...of—explaining their origins, semantics, performance characteristics, and appropriate use‑cases, while providing concrete code examples and guidance on breaking, continuing, and avoiding common pitfalls.

JavaScriptMAPfor loop
0 likes · 12 min read
Which JavaScript Loop Wins? A Speed and Use‑Case Battle of for, forEach, map, for…in and for…of
Top Architect
Top Architect
May 30, 2021 · Backend Development

Comparing Java's for(;;) and while(true) Loops and Their Generated Bytecode

The article explains the historical origin of Java's for(;;) loop, compares it with while(true) in terms of readability and bytecode generation, and shows that both constructs compile to identical bytecode in the standard javac compiler, making performance differences negligible.

JavaLoopsbytecode
0 likes · 4 min read
Comparing Java's for(;;) and while(true) Loops and Their Generated Bytecode
Python Programming Learning Circle
Python Programming Learning Circle
Mar 28, 2021 · Fundamentals

Understanding Python's for Loop: Syntax, Else Clause, Iterables, Iterators, and Bytecode Disassembly

This article explains Python's for loop in depth, covering basic syntax, the optional else clause, the concepts of iterables and iterators, how to implement custom iterators and iterable objects, the loop's execution flow, an equivalent while‑loop implementation, and a step‑by‑step disassembly of the generated bytecode.

Iterablebytecodedisassembly
0 likes · 12 min read
Understanding Python's for Loop: Syntax, Else Clause, Iterables, Iterators, and Bytecode Disassembly
Python Programming Learning Circle
Python Programming Learning Circle
Mar 27, 2021 · Fundamentals

Understanding and Using For Loops in Python

This article explains the purpose, syntax, and practical usage of Python's for loop, covering iteration over lists, strings, ranges, conditional filtering, loop control statements, list comprehensions, and real‑world examples with complete code snippets.

LoopsTutorialfor loop
0 likes · 7 min read
Understanding and Using For Loops in Python
KooFE Frontend Team
KooFE Frontend Team
Feb 9, 2021 · Frontend Development

Which JavaScript Loop Is Fastest? Benchmark Results and Best Use Cases

This article compares the performance of common JavaScript looping constructs—including for, reverse for, forEach, for...of, for...in, and for...await—provides benchmark code on a million‑element array, explains the speed differences, and offers guidance on choosing the right loop for readability and maintainability.

BenchmarkJavaScriptLoops
0 likes · 7 min read
Which JavaScript Loop Is Fastest? Benchmark Results and Best Use Cases
Programmer DD
Programmer DD
Jun 19, 2020 · Fundamentals

Infinite Loops in Java: while(true) vs for(;;) – Which Is Better?

This article compares the two common ways to write infinite loops in Java—while(true) and for(;;)—exploring their origins, usage differences, and performance by examining JDK source counts and compiled bytecode, concluding they are functionally equivalent.

Javafor loopinfinite loop
0 likes · 5 min read
Infinite Loops in Java: while(true) vs for(;;) – Which Is Better?
macrozheng
macrozheng
Jun 15, 2020 · Backend Development

Avoid ConcurrentModificationException: Safe Ways to Remove Elements While Iterating in Java

This article explains why removing items from a Java List inside a foreach loop triggers java.util.ConcurrentModificationException and demonstrates three reliable alternatives—using Iterator.remove(), a forward for‑loop with index adjustment, and a reverse for‑loop—to safely modify collections during iteration.

ConcurrentModificationExceptionIteratorJava
0 likes · 7 min read
Avoid ConcurrentModificationException: Safe Ways to Remove Elements While Iterating in Java
Java Backend Technology
Java Backend Technology
Jun 13, 2020 · Fundamentals

Why Does foreach Throw ConcurrentModificationException and How to Fix It?

During a Java interview, a common mistake of using a foreach loop to remove elements from an ArrayList triggers a ConcurrentModificationException; this article explains the underlying iterator mechanism, shows the bytecode behavior, and presents four safe alternatives—including iterator.remove(), forward and backward for-loops—to avoid the error.

ArrayListConcurrentModificationExceptionIterator
0 likes · 7 min read
Why Does foreach Throw ConcurrentModificationException and How to Fix It?
Selected Java Interview Questions
Selected Java Interview Questions
Apr 27, 2020 · Fundamentals

How to Remove Elements from a List Without Causing java.util.ConcurrentModificationException

This article explains why removing items from a Java List inside a foreach loop triggers a ConcurrentModificationException and demonstrates three correct approaches—using Iterator.remove(), a forward indexed for loop with index correction, and a reverse for loop—each with full code examples and output.

ArrayListConcurrentModificationExceptionIterator
0 likes · 6 min read
How to Remove Elements from a List Without Causing java.util.ConcurrentModificationException
ITPUB
ITPUB
Feb 21, 2020 · Fundamentals

Boost Python Skills: For Loops vs List Comprehensions Explained

This article explains how Python’s for loops work, introduces list comprehensions as a concise alternative, compares their performance and readability, and provides numerous code examples—including dictionary, set, and multi‑loop comprehensions with conditional logic—to help developers write clearer, more efficient code.

Code Examplesfor looplist-comprehension
0 likes · 8 min read
Boost Python Skills: For Loops vs List Comprehensions Explained
Liangxu Linux
Liangxu Linux
Jan 20, 2020 · Fundamentals

Master Unix Shell: Automate File Tasks with For Loops and Find

This guide shows how to use Unix shell for‑loops and the find command to batch‑process files, resize images with ImageMagick, limit iterations, handle numeric loops, and adapt the syntax for different shells, providing practical examples and complete command snippets.

ImageMagickUnixfind
0 likes · 11 min read
Master Unix Shell: Automate File Tasks with For Loops and Find
MaGe Linux Operations
MaGe Linux Operations
Feb 4, 2018 · Fundamentals

Why You Should Stop Using for Loops in Python (And What to Use Instead)

This article challenges the habit of writing for loops in Python, explains the intuition behind them, outlines the benefits of avoiding them, and demonstrates practical alternatives such as list comprehensions, generator expressions, map, reduce, functions, and itertools with clear code examples.

Code OptimizationPythonfor loop
0 likes · 8 min read
Why You Should Stop Using for Loops in Python (And What to Use Instead)
MaGe Linux Operations
MaGe Linux Operations
Nov 24, 2017 · Operations

Master Linux Shell Flow Control: If, For, While, Until, and Case Explained

This article provides a comprehensive guide to Linux shell flow‑control constructs, covering conditional statements (if/elif/else), loops (for, while, until), and selection statements (case, select), complete with syntax explanations, practical examples, and execution results to help readers master shell scripting.

Case statementFlow Controlfor loop
0 likes · 6 min read
Master Linux Shell Flow Control: If, For, While, Until, and Case Explained
MaGe Linux Operations
MaGe Linux Operations
Feb 26, 2017 · Fundamentals

Master Python Nested Loops in 3 Minutes: For & While Examples

This concise guide explains how Python supports nesting loops, shows the exact syntax for embedding for‑loops inside while‑loops and vice versa, and provides a complete example that prints all prime numbers between 2 and 100, complete with output screenshots.

Prime NumbersPythonfor loop
0 likes · 2 min read
Master Python Nested Loops in 3 Minutes: For & While Examples
21CTO
21CTO
Feb 9, 2016 · Frontend Development

Why Using map Beats for Loops: Cleaner, Declarative JavaScript

This article explains how replacing traditional for‑loops with JavaScript’s map method leads to more declarative, readable code, reduces boilerplate, improves maintainability, and offers comparable performance, while also discussing functional programming principles, browser support, and best practices for naming helper functions.

JavaScriptMAPdeclarative programming
0 likes · 7 min read
Why Using map Beats for Loops: Cleaner, Declarative JavaScript