Skip to content

angeli-dev/prog2022

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple-Cpp-Setup

Welcome to this minimalist C++ project!

If you use the Dev Container

If you install ms-vscode-remote.remote-containers and Docker, you will be able to run your code inside a Linux container (kind of like a virtual machine, but faster). Also, you will get static analyzers, code formatters and useful extensions installed out of the box! It is a great option to get started with C++ quickly.

(Unfortunately, if you want to do GUI applications they don't work well from within a container and you might have to do a proper setup on your own desktop instead. But for simple command-line applications this works amazingly well!)

NB: the container might take a while to build the first time.

If you don't use the Dev Container

Compiling

You need to install CMake.

To use CMake I recommend this VS Code extension : ms-vscode.cmake-tools. You will need to setup the extension with a compiler. Here is the tutorial. It is based on Linux but at the bottom of the page you will find the explanations to adapt it for Windows and Mac.

Alternatively you can just create a build folder at the root of this project, open a terminal and run cmake ..; chances are it will detect what compiler you have installed and generate the appropriate Makefile / Visual Studio solution / Xcode project.

Auto-formatting

Check this out to learn why you would want to use a code formatter and how to do it.

Static analysis

Check this out to learn why you would want to use static analysis and how to do it.

Read lessons

  • Introduction
  • Install a compiler
  • Use an IDE
  • Use Git
  • Use a debugger
  • Use a formatting tool
  • Use static analysers
  • Naming
  • Stack vs Heap
  • Consistency in style
  • Write small functions
  • Make it work, then make it good
  • Prefer free functionss
  • std::string and std::string_view
  • Composition over Inheritance
  • Design cohesive classes
  • CMake
  • Git submodules
  • Split problems in small pieces
  • Enums
  • DRY: Don't repeat yourself
  • Use structs to group data
  • std::vector
  • Minimize dependencies
  • Strong Types
  • Polymorphism

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published