Skip to Content
이펙티브 러스트
book

이펙티브 러스트

by 데이비드 드라이스데일, 남기혁
October 2024
Beginner to intermediate
344 pages
7h 44m
Korean
Hanbit Media, Inc.
Content preview from 이펙티브 러스트
108
이펙티브 러스트
루프 본문이 길거나 담고 있는 기능이 많다면, 클로저로 압축하기보다는 그냥 명시적 루프로 표현하는
것이 좋다.
루프 본문에 주변 함수를 조기에 종료시키는 오류 조건이 포함된 경우에는 대부분 명시적 루프로 표현하
는 것이 가장 좋다. 이럴 때
try_..()
메서드로 표현해서 좋은 점은 크지 않다.
Result
값들의 컬렉션
을 컬렉션의
Result
로 변환하는
collect()
의 기능을 활용하면 오류 조건을 여전히 물음표 연산자로
처리할 수 있는 경우가 많다.
성능이 중요하다면 클로저를 포함하는 반복자 변환이 명시적 코드로 작성한 것만큼이나 빠르도록 최적
화해야 한다. 하지만 코어 루프의 성능이 그 정도로 중요하다면 다양하게 표현해서 측정한 결과를 토대
로 적절히 튜닝한다.
– 측정값이 반드시 실제 성능을 반영해야 한다 (아이템
30
). 컴파일러의 최적화 도구는 테스트 데이터에
대해 지나치게 낙관적인 결과를 제공할 수 있다.
– 갓볼트 컴파일러 탐색기
Godbolt
compiler
explorer
40
는 컴파일러가 출력하는 내용을 탐색하는 데 굉장히 뛰어
난 도구다.
가장 중요한 것은 변환이 어색하거나 억지스럽다면 반복자 변환으로 바꾸지 않아야 한다. 기본
적으로 취향의 문제에 해당하지만, 함수형 언어 스타일에 익숙해지고 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

이펙티브 타입스크립트

이펙티브 타입스크립트

Dan Vanderkam
파이썬으로 살펴보는 아키텍처 패턴

파이썬으로 살펴보는 아키텍처 패턴

오현석, 해리 퍼시벌, 밥 그레고리

Publisher Resources

ISBN: 9791169212946