본문으로 건너뛰기
Previous
Next
What Is C++? History, Standards , Use Cases, and How to

What Is C++? History, Standards , Use Cases, and How to

What Is C++? History, Standards , Use Cases, and How to

이 글의 핵심

C++ overview for beginners: evolution from C, C++11/17/20/23, game/systems/finance use cases, pros and cons, myths, learning roadmap, and production patterns—series map included.

Introduction

This is the “map” article: what C++ is, why teams use it, and what to know before diving in. The hands-on series covers environment → compiler → build → memory → concurrency → exceptions → templates → STL, plus coding interviews, interop, GUIs, and newer standards. Full series index: C++ series index. Before syntax, it helps to see how topics connect and what you gain and trade off when choosing C++. You will learn:

  • Brief history and standardization
  • Where C++ sits today (standards, tooling)
  • Domains, strengths, weaknesses
  • Real-world problem scenarios and how C++ addresses them
  • A learning roadmap, career angles, and production habits
  • Prerequisites before posts #1–#10
    Reading order: New to C++ → start here (#0), then #1 Environment. Experienced in other languages → you may skip to #1.

Why C++? Real-world scenarios

1) Game servers: latency & memory pressure

Problem: Thousands of concurrent players; GC pauses hurt frame time.
C++ angle: Manual control + RAII for predictable latency. See #6 Memory.

2) HFT: microsecond sensitivity

Problem: App-layer jitter after network is already minimized.
C++ angle: Native code, explicit allocation control, kernel bypass / NUMA-aware designs.

3) Embedded: tiny RAM

Problem: 64 KB RAM; heavy runtimes don’t fit.
C++ angle: Stack/static usage, optional -fno-exceptions -fno-rtti. See #42 Embedded.

4) Big data / parallel CPU

Problem: Python GIL limits threads; custom kernels need C++.
C++ angle: std::thread, OpenMP, SIMD. See #7, #39 SIMD.

5) Engines & real-time graphics

Problem: 60+ FPS budgets.
C++ angle: GPU APIs, custom allocators, cache-friendly layouts. See #15 cache.

6) Database engines

Problem: Huge datasets, ms-level queries.
C++ angle: Layout control, alignment, custom allocators.

7) Browser engines

Problem: DOM/layout/render in milliseconds.
C++ angle: JIT integration, pools, multi-threaded pipelines.

8) High-throughput logging

Problem: Sync I/O blocks threads.
C++ angle: Lock-free buffers + background flush threads. The sketch below shows the idea: producer threads enqueue messages under a mutex while a writer thread drains the queue to disk. You trade a little locking for not stalling every caller on disk latency.

// Conceptual async log buffer (queue, mutex, thread)
template<typename T>
class AsyncLogBuffer {
    std::queue<T> buffer_;
    std::mutex mtx_;
    std::thread writer_;
    void flush() { /* write buffer to disk */ }
public:
    void log(T msg) {
        std::lock_guard lock(mtx_);
        buffer_.push(std::move(msg));
    }
};

Scenario summary

ScenarioPainWhy C++
Game serverGC pausesPredictable latency, RAII
HFTμs jitterNative code, explicit memory
EmbeddedRAM limitsStatic sizing, small binaries
Big dataGIL, custom kernelsThreads, SIMD
EngineFrame budgetAPIs + cache-friendly design
DB engineFast pathsMemory layout control
BrowserTight pipelinesMature native stacks
LoggingI/O boundLock-free / async

Table of contents

  1. History
  2. Standards & ecosystem
  3. Where C++ is used
  4. Pros & cons
  5. Language features by standard
  6. Common myths
  7. Learning roadmap
  8. Prerequisites
  9. First code
  10. Career paths
  11. Production tips
  12. FAQ
  13. Typical errors
  14. Checklist
flowchart LR
  A[#0 What is C++?] --> B[#1 Environment]
  B --> C[#2–4 Build]
  C --> D[#6 Memory]
  D --> E[#7 Concurrency]
  E --> F[#9 Templates]
  F --> G[#10 STL]
  G --> H[#11–49 Advanced]

1. History

  • C (1970s): systems/portable language close to hardware.
  • C with Classes → C++ (1980s, Bjarne Stroustrup): classes, inheritance, polymorphism—efficient high-level abstractions.
  • C++98: first ISO C++ standard; STL containers/iterators/algorithms.
  • C++03: bugfix release.
  • C++11: “modern C++” baseline: auto, lambdas, smart pointers, std::thread, move semantics.
  • C++14, C++17, C++20, C++23: incremental evolution (filesystem, optional/variant, concepts, ranges, coroutines, modules, std::expected, …).
// 실행 예제
timeline
    title C++ standardization
    1979 : C with Classes
    1983 : C++ name settled
    1998 : C++98 (first ISO)
    2011 : C++11 (modern baseline)
    2017 : C++17 (common production target)
    2020 : C++20 (concepts, ranges)
    2023 : C++23

Practical baseline: C++11+ to read modern code; C++17 is a common greenfield default; adopt C++20 features when your toolchain supports them.

2. Standards & ecosystem

ISO defines the standard; GCC, Clang, MSVC implement it (feature levels vary by version).
Ecosystem: games, databases, browsers, OS/drivers, trading, embedded—anywhere performance and control matter. Rust competes in some niches, but huge C++ codebases and hiring pools keep C++ central.

3. Where C++ is used

DomainExamples
Games / graphicsEngines, rendering, simulation
Systems / OSKernels, drivers, virtualization
FinanceLow-latency trading, risk
Embedded / IoTAutomotive, aerospace, industrial
MediaCodecs, streaming pipelines
DatabasesEngines, storage, caches
Theme: tight control of latency, memory, and CPU.

Tiny code sketches

// Game-style cache-friendly update
std::vector<Entity> entities(10000);
for (auto& e : entities) e.update(deltaTime);
// Finance-style hot path
void onOrder(const Order& o) {
    orderBook_.add(o);
}

4. Pros & cons

Pros: top-tier performance when used well; portability of standard C++; huge legacy and libraries; stable ISO standardization. Cons: steep learning curve (memory, UB, templates, concurrency); build complexity; you must enforce safety (static analysis, sanitizers, discipline). Choose C++ when performance / control are primary; consider Go/Rust/Python where velocity or safety models fit better.

5. Features by standard (summary)

FeatureNotes
Static typingTypes checked at compile time
CompiledSource → machine code
Multi-paradigmProcedural, OOP, generic, functional bits
MemoryManual + RAII + smart pointers
LibrarySTL containers/algorithms
Standard cheat sheet
// 실행 예제
C++98: STL, basic OOP, exceptions
C++11: auto, lambdas, smart pointers, threads, move semantics
C++14: generic lambdas, make_unique
C++17: optional, variant, filesystem, structured bindings
C++20: concepts, ranges, coroutines, modules, format
C++23: expected, mdspan, …
flowchart TD
  A[New project] --> B{Legacy constraints?}
  B -->|Yes| C[C++11/14]
  B -->|No| D{Need latest features?}
  D -->|Yes| E[C++20]
  D -->|No| F[C++17 typical default]

6. Myths

  1. “C++ is always faster than C.” Only if used well—virtual calls, exceptions, RTTI, shared_ptr atomics cost.
  2. “Never use pointers.” Non-owning raw pointers are fine; owning raw new/delete is risky—prefer smart pointers.
  3. “C++ is frozen old.” Standards ship every three years; adoption lags for toolchain/legacy reasons.
  4. “C++ is only OOP.” Data-oriented designs are common in performance code.
  5. “Rust replaces C++.” Coexistence is likely; migration costs are huge.
  6. “Learn C++ → instant job.” Domain depth (games, systems, HFT, embedded) matters.
  7. std::endl is just newline. It also flushes—can be slow in tight loops; prefer '\n'.
  8. using namespace std in headers. Pollutes global namespace—avoid in headers.

7. Roadmap (high level)

  1. Basics (1–2 months): #1 Environment, syntax, pointers/references → #6.
  2. Intermediate: smart pointers → #10 STL#7 threads#8 exceptions.
  3. Advanced: templates #9, move semantics #14, profiling #15.
  4. Domain: games, systems, networking, finance—pick a lane and build projects. Books: A Tour of C++ (Stroustrup), Effective Modern C++ (Meyers).

8. Prerequisites

Helpful but not mandatory: prior programming experience, basic memory intuition, comfort reading English docs/errors, optional math for quant/graphics tracks.

9. First code

// g++ -std=c++17 -o hello hello.cpp && ./hello
#include <iostream>
int main() {
    std::cout << "Hello, C++!\n";
    return 0;
}

STL teaser

#include <iostream>
#include <vector>
#include <algorithm>
int main() {
    std::vector<int> v = {3, 1, 4, 1, 5};
    std::sort(v.begin(), v.end());
    for (int x : v) std::cout << x << " ";
    std::cout << "\n";
    return 0;
}

10. Career (overview)

Domains: games (engines, networking), systems (OS, drivers), finance (low-latency), embedded (AUTOSAR, RTOS).
Junior → mid → senior: syntax/STL → concurrency/templates/design → architecture/mentoring.
See career roadmap and interview posts in the series.

11. Production habits

  • Prefer modern C++ (auto, smart pointers, containers).
  • CMake for builds (#4); vcpkg/Conan for deps.
  • clang-tidy, cppcheck, Address/Thread/UB sanitizers, unit tests.
  • Patterns: RAII, smart pointers, PIMPL, factories returning unique_ptr, DI for tests.

12. FAQ (short)

  • Hard to learn? Broad surface area—go stepwise.
  • Jobs? Performance-critical industries still hire C++ specialists.
  • Which standard? C++11 minimum; aim for C++17+.
  • C vs C++? C++ adds abstractions, STL, exceptions, templates—C often compiles as C++.
  • Python first? Helps with basics; C++ adds memory model and compilation.
  • Web backends in C++? Possible (Crow/Drogon/etc.), but many teams pick other stacks unless latency is paramount.

13. Typical errors

  • Undefined reference → link missing .o/library.
  • Segfault → ASan + gdb/lldb.
  • std:: not found → wrong standard flag or missing header.
  • Slow builds → reduce includes, PIMPL, modules (where viable).
  • Double free / heap corruption → ASan + smart pointers.

14. Checklist

  • Compiler installed (g++, clang++, or MSVC)
  • -std=c++17 (or newer) in your build flags
  • Editor/IDE configured
  • Hello World builds and runs
  • Series index bookmarked: index


Summary

C++ evolves on a steady ISO cadence and remains central where performance and control dominate. Learn the trade-offs, ignore myths, follow a structured roadmap, and pair language skills with tools (CMake, sanitizers, tests) for safer production code. Next: #1 Development environment


자주 묻는 질문 (FAQ)

Q. 이 내용을 실무에서 언제 쓰나요?

A. C++ overview for beginners: evolution from C, C++11/17/20/23, game/systems/finance use cases, pros and cons, myths, lear… 실무에서는 위 본문의 예제와 선택 가이드를 참고해 적용하면 됩니다.

Q. 선행으로 읽으면 좋은 글은?

A. 각 글 하단의 이전 글 또는 관련 글 링크를 따라가면 순서대로 배울 수 있습니다. C++ 시리즈 목차에서 전체 흐름을 확인할 수 있습니다.

Q. 더 깊이 공부하려면?

A. cppreference와 해당 라이브러리 공식 문서를 참고하세요. 글 말미의 참고 자료 링크도 활용하면 좋습니다.


같이 보면 좋은 글 (내부 링크)

이 주제와 연결되는 다른 글입니다.


이 글에서 다루는 키워드 (관련 검색어)

C++, Beginner, C++11, C++17, C++20, Programming language, C++ history 등으로 검색하시면 이 글이 도움이 됩니다.