Skip to content

sensorflo/cppkoans

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is in it’s construction phase. The currently provided koans (aka exercises) are far from complete and are thus not yet usable for an end user.

cppkoans

cppkoans are a set of little exercises to improve and strengthen your knowledge of C++. The exercises are in the form of regular code, which is to be edited in place using any editor, typically by replacing an all-underscore identifier __ with the correct answer.

Quick start

*nix platforms

From any terminal window: cd into cppkoan’s root dir, then type ./cppkoans.sh

Windows

Open build/msvc/cppkoans.sln with Visual Studio and do `Build Solution', by default on F7.

The output will direct you to the koan area, a .cpp file within src/koans, and the line number where you have to give your next answer. Edit the file with your favorite editor/IDE. Probably your IDE will treat that line in the output like a compile error, and you can jump to the referred location by the usual means of your IDE, e.g. double clicking it. After editing, repeat the procedure.

Introduction

cppkoans are a set of little exercises (aka koans) to improve and strengthen your knowledge of C++. Humans learn stuff by hands-on practice and repetition. The koans are solved by editing, using any editor/IDE, directly real-world code, so that is the hands-on practice part. You can get repetition by restarting the koans multiple times. It’s also planned to enhance cppkoans with features similar to a vocabulary trainer: the more often you answer a koan wrongly the more often you have to answer it correctly.

To learn something, it’s often useful to hear / read the same thing in multiple ways. Also, often you may want to read more detailed information than these koans can give you. Thus most koans are amended with links to further documents, typically the book `The C++ programming language' and `The ISO C++ standard'

The provided koans are tailored towards intermediate to advanced C++ programmers which want to strengthen their knowledge of C++. As a consequence, grouping the koans into themes (e.g. arrays, pointers, …​) has a higher priority than presenting information in a strict bottom-up way. Also, the koans sometimes dig quite deep into the details of the C++ language. Explaining the very basics of C++ or of programming languages in general has no priority.

Installing cppkoans and it’s prerequisites

  1. Install a toolchain to build C++ programs. See next chapter which toolchains are supported. Since cppkoans is tailored towards medium to advanced C++ programmers it is assumed that you know how to do that. Most probably you already have a toolchain installed anyway.

  2. Install cppkoans

Building and running the koans

The koans aka exercises are regular C++ files which first have to be build (compiled and linked). The resulting executable is then executed. The output will direct you to the koan area, a .cpp file within src/koans, and the line number where you have to give your next answer. Probably your IDE will treat that line in the output like a compile error, and you can jump to the referred location by the usual means of your IDE, e.g. double clicking it. After editing, repeat the procedure.

Currently supported toolchains are make and Microsoft visual studio C++ 2010, also known as msvc. Building by default also runs the koans.

*nix / make

In any terminal window, cd into cppkoan’s root directory and type ./cppkoans.sh. Internally, that just runs make within build/make.

Windows / msvc 2010

Open build/msvc/cppkoans.sln with Visual Studio and do `Build Solution', by default on F7.

For the Emacs editor there is the minor mode cppkoans-mode available which helps you in editing the koans.

Similar projects

cppkoans are inspired by ruby koans. There are also further cppkoans projects. The way they can interrogate the disciple and react to the disciple’s answers is in general more limited than this cppkoans. Also their koans are in general less amended with information on the current topic and usually lack references to further documentation.