Learn from Folly source code the new C++11 features.

Two years ago Facebook released  their C++ library named Folly , it’s a large collection of reusable C++ library components that internally at Facebook are used extensively.

But many mature C++ open source libraries exist, why introduce another one ? Here’s the motivations from their website behind  its utility:

Folly (acronymed loosely after Facebook Open Source Library) is a library of C++11 components designed with practicality and efficiency in mind. It complements (as opposed to competing against) offerings such as Boost and of course std. In fact, we embark on defining our own component only when something we need is either not available, or does not meet the needed performance profile.

Continue reading “Learn from Folly source code the new C++11 features.”

Feedback about the C++ developers choices after the analysis of many C++ open source projects.

Since 2008 we did many test to validate the CppDepend results, and for seven years we analyzed more than 100 C++ open source  projects. We get them mostly from github and sourceforge. We had chosen the projects randomly, some are small, others are big. Some are very popular, others are just downloaded by few developers.

In this post, we will share some feedbacks concerning their design and implementation. Continue reading “Feedback about the C++ developers choices after the analysis of many C++ open source projects.”

Discovering Jigsaw, the new major java 9 feature.

The goal of Project Jigsaw is to design and implement a standard module system for the Java SE Platform, and to apply that system to the Platform itself and to the JDK. It was postponed many times, it’s planed now for java 9 and until now no announcement from oracle that it’s postponed again.

Here’s what Mark Reinhold said about the motivations behind the Jigsaw modular system:

A standard module system for the Java Platform will ease the construction, maintenance, and distribution of large applications, at last allowing developers to escape the “JAR hell” of the brittle and error-prone class-path mechanism.

Continue reading “Discovering Jigsaw, the new major java 9 feature.”

Some reasons why “Modern C++” adopted the generic programming

As Bjarne Stroustrup points out, “C++ is a multi-paradigmed language.” It supports many different styles of programs, or paradigms, and object-oriented programming is only one of these. Some of the others are structured programming, and generic programming. In the last few years C++ experts like Andrei Alexandrescu, Scott Meyers and Herb Sutter promotes the uses of the generic programming and they qualify it as Modern C++ Design.

Here’s what say Andrei Alexandrescu about the Modern C++ design:

Modern C++ Design defines and systematically uses generic components – highly flexible design artifacts that are mixable and matchable to obtain rich behaviors with a small, orthogonal body of code.

Continue reading “Some reasons why “Modern C++” adopted the generic programming”

What Clang can tell you about your Visual C++ projects

Each compiler could report after the build many warnings. These warnings won’t keep your code from compiling except if you decide to treat them as errors. Don’t hesitate to take a look as these warnings instead of ignoring them. Indeed compiler warnings are often indicators of future bugs that you would see only at runtime.

Clang is a C/C++/Objective C compiler with many interesting features, here are some major end user features:

  • Fast compiles and low memory use
  • Expressive diagnostics
  • GCC compatibility

Continue reading “What Clang can tell you about your Visual C++ projects”

Tracking hidden duplicate code

It’s known that the presence of duplicate code has negative impacts on software developmet and maintenance. Indeed a major drawback is when  an instance of duplicate code is changed for fixing bugs or adding new features, its correspondents have to be changed simultaneously.

The most popular reason of duplicate code is the Copy/Paste operations, and in this case the source code is exactly similar  in two or more places , this practice is discouraged in many articles, books, and web sites, however sometimes it’s not easy to practice the recommendations, and as  usual in the real world there are many constraints. Here’s a story to show one of the possible constraints:

Continue reading “Tracking hidden duplicate code”

Learn basic “C” coding rules from open source projects

Every  project has its own style guide: a set of conventions about how to write code for that project. Some managers choose a basic coding rules, others prefer very advanced ones and for many projects no coding rules are specified, and each developer uses his style.

It is much easier to understand a large codebase when all the code in it is in a consistent style. Continue reading “Learn basic “C” coding rules from open source projects”

Motivations of choosing C over C++ : Git case study

Linux, Php, and Git are a popular projects developed with C, in the other side OpenOffice, firefox, Clang, Photoshop are developed with C++, so it’s proven that each one is a good candidate to develop complex applications. Try to prove that a language is better than the other is not the good debate. However we can discuss motivations behind choosing one of them.

There are two major arguments quoted each time when we discuss choosing C:

  • Best performance.
  • Compiler support.

Continue reading “Motivations of choosing C over C++ : Git case study”