# Reference, androiddev, kotlin

Published articles for Reference, androiddev, kotlin.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Choosing Wisely: for vs. forEach in Kotlin (A Thinking Dev's Perspective)

DevFeed: [Choosing Wisely: for vs. forEach in Kotlin (A Thinking Dev's Perspective)](<https://devfeed.tech/articles/choosing-wisely-for-vs-foreach-in-kotlin-a-thinking-dev-s-perspective-24905.md>)

Original publisher: [Read original article](<https://blog.blundellapps.co.uk/choosing-wisely-for-vs-foreach-in-kotlin-a-thinking-devs-perspective/>)

Author: blundell

Published: 2025-04-04T14:25:30Z

Content type: article

Language: en

Sources: [Blundell](<https://devfeed.tech/sources/blundell.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [androiddev](<https://devfeed.tech/tags/androiddev.md>), [code](<https://devfeed.tech/tags/code.md>), [dev](<https://devfeed.tech/tags/dev.md>), [foreach](<https://devfeed.tech/tags/foreach.md>), [functional](<https://devfeed.tech/tags/functional.md>), [intermediate](<https://devfeed.tech/tags/intermediate.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [loops](<https://devfeed.tech/tags/loops.md>), [programming](<https://devfeed.tech/tags/programming.md>), [readability](<https://devfeed.tech/tags/readability.md>), [reference](<https://devfeed.tech/tags/reference.md>), [reference-androiddev-kotlin](<https://devfeed.tech/tags/reference-androiddev-kotlin.md>), [structure](<https://devfeed.tech/tags/structure.md>), [syntax](<https://devfeed.tech/tags/syntax.md>)

### AI overview

This Kotlin development article argues against reflexively choosing forEach. It compares forEach with traditional for loops and dedicated functional operators, emphasizing readability, explicit control, side effects, and clearer data flow.

### Source excerpt

The forEach loop, are you using it without thinking? In Kotlin, empirically forEach is often the go-to loop, it's pragmatically close at reach in the IDE auto-complete, but is it always the right choice? This post argues that for loops deserve more consideration, offering clarity and control that forEach sometimes lacks. Let's discuss why a [...] The post Choosing Wisely: for vs. forEach in Kotlin (A Thinking Dev's Perspective) first appeared on Blundell.