C++ Best Practices

This course is aimed at C++ developers at the beginner and intermediate levels. The content is built on best practices developed by the community, as well as industry standards for developing critical-safe applications.

  • duration 24 hours
  • Language English
  • format Online
duration
24 hours
location
Online
Language
English
Code
C-008
price
€ 650 *

Available sessions

To be determined



Training for 7-8 or more people?
Customize trainings for your specific needs

Description

C++ is a versatile language with a vast array of features, but writing high-quality code requires adherence to best practices and guidelines. This course immerses participants in the C++ Core Guidelines, focusing on key chapters that cover variable declarations, control flow, and functions. Through practical examples and exercises, developers will learn how to write clear, efficient, and maintainable code in these critical areas of C++ programming.

 

Course Objectives:

  • Understanding the C++ Core Guidelines: Delve into the rationale and principles behind the C++ Core Guidelines, exploring key chapters that address essential aspects of C++ programming. Learn how to apply these guidelines to improve code clarity, correctness, and performance.
  • Variable Declarations: Master the art of variable declarations, understanding the principles of scope, lifetime, and initialization in C++. Explore best practices for naming conventions, choosing appropriate data types, and managing variable visibility to enhance code clarity and maintainability.
  • Control Flow: Gain proficiency in control flow constructs such as loops, conditional statements, and switch-case blocks. Learn how to write efficient and readable code by applying guidelines for loop termination conditions, loop nesting, and switch-case fallthrough prevention.
  • Functions: Explore best practices for writing functions in C++, including function signatures, parameter passing, return types, and error handling. Learn how to design functions that are concise, cohesive, and expressive, promoting code reuse and modularity.
  • Rule of Zero, Rule of Three, and Rule of Five: Understand the Rule of Zero and its counterparts, which provide guidance on resource management in C++. Learn how to design classes and manage resources efficiently to prevent memory leaks, resource leaks, and other common pitfalls.
  • Smart Pointers and Resource Management: Explore the benefits of smart pointers and RAII (Resource Acquisition Is Initialization) for managing dynamic memory and other resources in C++. Learn how to use unique_ptr, shared_ptr, and weak_ptr effectively to minimize memory leaks and improve code safety.
  • Const-Correctness and Immutable Data: Embrace const-correctness as a fundamental principle of C++ programming, ensuring that functions and methods are declared const where appropriate. Understand the benefits of immutable data structures and how they contribute to code clarity and reliability.
  • The Power of 10 Rules: Discover The Power of 10 Rules, a set of guidelines derived from decades of experience in developing and maintaining large-scale C++ software systems. Understand the principles behind these rules and learn how to leverage them to design robust and scalable C++ code.
  • AUTOSAR Standards: Explore AUTOSAR standards, which define an open and standardized software architecture for automotive systems. Understand the key concepts and principles of AUTOSAR, and learn how to design and implement C++ software components that adhere to AUTOSAR guidelines.

 

This course combines theoretical knowledge with practical exercises to reinforce learning. Lectures will cover fundamental concepts and best practices, with a focus on applying the C++ Core Guidelines to variable declarations, control flow, and function design. Hands-on coding exercises will challenge students to implement and refactor code according to best practices, with feedback provided by instructors and peers. This course is suitable for intermediate to advanced C++ programmers who want to deepen their understanding of best practices in variable declarations, control flow, and function design. Software engineers, architects, and developers aiming to improve code quality, readability, and maintainability in their C++ projects will benefit from the insights gained in this course.

 

Upon completion of this course, participants will have a thorough understanding of best practices in variable declarations, control flow, and function design in C++. They will be able to apply these principles to write clear, efficient, and maintainable code, enhancing their proficiency and confidence as C++ developers.

After completing the course, a certificate is issued on the Luxoft Training form

Objectives

Participants will be introduced to recommendations regarding the organization of program code for both regular and safety-critical applications. As a result of the training, participants will gain experience in developing software in accordance with best practices, as well as analyzing and improving existing code.


Target Audience

  • C++ developers

Prerequisites

  • An ability to understand C++ Code

Roadmap

  1. [Theory – 1h; Practice – 1h] C++ Core Guidelines Philosophy
  2. [Theory – 2h; Practice – 2h] Interfaces and functions. Function definition and parameter passing
  3. [Theory – 2h; Practice – 2h] Classes and class hierarchies. Constructors and operator overloading. Use of containers. Unions and enumerations
  4. [Theory – 2h; Practice – 2h] Resource management. Allocation and deallocation. Smart pointers
  5. [Theory – 2h; Practice – 2h] Expressions and statements
  6. [Theory – 2h] The Power of Ten
  7. [Theory – 4h] MISRA standard

  • Trainer

Zamyatin Zamyatin, Denys


Related courses

You may also be interested in

Discover more about professional growth and skills development

contact us