Skip to content

Instantly share code, notes, and snippets.

View MangaD's full-sized avatar
📚
studying

David Gonçalves MangaD

📚
studying
View GitHub Profile
@MangaD
MangaD / cpp_const_cast_const_objects_and_new.md
Created September 15, 2026 12:57
`const_cast`, Const Objects, and `new` in C++: Undefined Behavior, Storage, and Dynamic Constness

const_cast, Const Objects, and new in C++: Undefined Behavior, Storage, and Dynamic Constness

CC0

Disclaimer: ChatGPT generated document.

C++ const can be slightly deceptive because there is an important difference between an object that is genuinely const and a mutable object that is merely being accessed through a const pointer or reference. That distinction is the key to understanding when const_cast is safe and when modifying through it causes undefined behavior.

This also raises some related questions: Does it matter whether the object lives on the stack, in static storage, or on the heap? What exactly happens when we write new const T? Why would we deliberately create a dynamically allocated object that can never be modified? And what other qualifiers or forms can be used with a new expression?

@MangaD
MangaD / cpu_architectures_through_history.md
Created September 15, 2026 09:51
CPU Architectures Through History: From Early Processors to x86-64, AArch64, RISC-V, and Beyond

CPU Architectures Through History: From Early Processors to x86-64, AArch64, RISC-V, and Beyond

CC0

Disclaimer: ChatGPT generated document.

The cleanest way to learn this is as a computer-architecture + assembly course, because names such as i386, x86_64, amd64, arm64, and aarch64 mix several historical naming conventions that otherwise look arbitrary.

A truly full treatment would be book-length—especially once we include assembly, calling conventions, privilege levels, virtual memory, SIMD, atomics, and OS interfaces. So below I'll give you the master map and the first substantial lectures, with enough assembly to make the relationships concrete. We can then work through each architecture systematically rather than reducing 50+ years of CPU history to a list of names.

@MangaD
MangaD / platform_meaning.md
Created September 13, 2026 21:11
What Does “Platform” Mean in Software Engineering?

What Does “Platform” Mean in Software Engineering?

CC0

Disclaimer: ChatGPT generated document.

Few words in software engineering are used as frequently—and as flexibly—as platform. We hear about cloud platforms, developer platforms, data platforms, application platforms, platform teams, and “platform engineering.” Companies sometimes even describe their entire product as a platform.

The problem is that these uses do not all mean the same thing.

@MangaD
MangaD / top_cicd_platforms.md
Created September 12, 2026 23:05
The Top CI/CD Pipeline Platforms in 2026

The Top CI/CD Pipeline Platforms in 2026

CC0

Disclaimer: ChatGPT generated document.

Continuous Integration and Continuous Delivery (CI/CD) have become fundamental parts of modern software engineering. Rather than relying on developers to manually build, test, and deploy applications, CI/CD pipelines automate these processes whenever software changes.

There are many CI/CD platforms available, but five stand out as particularly important in 2026: GitHub Actions, GitLab CI/CD, CircleCI, Buildkite, and Jenkins. Each takes a somewhat different approach, and the best choice depends heavily on an organization's development environment, scale, and infrastructure requirements.

@MangaD
MangaD / unix_background_processes_job_control.md
Created September 5, 2026 11:45
Unix Background Processes and Job Control: Processes, Terminals, Signals, and Shells

Unix Background Processes and Job Control: Processes, Terminals, Signals, and Shells

CC0

Disclaimer: ChatGPT generated document.

What you may know as Bash's Ctrl-Z, bg, fg, jobs, and & is part of a larger system called Unix job control.

Bash provides the interface, but most of the underlying machinery comes from Unix/Linux itself: processes, process groups, sessions, terminals, and signals. Other shells such as Zsh and Ksh build on essentially the same mechanisms.

@MangaD
MangaD / py_doctest.md
Created September 5, 2026 08:55
Python’s `doctest`: Testing Code Through Documentation

Python’s doctest: Testing Code Through Documentation

CC0

Disclaimer: ChatGPT generated document.

Python provides several tools for testing software, and one of the simplest is the built-in doctest module. Unlike traditional testing frameworks, doctest allows developers to write tests directly inside documentation and docstrings. This makes it particularly useful for verifying examples while keeping documentation accurate and executable.

What Is doctest?

@MangaD
MangaD / cpp_access_modifier_ordering_best_practices.md
Created September 3, 2026 09:59
Best Practices for Ordering Access Modifiers in C++ Classes

Best Practices for Ordering Access Modifiers in C++ Classes

CC0

Disclaimer: ChatGPT generated document.

In C++, access modifiers such as public, protected, and private can appear in any order within a class. A class may even contain multiple sections using the same access modifier. The compiler places no meaningful restriction on how these sections are ordered, which leaves the decision largely to coding style and readability.

So, what is the best practice?

@MangaD
MangaD / cpp_constness_best_practices.md
Created September 2, 2026 12:59
`const` in Modern C++: Where It Matters, Where It Hurts, and Where It Is a Matter of Style

const in Modern C++: Where It Matters, Where It Hurts, and Where It Is a Matter of Style

CC0

Disclaimer: ChatGPT generated document.

Inspired by: https://quuxplusone.github.io/blog/2022/01/23/dont-const-all-the-things/

The const keyword is one of the foundations of C++'s type system. It allows programmers to express that an object, or an object accessed through a particular interface, should not be modified.

@MangaD
MangaD / cpp_member_functions_const_objects.md
Created September 1, 2026 14:27
Calling Member Functions on Const Objects in C++

Calling Member Functions on Const Objects in C++

CC0

Disclaimer: ChatGPT generated document.

In C++, a member function that is not declared const cannot normally be called on a const object, even if the function only reads member variables and does not actually modify the object.

Consider the following example:

@MangaD
MangaD / cpp_using_typedef.md
Created August 25, 2026 15:40
C++ `using`, `typedef`, and Type Aliases: A Practical Guide

C++ using, typedef, and Type Aliases: A Practical Guide

CC0

Disclaimer: ChatGPT generated document.

C++ gives you several mechanisms for introducing names for types and related entities. At first glance, constructs such as typedef and using can look like little more than conveniences for shortening long type names:

typedef unsigned long long ull;