CLI tool
jesyspa/linear-cpp avatar
jesyspa/linear-cpp

Linear C++: a twenty-chapter C++ tutorial that stops at C++11

An attempt at a C++ tutorial.

825 stars161 forksC++License varies

At a glance

What is it?
Linear C++ teaches C++ in chapter order, from hello world through inheritance, and every chapter is a directory of .cpp files you compile yourself. Its own README says the project is discontinued and that it only scratches the surface, which makes it a readable introduction rather than a reference.
Who is it for?
Adopt Linear C++ if you are a beginner who wants to read C++ concepts in order, with example code you compile and run yourself rather than a set of slides. Do not adopt it as your C++ reference, because the README states the project is discontinued, will not be updated for new standards, and does not cover most of inheritance, scope, storage duration, undefined behaviour, file IO, the preprocessor or C++14 and later.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 177 days ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 25, 2026, and from our analysis. They are not legal advice.

Editorial analysis

One directory per chapter, and you compile the code yourself

Linear C++ describes itself as a C++ tutorial that can, hopefully, be followed without jumping from chapter to chapter at every step. The structure is the pedagogical argument. Every chapter is a directory named for its topic, starting with Chapter 00 - Foreword and Chapter 01 - Hello World, running through Chapter 02 - Types and Variables, Chapter 03 - If, Chapter 04 - While, Chapter 05 - Vectors, Chapter 06 - For, Chapter 07 - Functions, Chapter 08 - Using Multiple Files, Chapter 09 - Iterators, Chapter 10 - References, Chapter 11 - Standard Algorithms, Chapter 12 - Function Templates, Chapter 13 - Exceptions, Chapter 14 - Project Overview, Chapter 15 - Basic Structs, Chapter 16 - Basic Operator Overloading, Chapter 17 - Member Functions, Chapter 18 - Recursion, Chapter 19 - Inheritance and Chapter 20 - Function Objects. The teaching unit is a set of source files rather than a prose section, which means you read a chapter, then compile its examples, then change them. There is no exercise framework, no test suite and no grading. The value is in the ordering, which is deliberate and complete for what it covers: iterators before references, standard algorithms after both, and structs before member functions.

Building every chapter takes one shell loop

The build instructions are a single command, which is the right level of ambition for a tutorial. Via a bash shell, compiling all chapters:

sh
for a in Chapter*; do g++ -std=c++11 -o "$a/out" "$a"/*.cpp; done

Each chapter directory produces its own out binary next to its sources. On macOS the README notes you must install XCode and the Command Line Tools package, because as of 9/04/2013 Mac OS X did not ship with a C++11 compiler, and then to build with clang instead:

sh
for a in Chapter*; do clang++ --std=c++11 --stdlib=libc++ "$a"/*.cpp -o "$a"/out; done

The libc++ flag matters because the Apple toolchain does not default to it. The README also recommends adding -Wall and -Wextra when compiling your own files on either platform, and suggests clang users may also want -fsanitize=undefined. That last suggestion is worth taking seriously for a tutorial: undefined behaviour is one of the topics the project says it does not cover, so running the examples under the sanitizer is a cheap way to see some of what the missing chapters would have taught. The project publishes two downloads, a plain archive with no project files and a Code::Blocks project files archive for people who want an IDE.

Exporting the whole book as Markdown or epub

The chapters can be exported as a book, which was contributed by @Gullumluvl according to the README. For a single chapter you run the script with a chapter glob:

sh
./cpp_2_markdown.py Chapter\ NN*

where NN is the chapter number, and for the whole book:

sh
./cpp_2_markdown.py .

The output is a Markdown file, and an epub is then produced with pandoc, which the README says you need to have installed:

sh
pandoc -M author=jesyspa \
  --standalone \
  -V 'header-includes="<style>pre > code.sourceCode {white-space: pre-wrap !important;}</style>"' \
  --toc --toc-depth=1 \
  -o linear-cpp.epub \
  ebook.md

The header-includes argument is there to wrap long code lines, since the source listings are wider than a page and would otherwise be cut off in a reader. This is a small feature with a real use: a book you can read on a tablet, in the same order the repository teaches, with the code intact. The repository holds cpp_2_markdown.py at the root next to the chapter directories, so the export path is part of the checked-in tree rather than something you have to reconstruct.

The author says the project is discontinued

The future plans section is the most important part of the README for anyone deciding whether to use this. It states plainly that the project is discontinued and that there are no plans to update it for new C++ standards or to add new language features. It then gives an outline of what is missing, with the word coming struck through and replaced by missing: Practical Examples, Variants, Optional, most of inheritance, scope, storage duration, undefined behaviour, file IO, libraries such as Boost and Abseil, metaprogramming, C++14 and up, the preprocessor and most C features. The author goes further, saying that while glad people have found it useful, please do not rely on this by itself to learn C++, that it really only scratches the surface, and that you will do yourself a service if you get a good book, with a link to a Stack Overflow question on the subject. The repository is not archived and the last push was on 2026-05-01, so what is there is stable rather than abandoned mid-edit. Read as a whole, the README is unusually honest: it is a finished first course that stops where it stops, not a course in progress.

What the missing topics mean for a modern reader

The gap list is short enough to enumerate against what a working C++ programmer uses daily, and the omissions are consequential rather than cosmetic. Scope and storage duration sit next to pointers and references, and a beginner who has not met them will meet them by accident. Undefined behaviour is the chapter that separates code that works from code that works until it does not, and it is not covered. The preprocessor is where macros, include guards and conditional compilation live, and it is not covered either. Most of inheritance is not covered, which is a deliberate choice in modern C++ where value semantics are preferred, but it means the tutorial does not prepare you for code that uses class hierarchies. And C++14 and up are absent entirely, so concepts that are now baseline, including move semantics and smart pointers, are simply not there. The library chapters matter too: Boost and Abseil are where a large part of modern C++ practice lives. What remains is the older core, which is still the core, and it is taught in a sequence that does not depend on the missing pieces.

Two downloads, no licence file, one script

The repository layout is minimal and has the shape of a personal project rather than a maintained library. The top level holds the README, a .gitignore, the cpp_2_markdown.py export script and the twenty-one chapter directories. There is no CMakeLists.txt, no package manifest, no CI configuration and no test suite, which is consistent with a tutorial where each chapter is meant to be built by hand. There is also no LICENSE file in the tree, and the project carries no recognisable licence marker, so the terms for copying the text or reusing the example code are not stated. For a reader who intends to follow the tutorial that is not an obstacle. For anyone who wants to lift a chapter into their own course, a company training programme or a book, it is a question to settle with the author rather than an assumption to make. The repository is not archived and the last push was on 2026-05-01, so the author is reachable. There are no GitHub releases, so the archive is the artefact rather than a tagged version.

Editorial conclusion

Adopt Linear C++ if you are a beginner who wants to read C++ concepts in order, with example code you compile and run yourself rather than a set of slides. Do not adopt it as your C++ reference, because the README states the project is discontinued, will not be updated for new standards, and does not cover most of inheritance, scope, storage duration, undefined behaviour, file IO, the preprocessor or C++14 and later. Before you commit, read the chapter list rather than the summary, and note that the repository has no licence file, so the terms for reusing the text and code are not stated.

Frequently asked questions

What is Linear C++?

It is a free C++ tutorial organised as twenty-one chapter directories, from a foreword and hello world through vectors, iterators, references, templates, exceptions, structs, operator overloading, recursion, inheritance and function objects. Each chapter holds .cpp files you compile and run yourself.

How do I build the Linear C++ examples?

With g++ on Linux, the loop is for a in Chapter*; do g++ -std=c++11 -o "$a/out" "$a"/*.cpp; done. On macOS the README asks you to install XCode and the Command Line Tools and to use clang++ with --std=c++11 --stdlib=libc++ instead.

Is Linear C++ still being updated?

No. The README states that the project is discontinued, that there are no plans to update it for new C++ standards or add new language features, and that it only scratches the surface. The repository is not archived and the last push was on 2026-05-01.

Can I export the Linear C++ chapters as a book?

Yes. Running ./cpp_2_markdown.py with a chapter glob, or with a dot for the whole book, produces a Markdown file, and pandoc then converts it to an epub with the header-includes argument that wraps long code lines.

Official sources

  1. Issues
  2. jesyspa/linear-cpp on GitHub
  3. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/jesyspa-linear-cpp.svg)](https://hysenlabs.com/projects/jesyspa-linear-cpp)

Was this useful?