Programming Elixir 1.3 (Dave Thomas, 2016) 독후감

1 minute read

챕터 배치 신경 많이 썼네. 처음부터 pattern matching을 설명한다. = operator가 다른 것을 본다. 다른 세계에 왔구나. 이걸 처음부터 느낄 수 있었다. 그래서 그런지 아껴서 쓰는 control flow는 미루고 미루다가 뒤에 설명한다.

색션 길이도 짧다. 질질 안 끌고 필요한 것만 알려줘서 만족. 속도가 잘 붙는다. 커밋을 잘 쪼갠 git 히스토리를 읽는 느낌이다.

연습 문제 좋다. 특히 앞으로 많이 쓸 Enum.reduce/3, Enum.map/2, Enum.all?/2, … 함수를 구현하는 연습 문제가 좋았다. 의외로 쉽게 구현해서 막 뿌듯하고 그랬다. 저자 풀이도 웹에 실어 놓은 게 좋았다. 내가 푼 거랑 비교하면서 많이 공부가 됐다. 저자 풀이가 있는 PART 1만 열심히 풀고 뒤에는 시들해져서 안 풀게 됐다.

홈페이지나 웹에 정리된 걸 볼까 고민했었는데, 책으로 보길 잘했다. 신호 대 잡음비(SNR)가 확실히 적고 길고 긴 공부 과정에 단계를 제공한다. 책을 다 읽고 한 단계를 넘어서면 뿌듯하다.

이 책을 읽는 지금 최신 버전은 1.5. 책으론 버전 따라가는 게 쉽지 않다. 최신 버전 변경점은 따로 챙겨야 한다.

저장하고 싶은 문장

  • Programming should be about transforming data.
  • I don’t want to hide data. I want to transform it.
  • The benefit will become obvious as you write more code - functions written without explicit control flow tend to be shorter and more focused. They’re easier to read, test, and reuse.
  • You use exceptions far less in Elixir than in other languages - the design philosophy is that errors should propagate back up to an external, supervising process.
  • each process can contain its own state - in a way, processes in Elixir are like objects in an object-oriented system
  • OTP stands for the Open Telecom Platform, but the full name is largely of historical interest and everyone just says OTP. It was initially used to build telephone exchanges and switches.
  • Erlang can actually run two versions of a module at the same time. Currently executing code will continue to use the old version until that code explicitly cites the name of the module that has changed. At that point, and for that particular process, execution will swap to the new version.
  • However, type specifications are not currently in wide use in the Elixir world. Whether you use them is a matter of personal taste.