Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
Tags
- livedata
- Hilt
- textfield
- TEST
- MiTweet
- 암호학
- Gradle
- activity
- Rxjava
- relay
- Coroutines
- 쿠링
- 백준
- Python
- AWS
- androidStudio
- boj
- Coroutine
- MyVoca
- Compose
- ProGuard
- 코루틴
- architecture
- pandas
- 프로그래머스
- Codeforces
- Kotlin
- android
- 코드포스
- GitHub
Archives
- Today
- Total
목록foreach (1)
이동식 저장소
[Kotlin] for? forEach?
일반적인 for문과 ``Collections.forEach()`` 중 뭘 써야 하나요? JetBrains의 Kotlin 개발자들이 쓴 Kotlin in Action에 이런 구절이 있다. The forEach function is somewhat more concise than a regular for loop, but it doesn’t have many other advantages, so you needn’t rush to convert all your loops to lambdas. 요약하면 ``forEach``가 읽기 쉬운 건 맞지만, for문을 모두 바꿔야 할 만큼 명확한 이점이 있는 것은 아니라고 한다. 각자 편한 걸 쓰는 걸로.
Primary/Kotlin
2022. 5. 25. 15:48