Skip to Content
러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발
book

러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발

by 한선용, 이선 브라운
July 2017
Beginner to intermediate
464 pages
10h 38m
Korean
Hanbit Media, Inc.
Content preview from 러닝 자바스크립트: ES6로 제대로 입문하는 모던 자바스크립트 웹 개발
278
러닝 자바스크립트
“그렇게 하면 프로그램이 좀 더 수학과 비슷해지니까” 라고 대답할 수도 있겠지만, 그렇게 대답
하면 “프로그램이 수학과 비슷해지면 뭐가 좋은데?” 라는 반문이 따라올 겁니다. “순수한 함수
를 쓰면 코드를 테스트하기 쉽고, 이해하기 쉽고, 재사용하기도 더 쉬우니까” 처럼 대답하는 편
이 좋습니다.
함수가 상황에 따라 다른 값을 반환하거나 부작용이 있다면 그 함수는
컨텍스트에 좌우되는 함
입니다. 어떤 함수가 정말 유용하더라도 부수 효과가 있다면, 그리고 그 함수가 쓰이던 프로
그램이 아닌 프로그램에서 사용하려 한다면 문제를 일으킬 수 있습니다.
99
%는 제대로 동작하
다가
1
%의 상황에서 버그를 일으키는 상황은 더 심각합니다. 프로그래머라면 누구나 깨닫고
있겠지만, 가장 악질적인 버그는 숨어 있는 버그입니다. 이런 버그는 오랫동안 발견되지 않기
때문에, 문제가 있다는 걸 알게 되더라도 찾기가 정말 어렵습니다.
필자가 순수한 함수를 권장하는 건지 궁금하다면, 답은 그렇다 입니다.
항상 순수한 함수를 쓰
는 습관을 들이는
편이 좋습니다. ‘습관’이라고 한 건, 가끔은 함수에 부수 효과가 있더라도 그
냥 쓰는 편이 훨씬 쉬울 때가 있기 때문입니다. 초보 프로그래머라면 그런 때가 더 많을 겁니
다. 그러지 말라는 건 아닙니다. 단지, 잠시 멈추고 순수한 함수를 사용하는 방법이 있는지 생
각해 보라는 말입니다. 시간이 흐르면, 자연스럽게 순수한 함수를 더 많이 쓰게 될 겁니다.
9
장에서 설명한 객체지향 프로그래밍은 스코프를 밀접하게 ...
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

웹 애플리케이션 보안: 정찰, 공격, 방어 세 단계로 배우는 웹 애플리케이션 보안의 모든 것

웹 애플리케이션 보안: 정찰, 공격, 방어 세 단계로 배우는 웹 애플리케이션 보안의 모든 것

최용, 앤드루 호프먼

Publisher Resources

ISBN: 9788968483387