Skip to content

아이템 46 : 스트림에서는 부작용 없는 함수를 사용하라 #119

Answered by JoisFe
jinan159 asked this question in 3. 과제
Discussion options

You must be logged in to vote

이전에 #106 디스커션 댓글에서 언급한 순수함수가 여기서 나오는 군요

스트림을 이용한 병렬 처리 등을 통해 언급하신 비동기, 논블로킹 방식을 구현할 수 있다는 점 또한 있습니다.
함수형 프로그래밍의 특징은 일반적으로 우리가 생각하는 함수와 다르게

순수 함수가 되어야 한다고 합니다.
함수에서 외부의 상태값을 참조하거나 외부의 상태를 변경해서는 안되는 것입니다.

@coalong 님 께서 작성하신 #121 에서 언급하신
이처럼 자바로 동시성 프로그램을 작성하기 쉬워지고는 있지만, 안정성(safety)과 응답 가능(liveness) 상태를 유지하기 위해 코드를 올바르게 작성하는 것은 어려운 작업이다.
과 관련된 것 같으니 같이 보면 좋을 것 같아요

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jinan159
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
7장 람다와 스트림 이펙티브 자바 7장 (람다와 스트림)
4 participants