- Class with just get-set methods points to missed delegation
- Replace an array of structures with an array of objects
- Delegate work to helper class
- Multi-dimensional arrays point to incomplete class identification
- Multiple nested loops point to incomplete delegation
- Class with very large numbers of methods points to incomplete class identification
- Don’t go overboard with inheritance
- Prefer delegation to inheritance
- Don’t scatter the abstraction
- Consider group of objects to split work amongst team members
- Use nested classes for lightweight helper classes
- Use templates to improve type safety and performance
- Divide your code into framework and application parts
Here are a few object oriented design tips to help you with class design:
- Stay close to problem domain
- Object discovery vs. object invention
- Pick nouns or noun phrases as classes
- Method names should contain a verb
- Prefix adjectives when naming inheriting classes
- Do not add suffixes to class names
- Avoid one-to-one mapping from structured design
- Replace multiple get-set methods with operations
- Model classes that handle messages as state machines
- Use const whenever possible
- Restrict header file level dependency
- Don’t reinvent the wheel; use STL
This article covers the code generation for if-else and switch statements.
The code generated for a switch statement varies a lot from one compiler to another. In fact, a given compiler might generate different code in different scenarios. The choice of the code to be generated depends upon the number and range spread of individual case statements.
Different cases of generation of a switch statement are:
Even though most programming is now carried out in high level languages, a good understanding of the generated assembly code really helps in debugging, performance analysis and performance tuning.
In this article, we will discuss the assembly code generated for function calling, parameter passing and local variable management. Frame pointer operations in a function call are described in detail.
We follow the lifecycle of a function call:
- Pushing parameters
- Invoking function
- Setting up the frame pointer
- Dismantling the frame and restoring the callers frame at function exit
- The caller popping the parameters.
This talk introduces the Git Version Control System by looking at what Git is doing when you run the commands you need to do basic version control with it. The talk covers how to use Git to do the basics, while seeing how it differs from Subversion, what staging and committing actually looks like, how it stores it’s data, how it branches and merges so nicely and how it talks to a server when pushing and fetching.
The video then describes how to look at your history with log in interesting ways. This should help Git newbies get acquainted with the popular VCS and other Git users get a glimpse of what’s happening under the hood.