Skip to content

hcoona/cxx-for-java-developers

Repository files navigation

C++ for Java Developers: A Starter’s Guide

中文版 README

This article was originally written as an internal quick-start guide for Java engineers at ByteDance who needed to begin regular C++ project development. After iterative feedback and additions from colleagues it became fairly comprehensive. The original internal document is no longer externally accessible due to permission changes, so I am publishing my personal backup here for a wider Java audience.

Purpose

This guide aims to help experienced Java developers become productive in day‑to‑day C++ development as quickly as possible. It assumes solid Java language knowledge and practical engineering experience, and focuses on the C++ features and ecosystem pieces you will most often use (or misuse) in typical projects. It is not meant to be an exhaustive C++ textbook.

Even if you already know some C++, you may still find value here: revisiting the language systematically helps uncover easily forgotten corner cases. Contributions are welcome.

The baseline is C++11. Some content references library features added in C++14/17. In many environments you can still use them in a C++11 codebase via well‑known third‑party libraries (e.g. Abseil). The choice reflects the reality that newer compilers / standards may not yet be fully deployed everywhere; C++11/14/17 is the pragmatic common subset.

Compared with a traditional C++ tutorial:

  1. We compress pure syntax/semantics explanations—Java and C++ share many surface similarities and seasoned Java developers can usually read C++ right away.
  2. We add side‑by‑side mapping of commonly used standard library (STL) facilities so you can quickly locate C++ equivalents of familiar Java utilities.
  3. We call out pitfalls: areas frequently misused in production C++ and the principles you should follow to avoid them.
  4. We introduce selected parts of the surrounding C++ ecosystem, including (but not limited to):
    1. Build systems
    2. Package / dependency management
    3. Common third‑party libraries
    4. Idiomatic coding patterns (idioms)
    5. Static analysis
    6. Dynamic / runtime error analysis tools
    7. Debugging
    8. Profiling

Building the Documentation Site

Prerequisites

Install UV

curl -LsSf https://astral.sh/uv/install.sh | sh
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Build Commands

uv sync --frozen
uv run mkdocs build

Upgrade a Dependency Version

uv lock --upgrade <package-name>==<version>

License

Code and documentation use different licenses. See LICENSE for details.

  1. Source code: Apache-2.0
  2. Documentation: CC BY-NC-ND 4.0

About

C++ for Java Developers: A Starter’s Guide

Topics

Resources

License

Stars

Watchers

Forks