Topic

Generators

Collection size
42 articles
Page 1 of 3
Sohu Tech Products
Sohu Tech Products
Mar 5, 2025 · Frontend Development

Why Modern JavaScript Developers Move Away from Traditional Loops and What to Use Instead

Modern JavaScript developers increasingly replace traditional for‑loops with expressive array methods, generators, and functional patterns because loops risk scope leakage, mutable state, and off‑by‑one errors, while still using classic loops only for performance‑critical or low‑level tasks, choosing the style that fits data size, team preferences, and project requirements.

Array MethodsGeneratorsJavaScript
0 likes · 8 min read
Why Modern JavaScript Developers Move Away from Traditional Loops and What to Use Instead
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 13, 2022 · Fundamentals

Lazy Evaluation, Thunks, and Generators in JavaScript Functional Programming

This article explores how closures, currying, pure functions, thunks, and ES6 generators enable lazy evaluation in JavaScript, illustrating the concepts with code examples and showing how they can reduce unnecessary computation, control execution order, and even create infinite sequences.

ClosuresGeneratorsJavaScript
0 likes · 11 min read
Lazy Evaluation, Thunks, and Generators in JavaScript Functional Programming
Python Programming Learning Circle
Python Programming Learning Circle
May 8, 2024 · Fundamentals

Lesser‑Known Python Tricks and Techniques

This article introduces several lesser‑known Python tricks—including the ternary operator, enumerate, zip, list comprehensions, lambda functions, any/all, itertools, generators, decorators, and the use of * and ** for multiple arguments—each explained with concise examples to help developers write cleaner, more efficient code.

CodeDecoratorsGenerators
0 likes · 7 min read
Lesser‑Known Python Tricks and Techniques
Test Development Learning Exchange
Test Development Learning Exchange
Jan 23, 2025 · Fundamentals

Advanced Python Features: Generators, Context Managers, Metaclasses, and More

This article introduces twelve advanced Python features—including generators, context managers, metaclasses, descriptors, coroutines, data classes, type annotations, multiple inheritance with mixins, exception chaining, modules and packages, itertools, and regular expressions—explaining their purpose and providing clear code examples to illustrate each concept.

Advanced FeaturesContext ManagersData Classes
0 likes · 8 min read
Advanced Python Features: Generators, Context Managers, Metaclasses, and More
Test Development Learning Exchange
Test Development Learning Exchange
Jan 10, 2025 · Fundamentals

Advanced Python Features and Their Use Cases

This article introduces twenty advanced Python concepts—including decorators, context managers, generators, metaclasses, multiple inheritance, coroutines, closures, magic methods, dynamic attributes, GIL, async IO, regular expressions, garbage collection, modules, virtual environments, SOLID principles, type annotations, IPC, memory management, and reflection—explaining their typical use cases and providing clear code examples for each.

Advanced FeaturesDecoratorsGenerators
0 likes · 11 min read
Advanced Python Features and Their Use Cases
Test Development Learning Exchange
Test Development Learning Exchange
Dec 10, 2024 · Fundamentals

Python itertools Module: Functions, Usage Examples, and Practical Limitations

This article introduces the Python itertools module, demonstrates common functions such as count, cycle, repeat, combinations, permutations, chain, filterfalse, dropwhile, accumulate, and groupby with code examples, and discusses important limitations like infinite loops, memory consumption, and iterator irreversibility.

GeneratorsMemoryPerformance
0 likes · 8 min read
Python itertools Module: Functions, Usage Examples, and Practical Limitations
Test Development Learning Exchange
Test Development Learning Exchange
Oct 6, 2024 · Fundamentals

Understanding Python Iterables and Iterators and Their Use in Automated Testing

This article explains the difference between iterables and iterators in Python, demonstrates how to implement them with custom classes, shows basic usage with built‑in collections, and provides multiple automation‑testing examples using generators and iterator patterns to handle dynamic test data and pagination.

Automation TestingGeneratorsIterables
0 likes · 11 min read
Understanding Python Iterables and Iterators and Their Use in Automated Testing
Test Development Learning Exchange
Test Development Learning Exchange
May 1, 2024 · Fundamentals

Using Python Generators for Dynamic Test Data Generation

This article explains how Python generators can be leveraged in interface automation testing to dynamically create test data, parameterize URLs, generate test cases, build report entries, tokens, HTTP status codes, query dates, API paths, report headings, and email templates, with complete code examples for each scenario.

GeneratorsProgrammingPython
0 likes · 10 min read
Using Python Generators for Dynamic Test Data Generation
Test Development Learning Exchange
Test Development Learning Exchange
Apr 1, 2024 · Fundamentals

Python Syntax Sugar: List, Set, Dictionary Comprehensions and Other Handy Features

This article explains Python's syntax sugar—including list, set, and dictionary comprehensions, conditional expressions, generator expressions, star unpacking, multiple assignment, function annotations, context managers, and property decorators—showing how each feature makes code more concise, readable, and efficient.

DecoratorsGeneratorsPython
0 likes · 4 min read
Python Syntax Sugar: List, Set, Dictionary Comprehensions and Other Handy Features
Sohu Tech Products
Sohu Tech Products
Sep 23, 2020 · Frontend Development

Understanding Errors and Exceptions in JavaScript

This article explains JavaScript error objects, their properties, common built‑in error types, how to create and throw custom errors, and demonstrates synchronous and asynchronous error handling techniques—including try/catch, generators, promises, timers, event listeners, and the onerror handler—complete with code examples.

AsyncFrontendGenerators
0 likes · 15 min read
Understanding Errors and Exceptions in JavaScript
Qunar Tech Salon
Qunar Tech Salon
Dec 5, 2019 · Frontend Development

Evolution of JavaScript: From Prototype Methods to Async/Await and Modern Features

This article traces JavaScript’s evolution, covering the enrichment of prototype methods, standardization of classes and modules, the rise of asynchronous patterns like callbacks, promises, generators, async/await, and modern syntax features such as block scope, symbols, BigInt, reflection, and useful syntactic sugar.

AsyncBIGINTES6
0 likes · 28 min read
Evolution of JavaScript: From Prototype Methods to Async/Await and Modern Features
Test Development Learning Exchange
Test Development Learning Exchange
May 22, 2025 · Fundamentals

Understanding Python Iterables: Concepts, Creation, Built‑in Functions, Comprehensions, Advanced Operations, and Generators

This article explains Python iterables, covering their basic concepts, how to create and use them with loops, iter() and next(), built‑in functions that accept iterables, comprehension techniques, advanced operations like zip, enumerate, filter, map, and their relationship with generators for efficient data processing.

GeneratorsIterableProgramming
0 likes · 7 min read
Understanding Python Iterables: Concepts, Creation, Built‑in Functions, Comprehensions, Advanced Operations, and Generators
Top Architecture Tech Stack
Top Architecture Tech Stack
Feb 5, 2024 · Fundamentals

Simple Techniques to Speed Up Python For Loops by 1.3× to 970×

This article presents a collection of straightforward Python techniques—such as list comprehensions, external length calculation, set usage, early‑exit loops, inlining functions, pre‑computations, generators, map(), memoization, NumPy vectorization, filterfalse, and join()—that can accelerate for‑loops anywhere from 1.3‑fold up to nearly a thousand‑fold, with explanations and benchmark results.

GeneratorsMemoizationNumPy
0 likes · 18 min read
Simple Techniques to Speed Up Python For Loops by 1.3× to 970×
IT Services Circle
IT Services Circle
Mar 1, 2025 · Frontend Development

Why Modern JavaScript Developers Avoid Traditional Loops and What to Use Instead

The article explains why traditional JavaScript for‑loops are increasingly avoided, outlines modern alternatives such as array methods, generators, transducers and observables, presents performance benchmark findings, and offers guidance on when each iteration technique is appropriate for developers.

Array MethodsGeneratorsJavaScript
0 likes · 7 min read
Why Modern JavaScript Developers Avoid Traditional Loops and What to Use Instead
php中文网 Courses
php中文网 Courses
Nov 19, 2024 · Backend Development

18 Powerful PHP Features to Boost Development Efficiency and Code Quality

This article introduces eighteen advanced PHP features—including magic methods, generators, anonymous classes, attributes, fibers, null‑safe method chaining, dynamic property access, closures, traits, named arguments, first‑class callables, enums, type casting, reference returns, late static binding, opcode caching, preloading, and reflection—demonstrating how each can improve code quality, performance, and maintainability.

Advanced FeaturesGeneratorsPerformance
0 likes · 8 min read
18 Powerful PHP Features to Boost Development Efficiency and Code Quality
php中文网 Courses
php中文网 Courses
Aug 29, 2024 · Backend Development

10 Advanced PHP Techniques to Boost Performance and Efficiency

This article introduces ten lesser‑known PHP tricks—including memory management, Composer dependency handling, the built‑in web server, anonymous classes, try‑catch error handling, generators, traits, built‑in functions, PDO, and namespaces—to help developers write more efficient, maintainable, and secure code.

ComposerGeneratorsPDO
0 likes · 9 min read
10 Advanced PHP Techniques to Boost Performance and Efficiency
php中文网 Courses
php中文网 Courses
Jun 14, 2024 · Backend Development

Understanding PHP Generators: Efficient Data Iteration and Memory Optimization

This article explains the concept, operation, and advantages of PHP generators, demonstrating how they provide memory‑efficient, lazy‑evaluated iteration for large data sets and streams, and includes practical code examples and best‑practice tips for backend developers.

Generatorsbackend developmentiterators
0 likes · 9 min read
Understanding PHP Generators: Efficient Data Iteration and Memory Optimization
php中文网 Courses
php中文网 Courses
Sep 25, 2023 · Backend Development

Advanced PHP Features: Magic Methods, Type Hints, Closures, Namespaces, Generators, Iterators, Date/Time, Regex, and Variable Scope

This article provides a comprehensive guide to advanced PHP features, covering magic methods, type hints, closures, namespaces, generators, iterators, date/time handling, regular expressions, and variable scope, each explained with clear descriptions and practical code examples for backend developers.

ClosuresGeneratorsMagic Methods
0 likes · 18 min read
Advanced PHP Features: Magic Methods, Type Hints, Closures, Namespaces, Generators, Iterators, Date/Time, Regex, and Variable Scope
php中文网 Courses
php中文网 Courses
Sep 15, 2023 · Backend Development

Advanced PHP Techniques: Closures, Generators, and Reflection

This article introduces three advanced PHP features—Closures, Generators, and Reflection—explaining their concepts, advantages, and providing detailed code examples that demonstrate how closures enable access to outer scope variables, generators reduce memory usage by yielding data lazily, and reflection allows runtime inspection and modification of classes and methods.

Advanced TechniquesClosuresGenerators
0 likes · 5 min read
Advanced PHP Techniques: Closures, Generators, and Reflection
Python Programming Learning Circle
Python Programming Learning Circle
Apr 9, 2025 · Fundamentals

10 Practical Python Code Simplification Techniques

This article presents ten concise Python techniques—including list comprehensions, zip, lambda functions, generators, f‑strings, collections, decorators, enumerate, the walrus operator, and itertools—to dramatically reduce code length, improve readability, and boost development efficiency.

Best PracticesCode OptimizationDecorators
0 likes · 6 min read
10 Practical Python Code Simplification Techniques