Capstone: Build a Real C++ System

ক্যাপস্টোন — একটা বাস্তব C++ সিস্টেম

Build: 2-4 weeks Capstone

1. You're Ready

You started with hello.cpp and have made it through templates, RAII, smart pointers, the STL, move semantics, concepts, and threading. Now you'll combine all of it into a single sustained project that you can show off, deploy, or extend.

আপনি শুরু করেছিলেন একটি hello.cpp দিয়ে। এখন আপনি templates, RAII, smart pointer, STL, move semantics, concepts, threading — সব কিছু শিখে গেছেন। এই capstone-এ আপনি এই সব কিছু এক প্রজেক্টে ব্যবহার করবেন।

2. Pick a Track

Track A · 2D Game with SFML

  • Sprite rendering, input, collision
  • Entity-component design
  • Game loop, fixed timestep
  • Score, levels, sound

Track B · JSON Parser Library

  • Hand-written recursive descent
  • std::variant for value types
  • Pretty-printer
  • Benchmarks against nlohmann/json

Track C · HTTP Server

  • BSD sockets / asio
  • Thread pool
  • Request parser, router
  • Static file serving + REST endpoints

Track D · Mini Compiler

  • Lexer, parser, AST
  • Tree-walking interpreter or LLVM codegen
  • Custom toy language
  • Error reporting with line numbers

3. Project Structure (Reference)

layout
capstone/
├── CMakeLists.txt
├── README.md
├── LICENSE
├── .clang-format
├── include/             # public headers
├── src/                 # implementation
├── tests/               # gtest unit tests
├── benchmarks/          # google-benchmark
├── examples/            # sample apps
└── docs/                # diagrams, architecture

4. Quality Bar

  • Compiles clean with -Wall -Wextra -Wpedantic
  • Zero ASan/UBSan errors
  • At least 70% test coverage on core logic
  • Documented public API in headers
  • README with build instructions, screenshots, benchmarks
  • CI (GitHub Actions) running tests on Linux + macOS + Windows
  • Tagged release v0.1 on GitHub

5. Sample Mini Architecture (Track B — JSON)

json.hpp
#pragma once
#include <variant>
#include <vector>
#include <unordered_map>
#include <string>
#include <memory>

namespace json {

struct Value;
using Array  = std::vector<Value>;
using Object = std::unordered_map<std::string, Value>;

struct Value {
    using Variant = std::variant<
        std::nullptr_t,
        bool,
        double,
        std::string,
        Array,
        Object>;
    Variant data;
};

Value      parse(std::string_view text);
std::string dump(const Value& v, int indent = 0);

} // namespace json

6. Final Submission Checklist

  • Public Git repository
  • Modern CMake build (3.20+, C++20)
  • Unit tests passing on CI
  • One concrete demo app (or screenshots / video)
  • Bench numbers — even if rough
  • Architecture diagram in docs/
  • One paragraph in README explaining what you're proud of and what you'd improve next

The End — and the Beginning

You started not knowing what a pointer is. You now know move semantics, concepts, RAII, the STL, and how to build a real system. Pick the track that excites you. Ship it. Then keep going — contribute to an open-source C++ project, read the LLVM source, profile the games you play, and explore.

আপনি শুরু করেছিলেন pointer কী জানা ছাড়াই। এখন আপনি move semantics, concepts, RAII, STL এবং একটি বাস্তব system তৈরির পদ্ধতি জানেন। উৎসাহজনক একটি track বেছে নিন। প্রজেক্ট ship করুন। তারপর open-source C++ প্রজেক্টে contribute করুন, LLVM source পড়ুন, গেমগুলো profile করুন। এটি শুধু একটি কোর্সের শেষ — আপনার C++ যাত্রার শুরু মাত্র।

Beyond this course: read Effective Modern C++ by Scott Meyers, watch CppCon talks, follow std-proposals, and join the r/cpp community.