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_internal_linkage.md
Created December 27, 2025 19:20
Why C++ Has `static` and Unnamed Namespaces: The Purpose of Internal Linkage

Why C++ Has static and Unnamed Namespaces: The Purpose of Internal Linkage

CC0

Disclaimer: ChatGPT generated document.

C++ offers two closely related mechanisms—static at namespace scope and unnamed namespaces—to control internal linkage. While they often appear simple or even redundant, they exist to solve fundamental problems in large-scale, multi-file programs.

This article explains what internal linkage is, why it exists, and why unnamed namespaces are the modern, preferred tool.

@MangaD
MangaD / cpp_namespaces.md
Created December 27, 2025 16:35
Comprehensive Guide to C++ Namespaces

Comprehensive Guide to C++ Namespaces

CC0

Disclaimer: Grok generated document.

Namespaces in C++ are a fundamental feature for organizing code, preventing name collisions, and providing scoped declarations. Introduced in C++98, they have evolved with features in later standards (C++11, C++17, etc.). This guide covers everything from basics to advanced topics, syntax, rules, best practices, and interactions with other language features.

1. Introduction and Purpose

@MangaD
MangaD / WinForms_vs_OpenGL.md
Created December 25, 2025 17:26
OpenGL vs WinForms

OpenGL vs WinForms

CC0

Disclaimer: Gemini generated document.

In most scenarios, OpenGL is actually more resource-efficient than WinForms when it comes to rendering performance, but it may have a higher "baseline" memory footprint due to the overhead of initializing graphics drivers and the GPU context.

The comparison depends on whether you are measuring raw hardware efficiency (where OpenGL wins) or startup/idle simplicity (where WinForms wins).

@MangaD
MangaD / Determinism_vs_NonDeterminism.md
Created December 23, 2025 23:05
Determinism vs Non-Determinism in Computer Science: Predictability, Choice, and Computation

Determinism vs Non-Determinism in Computer Science: Predictability, Choice, and Computation

CC0

Disclaimer: ChatGPT generated document.

At a high level, determinism is about predictability, while non-determinism is about multiple possible outcomes given the same starting point.

Let’s unpack that carefully, from intuition to formal models, with concrete examples.

@MangaD
MangaD / cpp_disambiguation_in_templates.md
Created December 23, 2025 10:42
Disambiguation in C++ Templates: Why `typename` and `template` Exist (and Why the Compiler Can’t Guess)

Disambiguation in C++ Templates: Why typename and template Exist (and Why the Compiler Can’t Guess)

CC0

Disclaimer: ChatGPT generated document.

C++ templates are famously powerful—and famously subtle. Among the features that puzzle even experienced developers are the seemingly redundant keywords typename and template, especially in expressions like:

t.template foo<int>();
@MangaD
MangaD / cpp_partial_ordering_function_templates.md
Created December 22, 2025 18:45
Partial Ordering of Function Templates — How C++ Chooses the Most Specialized Match

Partial Ordering of Function Templates — How C++ Chooses the Most Specialized Match

CC0

Disclaimer: ChatGPT generated document.

In C++, partial ordering of function templates is the rule the compiler uses to decide which function template is more specialized when multiple templates could match the same call.

Think of it as the compiler asking:

@MangaD
MangaD / cpp_compilation_semantics.md
Last active December 25, 2025 12:48
C++ Compilation Semantics: Name Lookup, Overload Resolution, and the Hidden Phases of Meaning

C++ Compilation Semantics: Name Lookup, Overload Resolution, and the Hidden Phases of Meaning

CC0

Disclaimer: ChatGPT generated document.

What you’re hearing described (“name-lookup phase”, “overload-resolution time”) is part of the front-end semantic pipeline a C++ compiler runs through to turn tokens into “this exact entity/function/template is meant here”.

Below is a fairly complete deep dive, split into:

@MangaD
MangaD / Dominance_and_the_Diamond_Problem.md
Created December 19, 2025 06:54
Dominance and the Diamond Problem

Dominance and the Diamond Problem

CC0

Disclaimer: ChatGPT generated document.

How C++ Resolves Multiple Inheritance — and Why Other Languages Don’t

Multiple inheritance is one of the most powerful and controversial features in C++. At the heart of its complexity lies the diamond problem and a subtle but essential concept known as dominance. While many languages avoid the problem entirely by forbidding multiple inheritance, C++ embraces it and pays the price in complexity.

@MangaD
MangaD / systems_programming.md
Created December 16, 2025 15:01
Systems-Level Programming: A Deep and Practical Overview

Systems-Level Programming: A Deep and Practical Overview

CC0

Disclaimer: ChatGPT generated document.

Systems-level programming is one of the most foundational --- and demanding --- areas of software engineering. It is the discipline concerned with writing software that operates close to the hardware, forms the backbone of operating systems and infrastructure, and enables all higher-level applications to function efficiently and reliably.

This article provides a thorough, end-to-end explanation of systems-level programming: what it is, where it lives in the software stack, why it is difficult, and why it remains critically important in modern computing.

@MangaD
MangaD / exception_safety.md
Last active December 15, 2025 22:03
Exception Safety in Programming: A Complete and Comprehensive Guide

Exception Safety in Programming: A Complete and Comprehensive Guide

CC0

Disclaimer: ChatGPT generated document.

Exception safety is one of the most essential yet frequently misunderstood aspects of robust software engineering. As programming languages evolve and error-handling mechanisms become more complex, understanding how to write exception-safe code is indispensable for building reliable, maintainable, and secure systems. This article provides an exhaustive exploration of exception safety, from foundational principles to advanced patterns and best practices, with special attention to languages like C++, Rust, Java, and Python, where exceptions or exception-like mechanisms shape control flow.