Category Development

Software development using Bash

As for any other language I develop with, I like to make use of tools and utilities to help me spot problems as soon as possible. For that reason I like to have three things in all my projects: Formatter Linter (Static Analysis) Unit Test Framework When developing in Bash there is no difference in this regard. Some people would say that Bash is just for scripting. I mostly agree with that statement, however, sometimes you have to write a lot of Bash and for these cases I want to be able to develop... (read more)

Interactive Curriculum in Rust

As we all know the process of looking for a job is hard. And you have to stand out from the crowd. Therefore, when I saw s0ulshake's CV I wanted to do something similar, but with other technologies (you know I do not know JavaScript) and add the ability to move forward and backward. I decided to code it in Rust because I have been looking for an excuse to start using it and this was as good as any other excuse :D. The way to distribute the binary is using Docker. How to run my CV application In... (read more)

My two cents about Go

There is plenty of meterials such as talks, tutorials and posts talking about Go, but I want to give my opinion about what I think are the strenghts and weaknesses of Go. Full disclosure: I do not use Go at work. I use Go in my personal projects. Therefore, take my opinions with a grain of salt. Pros Go is one of the best programming languages I have seen in my whole life. I think that because of the following characteristics. Standard library If you ever asked me "Which programming language has... (read more)

New website using Python, HTML5 and CSS

My new website has reached the point where it has all the minimum features required to work. In this post, I talk about the reasons for creating it and what the used design and technology are. The code of my website can be found in my GitHub. Why create a website from scratch? My first blog was hosted in blogspot, but it was too limiting in what can be done in the blog and the theming. The next iteration was in GitHub. In this case, I had more freedom regarding the hosting and theming, but it was... (read more)

Boost ASIO basics

Boost ASIO library is the defacto standard for network and low-level I/O programming. It has a great documentation available online, but there are a lot of methods and classes in the library. Therefore, if it is your first attempt to use it, it can be a bit challenging. Since there is a lot of ground to cover in the Boost ASIO library, I will only cover the work scheduler and the synchronous methods in this post. The asynchronous methods and timers will be covered in following posts. During this... (read more)

Thread, future and promise

In the C++11 standard several concurrency related classes were added. I will talk about thread, future and promise. Yes, I know there are others more useful than these three. However, I think that it is really important to know well the bases to be able to use the more complex ones properly. As usual, I am working from an Arch Linux computer. Therefore, I can install Clang and the tools from the repository (clang). For other distributions you can find the information in the documentation. As always,... (read more)

Clang sanitizers

Clang is a compiler front end for the C, C++, Objective-C and Objective-C++ programming languages. It uses LLVM as its back end. In this post I talk about some of the sanitizers available in Clang (some are avilable in GCC as well). They help you detect problems at run time (dynamic analysis). As usual, I am working from an Arch Linux computer. Therefore, I can install Clang and the tools from the repository (clang). For other distributions you can find the information in the documentation. As always,... (read more)

Lambda expression comparison between C++11, C++14 and C++17

In this post I talk about what has been added in the C++ standard regarding lambda expressions since they were introduced in C++11. All the code and configuration files used in this post are available in this repo in GitHub. What is a lambda expression? A lambda expression is a simplified notation for defining and using an anonymous function object. Instead of defining a named class with an operator(), later making an object of that class and finally invoking it.[^1] I do not explain all the options... (read more)

FFF a mocking frameowork for C

This post is a continuation from a previous post called Unity; unit test for C, but in this post we are going to use FFF. FFF is one of the available mocking frameworks for C. In this example I will use CMake to configure the project and build it. All the code and configuration files used in this post are available in this repo in GitHub. Why do we need to mock functions? To answer that question I will introduce the signature of the two methods I will use during this post. The first function is... (read more)

Unity: unit test for C

Unity is one of the available frameworks to create unit tests for C. In this example, I will use CMake to configure the project and build. All the code and configuration files used in this post are available in this repo in GitHub. Can you do unit test in C? And what is Unity? Some people do not know you can do unit tests in C and people must do unit tests in any language. My choice to do unit tests in C is Unity for several reasons: No need to install any package in your distro. Just add the three... (read more)

Unit test with Google Mock for C++

This post is a continuation from a previous post called Unit test with Google Test for C++, but in this post we are going to use Google Mock, that extends the functionality of Google Test. Google Mock is one of the available frameworks for C++ to mock objects in unit tests. In this example I will use the same technologies as for the previous one: CMake to configure the project and build it, for the dependency manager I will use the new and shiny conan. All the code and configuration files used in... (read more)

Clang tools: clang-format, clang-tidy and clang-modernize

Clang is a compiler front end for the C, C++, Objective-C and Objective-C++ programming languages. It uses LLVM as its back end. There are also several awesome tools build on top of Clang and I am going to show the three of them I use the most. As usual, I am working from an Arch Linux computer. Therefore, I can install Clang and the tools from the repository (clang, clang-tools-extra). For other distributions you can find the information in the documentation. As always, all the code used in this... (read more)

rr debugger, record once, replay tens of times

rr is a debugging tool from Mozilla that enhances the behaviour of GDB. It can be found in GitHub, but my recomendation is to go first to the website of the project. In the website you can find really useful information and documentation. As usual, I am working from an Arch Linux computer. Therefore, I can install rr from the AUR repository (rr). For other distributions you can find the information in the documentation. As always, all the code used in this post is available in this repo. The videos... (read more)

Cling a C++ interpreter based on Clang

Cling is an interactive C++ interpreter, built on top of Clang and LLVM compiler infrastructure. It can be found in GitHub (Note: Lately there has not been that much development on it). Since I use Arch Linux I am lucky to have cling in the AUR repository (cling-git). For other ones you can use the cling-all-in-one repo that contains a script to download all dependencies, compile and build cling for you. As always, all the code used in this post is available in this repo The videos are made with... (read more)

Unit test with Google Test for C++

Google Test is one of the available Frameworks to create unit test for C++. In this example I will use CMake to configure the project and build. Furthermore, for the dependency manager I will use the new and shiny conan. Before starting, why use a dependency manager such as conan or software to configure and build such as CMake? Because these technologies are widely use it in real projects. All the code and configuration files used in this post are available in this repo in GitHub. Step 1 Install... (read more)