Skip to Content
우아한 C언어 코딩 패턴
book

우아한 C언어 코딩 패턴

by Christoper Preschem, 정기훈(Jung Ki Hun)
April 2024
Beginner to intermediate
364 pages
7h 2m
Korean
Insight
Content preview from 우아한 C언어 코딩 패턴
Fluent
118
󻱴󽴔󽴔󽴔󼨷󻛧󻪟󻗫󻰧󽴔󺠿󻱃󼗿󽴔󻃧󼬧
󻃧󼬧󽴔󺃡
󼎷󼘜󻝳󼞇
구현 파일 내 하나의 함수에 모든 것을 담은 코드는 좋은 코드가 아니다. 읽기
도 어렵고 디버그하기도 힘들다. 따라서 여러 개의 함수로 분리하려 한다.
󻀇󻳫
󼨷󻛧󺴫󽴔󻉓󺹻󼨧󺳳󺝣󽴔󻉏󻉓󻰏󽴔󻗫󺴫󽴔󺢔󺺌󻳐󻱃󻺏󽴔󻨙󺞳󻇃󼚄󽴔󻳗󼃷󻳐󽴔󼧓󺴫󺋇󺱧󻃜󻪟󻗫󺝣󽴔󻪃󺩳
󻉏󻉓󻰧󽴔󺅿󺇋󺃏󽴔󺞳󺹇󽴔󻉏󻉓󻰧󽴔󻱔󺳴󻰋󺴫󽴔󻕻󻭸󺣫󺞳󻉓󺹻󼨧󺳳󺝣󽴔󼨷󻛧󺝣󽴔󻱋󻉏󽴔󺠿󻱃󼗿󺹋󽴔󺇄󻯯
󼩃󻩋󽴔󼨫󺞳
여러분의 코드를 쉽게 이해할 수 있는 데이터 공유 메커니즘이 필요하다.
즉, 함수 간에 어떤 데이터가 공유되는지 코드상에 명확하게 나타나고, 각 함
수들은 코드에 명시되지 않은 별도 채널을 사용하여 통신하지 않도록 해야 한
다. 따라서 호출자에게 정보를 제공하기 위해 전역 변수를 사용하는 것은 좋은
해결책이 아니다. 코드 내 다른 부분에서 전역 변수에 쉽게 접근하고 수정할
수 있기 때문이다. 또한, 함수 서명으로는 어떤 전역 변수가 반환 데이터로 사
용되는지 정확히 알 수 없다.
전역 변수는 상태 정보를 저장하는 용도로 사용될 수 있어 동일한 함수 호출
에 대해 다른 결과를 야기할 수 있다는 단점이 있다. 이렇게 되면 코드를 이해
하기가 더 힘들어진다. 그 외에도, 전역 변수를 반환 정보로 사용하는 코드는
재진입(reentrant)이 불가능하며 다중 스레드 환경에서 사용하기에 ...
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

AI를 위한 필수 수학

AI를 위한 필수 수학

할라 넬슨
파이썬으로 살펴보는 아키텍처 패턴

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

오현석, 해리 퍼시벌, 밥 그레고리
개발 7년차, 매니저 1일차

개발 7년차, 매니저 1일차

권원상, 한민주, 카미유 푸르니에
클라우드 네이티브 애플리케이션 디자인 패턴

클라우드 네이티브 애플리케이션 디자인 패턴

카순 인드라시리, 스리스칸다라자 수호티얀

Publisher Resources

ISBN: 9788966264742