Monatsarchiv: November 2017

Design patterns: Command

The Command design pattern encapsulates a request as an object. This will allow adding additional functionality to the request. A typical example is the undo/redo functionality. The command object will be used as mediator between the client and the receiver … Weiterlesen

Veröffentlicht unter .NET, C#, Design Pattern | Kommentar hinterlassen

Define a variable inside or outside of a loop

If you implement something you will write a lot of loops. Within the loops you will often use variables. This is a very common issue but it isn’t that easy like it looks in the first moment. Because you have … Weiterlesen

Veröffentlicht unter C++ | Kommentar hinterlassen

Slicing problem

By default C++ will pass parameters by value. Therefore when you pass an object to a method a copy of this object will be created. Other languages, for example C# will pass parameters by implicit references. If you work with … Weiterlesen

Veröffentlicht unter C++ | Kommentar hinterlassen

Methods should do one thing only

According to the Single Responsibility Principle a class should have one, and only one, reason to change. To same statement is valid for methods. A method should do one thing only and therefore have only one reason to change. Unfortunately … Weiterlesen

Veröffentlicht unter .NET, C#, Clean Code | Kommentar hinterlassen