Mittwoch, 23. März 2016

5. April: How to Apply Engineering Practices to Embedded Software Development

Raphael Meyer wird uns in seinem Vortrag ein "Walking Skeleton" für Embedded Software Projekte vorstellen und diverse "Engineering Practices" näherbringen. Der folgende Abstrakt ist in Englisch der Vortrag wird aber in Deutsch oder Englisch gehalten:


How to Apply Engineering Practices to Embedded Software Development


A steadily increasing number of things for everyday use have more and more software embedded. If that software is not carefully crafted then we may be facing a dystopian future where we’ll be enslaved by dysfunctional technology.
Over the last few decades various engineering practices have been introduced to support the development of functional software. Unfortunately the field of embedded software struggles with applying these practices.
In this session I demonstrate an example of a walking skeleton for an embedded software project. By studying the example we discuss some of the engineering practices and we will see that these can be applied to embedded software development as well.
We will talk a lot about growing software guided by tests. Other topics include for example how to maintain a cross toolchain for reproducible builds.


Agenda

  1. How to Apply Engineering Practices to Embedded Software Development (Deutsch oder Englisch)
  2. Verlosung von Sponsoren Goodies
  3. Apéro

 

Ort

bbv Software Services AG, Blumenrain 10, Luzern, 1. Stock

Datum

Di 5.4.2016, 19 - 21 Uhr (Anschliessend Apero) 
 

Anmeldung

Erfolgt über die Veranstaltung unserer Xing Gruppe C++ Usergroup Zentralschweiz, über  den Meetup Event oder über das Kontaktformular rechts. 

Wir freuen uns auf dich.

Montag, 29. Februar 2016

14. März: Test-Driven-Development mit C++

Als Vorbereitung für die kommenden Coding Dojos werden wir dieses Mal eine etwas tiefere Einführung in Test-Driven-Development (TDD) geben und Beispiele und Übungen mit Googletest und Googlemock machen.

Agenda

  1. Einführung in Unittests, TDD und Test Doubles
  2. Übungen (Coding Dojo) wenn wir noch Zeit haben
  3. Verlosung von Sponsoren Goodies
  4. Apéro

Ort

bbv Software Services AG, Blumenrain 10, Luzern, 1. Stock

Datum

Mo 14.3.2016, 19 - 21 Uhr (Anschliessend Apero)

Mitbringen

  • Notebook mit Browser
  • Spass, Mut und Enthusiasmus

Es sind alle herzlich Willkommen die gerne mit C++ programmieren. Egal ob Anfänger oder Experte.

Wir freuen uns auf dich.

Anmeldung

Erfolgt über die Veranstaltung unserer Xing Gruppe C++ Usergroup Zentralschweiz, über  den Meetup Event oder über das Kontaktformular rechts. 

Wir freuen uns auf dich.

Montag, 22. Februar 2016

C++ Idioms

Am letzten Meeting haben wir uns ein paar C++ Idiome angeschaut. Hier eine Zusammenfassung der behandelten Idiome.
Die Lösungen zu den Übungen findet ihr sowohl unten in den Beispielen als auch unter  github.com/meshell/Cpp-Idioms.

C++ Idioms

A programming idiom is a recurring construct in a programming language. It is important to know the idioms associated with a programming language and how to use them for gaining fluency in that language.
Idioms are similar to patterns but usually smaller, programming language specific and do cover algorithms and concepts rather than design issues.

RAII

Intent

  • To guarantee release of resource(s) at the end of a scope
  • To provide basic exception safety guarantee

Description

Resource Acquisition Is Initialization (RAII), is a C++ programming technique which binds the life cycle of a resource (allocated memory, open socket, open file, locked mutex, database connection—anything that exists in limited supply) to the lifetime of an object with automatic storage duration. RAII guarantees that the resource is available to any function that may access the object (resource availability is a class invariant). It also guarantees that all resources are released when their controlling objects go out of scope, in reverse order of acquisition. Likewise, if resource acquisition fails (the constructor exits with an exception), all resources acquired by every fully-constructed member and base subobject are released in reverse order of initialization. This leverages the core language features (object lifetime, scope exit, order of initialization and stack unwinding) to eliminate resource leaks and guarantee exception safety. Another name for this technique is Scope-Bound Resource Management (SBRM).

Example


References

Smart pointer

Intent

  • Avoid manual memory management to improve safety and reduce bugs and memory leaks.
  • Declare ownership explicitly

Description


Example


References

PIMPL

Intent

  • Remove compilation dependencies on internal class implementations and improve compile times.

Description

When anything in a header file class definition changes, all users of that class must be recompiled – even if the only change was to the private class members that the users of the class cannot even access. The PIMPL idiom hides private members from any users of the header file, allowing these internal details to change without requiring recompilation of the client code.

Example


References

Rule of Five

Intent

  • Safely and efficiently implement RAII to encapsulate the management of dynamically allocated resources.

Description

The rule of five is a modern expansion of the rule of three. Firstly, the rule of three specifies that if a class implements any of the following functions, it should implement all of them:
  • copy constructor 
  • copy assignment operator 
  • destructor 
These functions are usually required only when a class is manually managing a dynamically allocated resource, and so all of them must be implemented to manage the resource safely. In addition, the rule of five identifies that it usually appropriate to also provide the following functions to allow for optimized copies from temporary objects:
  • move constructor 
  • move assignment operator

Example


References

Copy & Swap

Intent

  • To create an exception safe implementation of overloaded assignment operator.

Description

Copy assignment and move assignment operators can be expressed in terms of move constructor, destructor, and the swap() member function, if one is provided. For the move assignment operator this comes at the cost of one additional call to the move constructor , which is often acceptable.

Example


References

Rule of Zero

Intent

  • Utilise the value semantics of existing types to avoid having to implement custom copy and move operations.

Description

Classes that have custom destructors, copy/move constructors or copy/move assignment operators should deal exclusively with ownership and support the appropriate copy/move semantics. Other classes therefore should not have custom destructors, copy/move constructors or copy/move assignment operators.

Example

When a base class is intended for polymorphic use, its destructor may have to be declared public and virtual. This blocks implicit moves (and deprecates implicit copies), and so the special member functions have to be declared as defaulted.

References

Erase-Remove

Intent

  • Eliminate elements from a STL container.

Example


References

Type Generator

Intent

  • Simplify creation of complex template-based types
  • Synthesize a new type or types based on template argument(s)
  • Localize default policies when policy-based class design is used

Example


References

Overriding Virtual Functions

Intent

  • Override a virtual function of a base class in a safe manner.

Description

Overriding virtual functions may cause problems, for example during refactoring, when renaming a (non pure) virtual base method. Because the compiler cannot warn you that you forgot to replace the overridden methods in the specialized classes you may actually declare a new method in the specialized class instead of overriding one. Therefore as a guideline when using C++11 or higher is: Always write override when you intend to override a virtual function.

Example


References

Prohibit derivation

Intent

  • Prohibit to further override a virtual function.
  • Prohibit a class to have further-derived classes.

Description

Writing final makes a virtual function no longer overrideable in further-derived classes, or a class no longer permitted to have further-derived classes.

Example


References

Shrink to fit

Intent

  • Minimize the capacity of a container just enough to hold existing range.

Description

Since C++11 the Shrink-to-fit idiom is directly supported.

Example


References

Range-based for loop

Intent

  • Executes a for loop over a range of values, such as all elements in a container.

Description

Since C++11 the Range-based for loop is used as a more readable equivalent to the traditional for loop.

Example


References

AAA (Almost always auto)

Intent

  • Specify that the type of the variable that is being declared will be automatically deduced from its initializer.
  • Write code against interfaces, not implementations.
  • Prevent correctness and performance issues that can bedevil manual type declarations.

Description

When declaring variables in block scope, in namespace scope, in init statements of for loops, etc, the keyword auto may be used as the type specifier. Once the type of the initializer has been determined, the compiler determines the type that will replace the keyword auto using the rules for template argument deduction from a function call.

Examples


References

Use Standard Library Algorithms

Intent

  • Use the standard library algorithms rather than reinventing the wheel.

Examples


References

constexpr

Intent

  • To have an integral value that is const and known during compilation.
  • To place values in read-only memory.

Example


References

  • Item 15 of "Effective Modern C++" by Scott Meyers, O'Reilly, 2014

User-defined literals

Intent

  • Produce objects of user-defined type by defining a user-defined suffix.

Example


References

Static Assertion

Intent

  • Perform compile-time assertion checking.

Example


References

Placement Insert aka emplace

Intent

  • Creating objects in place while inserting into a container.
  • Enable insertion of elements that are not CopyConstructable.

Example


References

Samstag, 23. Januar 2016

C++11/14 Idioms: 15. Februar

Den beim letzen Event angekündigten Termin mussten wir leider nochmals ändern. Am ersten Dienstag im Februar ist in Luzern mit der Fasnacht die Hölle los und am zweiten Dienstag im Monat ist die .NET Usergroup in der bbv in Luzern. Wir treffen uns deshalb ausnahmsweise nochmals am Montag.
Wir werden diesmal ein paar C++ Idiome betrachten, Üben und Diskutieren. Der Fokus ist dabei "Modernes C++", d.h. C++11/14


Agenda

  1. Präsentation und Üben von C++11/14 Idiomen
  2. Verlosung von Sponsoren Goodies
  3. Apéro

Ort

bbv Software Services AG, Blumenrain 10, Luzern, 1. Stock

Datum

Mo 15.2.2016, 19 - 21 Uhr (Anschliessend Apero)

Mitbringen

  • Notebook mit C++11/14 Compiler und IDE deiner Wahl
  • Spass, Mut und Enthusiasmus

Es sind alle herzlich Willkommen die gerne mit C++ programmieren. Egal ob Anfänger oder Experte.

Wir freuen uns auf dich.

Anmeldung

Erfolgt über die Veranstaltung unserer Xing Gruppe C++ Usergroup Zentralschweiz, über  den Meetup Event oder über das Kontaktformular rechts. 

Wir freuen uns auf dich.




Samstag, 2. Januar 2016

Coding Dojo: 11. Januar

Beim ersten Coding Dojo im Neuen Jahr versuchen wir eine neue Form. Lasst Euch überraschen. Das Ziel ist wieder das Üben von Pair-Programming und TDD mit Googletest/Googlmock.

Agenda

  1. Einführung Coding Dojo, TDD und Pair-Programming nach Bedarf
  2. Coding Dojo
  3. Diskussion und Abschluss
  4. Apéro

Ort

bbv Software Services AG, Blumenrain 10, Luzern, 1. Stock

Datum

Mo 11.1.2016, 19 - 21 Uhr (Anschliessend Apero)

Mitbringen

  • Spass, Mut und Enthusiasmus
Es sind alle herzlich Willkommen die gerne mit C++ programmieren. Egal ob Anfänger oder Experte auch wenn ihr TDD, Googletest und Pair-Programming nicht kennt.

Anmeldung

Erfolgt über die Veranstaltung unserer Xing Gruppe C++ Usergroup Zentralschweiz, über  den Meetup Event oder über das Kontaktformular rechts. 

Wir freuen uns auf dich.

Sonntag, 29. November 2015

Refactoring Dojo: 15. Dezember


Im letzten Coding Dojo in diesem Jahr geht es ganz um Refactoring.

Agenda

  1. Einführung Coding Dojo und Refactoring wenn nötig
  2. Paarweise Refactoring von einem einfachen Beispiel Code
  3. Präsentation und Diskussion der Vorgehen
  4. Verlosung von Sponsoren "Goodies"
  5. Apero

Ort

bbv Software Services AG, Blumenrain 10, Luzern, 1. Stock

Datum

Di 15.12.2015, 19 - 21 Uhr (Anschliessend Apero)

Mitbringen

  • Eigener netzwerkfähiger Notebook mit installiertem Browser. Es ist keine IDE und C++ Toolchain nötig. Wir programmieren im Browser.
  • Spass, Mut und Enthusiasmus
Es sind alle herzlich Willkommen die gerne mit C++ programmieren. Egal ob Anfänger oder Experte.

Anmeldung

Erfolgt über die Veranstaltung unserer Xing Gruppe C++ Usergroup Zentralschweiz, über  den Meetup Event oder über das Kontaktformular rechts. 

Wir freuen uns auf dich.

Montag, 26. Oktober 2015

Coding Dojo: 9. November


Am nächsten Coding Dojo üben wir wieder an einem einfachen Code Kata Pair-Programming und TDD mit Googletest / Googlemock.


Agenda

  1. Einführung Coding Dojo, TDD und Pair-Programming wenn nötig
  2. Paarweise TDD mit googletest üben
  3. Präsentation und Diskussion der Vorgehen
  4. Verlosung von Sponsoren "Goodies"
  5. Apero

Ort

bbv Software Services AG, Blumenrain 10, Luzern, 1. Stock

Datum

Mo 9.11.2015, 19 - 21 Uhr (Anschliessend Apero)

Mitbringen

  • Eigener netzwerkfähiger Notebook mit installiertem Browser. Es ist keine IDE und C++ Toolchain nötig. Wir programmieren im Browser.
  • Spass, Mut und Enthusiasmus
Es sind alle herzlich Willkommen die gerne mit C++ programmieren. Egal ob Anfänger oder Experte auch wenn ihr TDD, Googletest und Pair-Programming nicht kennt.

Anmeldung

Erfolgt über die Veranstaltung unserer Xing Gruppe C++ Usergroup Zentralschweiz, über  den Meetup Event oder über das Kontaktformular rechts. 

Wir freuen uns auf dich.