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 / diagnostics_software_development.md
Created July 21, 2025 09:13
Diagnostics in Software Development: A Comprehensive Overview

Diagnostics in Software Development: A Comprehensive Overview

CC0

Disclaimer: Grok generated document.

Introduction

Diagnostics in software development refers to the processes, tools, and techniques used to identify, analyze, and resolve issues within software systems. These issues may include bugs, performance bottlenecks, security vulnerabilities, or misconfigurations. Effective diagnostics ensure software reliability, maintainability, and performance by providing developers with actionable insights into the behavior and health of their code. Diagnostics span various stages of development, from writing and compiling code to runtime monitoring and post-deployment analysis.

@MangaD
MangaD / cpp_attributes.md
Created July 20, 2025 23:09
Comprehensive Guide to C++ Attributes

Comprehensive Guide to C++ Attributes

CC0

Disclaimer: Grok generated document.

C++ attributes, introduced in C++11 and expanded in subsequent standards (C++14, C++17, C++20, C++23), provide a standardized way to annotate code with metadata. These annotations offer hints to compilers, tools, or programmers about specific behaviors, optimizations, or constraints. Attributes are designed to improve code clarity, portability, and maintainability while enabling advanced compiler optimizations and diagnostics. This article provides a deep, comprehensive, and exhaustive exploration of C++ attributes, including their syntax, use cases, examples, edge cases, and best practices.

Table of Contents

  1. Introduction to C++ Attributes
@MangaD
MangaD / cpp_doxygen.md
Last active July 12, 2025 12:50
C++: Doxygen

C++: Doxygen

CC0

Disclaimer: Grok generated document.

Doxygen is a widely-used documentation generator tool primarily designed for documenting C++ code, though it supports other programming languages like C, Java, Python, and more. It extracts documentation from source code comments and generates output in various formats, such as HTML, LaTeX, RTF, PDF, and man pages. For C++ developers, mastering Doxygen is invaluable for creating clear, maintainable, and professional documentation for projects of any size. Below, I’ll cover everything you need to know about Doxygen, best practices for its use, and examples of well-documented C++ code.


@MangaD
MangaD / cpp_base_class_constructor.md
Created July 9, 2025 14:04
When Should You Call Base Class Constructors in C++?

🧱 When Should You Call Base Class Constructors in C++?

CC0

Disclaimer: ChatGPT generated document.

In C++, inheritance allows us to build hierarchies of classes where a derived class inherits from one or more base classes. But when exactly should you explicitly call the base class constructor in your derived class?

If you've ever written code like this and wondered whether it’s necessary:

@MangaD
MangaD / python_generators_coroutines_itertools_more.md
Last active July 7, 2025 14:49
Python generators, coroutines, itertools, and more

Python generators, coroutines, itertools, and more

CC0

Disclaimer: Grok generated document.

Python generators, coroutines, and the itertools module are powerful tools for handling iterative and asynchronous programming patterns. Below, I’ll explain each concept, their use cases, and how they relate, aiming for clarity and conciseness while covering the essentials.

1. Python Generators

Generators are a way to create iterators in Python, allowing you to iterate over a sequence of values lazily (i.e., generating values on-the-fly rather than storing them all in memory). They are defined using functions with the yield keyword or generator expressions.

@MangaD
MangaD / cpp_typename_vs_class.md
Created July 6, 2025 18:46
C++: Understanding `typename` vs `class`

C++: Understanding typename vs class

CC0

Disclaimer: Grok generated document.

In C++ template programming, the keywords typename and class are frequently encountered, often used interchangeably in template declarations. However, they serve distinct purposes and have subtle differences that are critical to understand for writing clear and correct code. This article explores their roles, differences, and best practices for their use.

1. Template Parameter Declarations

@MangaD
MangaD / turing_completeness.md
Created July 5, 2025 22:50
Turing Completeness

Turing Completeness

CC0

Disclaimer: Grok generated document.

What is Turing Completeness?

Turing completeness is a concept in computer science that describes a system capable of simulating a Turing machine. A Turing machine, introduced by Alan Turing in 1936, is a theoretical model of computation that defines an abstract machine capable of performing any computation that can be described algorithmically, given enough time and memory. A system (programming language, model of computation, or machine) is Turing complete if it can compute any function that a Turing machine can compute.

@MangaD
MangaD / cpp_variadic_templates.md
Last active July 6, 2025 13:26
C++: Variadic Templates

C++: Variadic Templates

CC0

Disclaimer: Grok generated document.

Variadic templates in C++ are a powerful feature introduced in C++11 that allow functions and classes to accept a variable number of arguments of different types. They enable flexible, type-safe, and generic programming, often used in libraries, metaprogramming, and scenarios requiring dynamic argument handling. Below, I’ll provide a comprehensive overview of variadic templates, their syntax, use cases, and related concepts, keeping the explanation concise yet detailed.


@MangaD
MangaD / cpp_why_type_traits_matter.md
Last active July 5, 2025 21:53
Enforcing Type Constraints in Modern C++: Type Traits, SFINAE, and Concepts

Enforcing Type Constraints in Modern C++: Type Traits, SFINAE, and Concepts

CC0

Disclaimer: ChatGPT generated document.

Template programming is one of C++'s defining features, and with that power comes the responsibility of enforcing type safety. This article explores the tools available to express type constraints in C++, how they influence code clarity, error diagnostics, and the design of public APIs. We'll compare techniques such as static_assert, std::enable_if, and modern C++20 concepts, while also diving into type traits and their role in making code expressive and robust.


@MangaD
MangaD / cpp_deduction_guides.md
Last active July 3, 2025 16:45
Deduction Guides in C++: A Comprehensive Guide

C++: Deduction Guides (CTAD)

CC0

Disclaimer: Grok generated document.

Introduction

Deduction guides, introduced in C++17, are a key component of Class Template Argument Deduction (CTAD), enabling the compiler to automatically infer the template parameters of a class template during object construction. Prior to C++17, users had to explicitly specify template arguments when instantiating class templates (e.g., std::vector<int>). CTAD eliminates this requirement in many cases, and deduction guides provide a mechanism to control how template parameters are deduced from constructor arguments or other initialization contexts. This article explores the purpose, syntax, and usage of deduction guides, including implicit and explicit guides, their interaction with default template parameters, and practical examples to illustrate their application.

1. Purpose of Deduction Guides