[Thiago Cafe] Programming is fun!

About this blog

This blog is about programming and other technological things. Written by someone developing software for fun and professionally for longer than I want to admit and in more programming languages that I can remember

Creating a daemon in System D

(Posted 2024-02-16 22:14:00)

So, you created your awesome server-side application and you are ready to start using. However, you want it to start automatically with your server and restart if it crashes. Also, you're happy to have a system that uses System D

So, how do we do that?

(Spoiler alert: It's super easy)

... more ...

How to use Flatbuffers in a C++ project with Conan?

(Posted 2024-02-01 20:04:40)

In a C++ project I am currently working, we are using CMake/Conan for dependency resolution and planning to use flatbuffer to serialise some messages. When searching for documentation, I noticed that flatbuffers documentation is not the best one and that the integration with CMake is even harder to find, therefore, I decided to write a recipe on how to integrate it to reduce the misery of other developers around.

First, let me explain quickly how it works.

... more ...

What I learned after 20+ years of software development

(Posted 2022-04-02 12:05:00)

How to be a great software engineer?

Someone asked me this question today and I didn’t have an answer. After thinking for a while, I came up with a list of what I try to do myself.

Disclaimer: I don't think I am a great engineer, but I would love to have listened to that myself when I started my career, over 20 years ago.

I will divide this in parts, non-technical and technical

... more ...

Conversation in social network times

(Posted 2020-11-18 17:44:28)

Has it happened to you guys as well?

... more ...

How to write a Code Review

(Posted 2020-05-22 10:54:25)

There is always those quite obvious things such as "don't be a jerk". Those are not the ones I will be talking now.

I want to talk about what I learned in those many years reviewing code and getting my code reviewed.

Change the perspective

Whoever wrote the code you are reviewing thought hard about that code. Hardly someone just writes carelessly some code, so if something is not clear, instead of saying the implementation is wrong or not ideal, try to understand and ask questions to clarify why it was done the way it was.

... more ...

Developing in Rust using Visual Studio Code

(Posted 2020-05-12 17:20:00)

Two of the best features when using an IDE are auto completing and debugging. Fortunately, we can have both with VSCode.

Install Rust

Go to rust website and follow the install procedure

Then use nightly channel to get the latest version of the toolchain.

 # Install nightly toolchain
 $ rustup toolchain install nightly

 # Set nightly toolchain as default
 $ rustup default nightly

... more ...

Loading libraries in C++ on Linux

(Posted 2020-03-15 22:17:54)

This is that kind of code that we don't write all the time, so let's remember the different ways to load and create libraries on Linux

There are 3 ways a library can be used by an application

  1. Importing a static library
  2. Static linking a shared library
  3. Dynamic loading a shared library

We are going to show all the forms in this article

... more ...

Manual error handling

(Posted 2019-06-14 21:05:08)

A common problem of Object oriented languages is the overuse of Exception. You never know which exceptions can be thrown and the error handling is super hard. How many times we see catch blocks that catch everything (Exception or Throwable) and do nothing specific ?

How Go solves this problem?

Go solves this problem having no Exception. However it has it's own problems because of that. Let's see a piece of code that is very error prone

... more ...

How many days have I lived ?

(Posted 2017-11-15 01:32:29)

In a dinner conversation, my youngest daughter was curious about how many days had she lived so far. I told her that it is easy to calculate for a baby but not for her, though I could easily implement it.

She was still curious, but when I told her that I'm more than 1000 <strike>years</strike> days old (she guessed a bit more than 10), excited, they asked me to implement right away!

Am I getting old ?

... more ...

Having fun in life!

(Posted 2017-09-10 10:42:42)

I was talking to a friend about cellular automata using Conway's Game of life as an example. Curious again after so many years that I've read it, I read again carefully the wikipedia page and I found it fascinating.

What is the better way to learn more? Implementing! However I do not want to implement it in a boring way. I want to have interesting features. Let's first talk a little bit about this 0-player fascinating game.

... more ...

Pages: 1 2 3

About this blog

This blog is about programming and other technological things. Written by someone developing software for fun and professionally for longer than I want to admit and in more programming languages that I can remember