Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions docs/c++/cpp-basics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// ...existing code...
# C++ Tech Stack

Brief, practical tech stack and examples for modern C++ projects (aligned with CONTRIBUTING.md style).

## What is this tech stack?
A curated set of compilers, build tools, libraries, testing and CI tools commonly used for developing reliable, cross-platform C++ applications and libraries.

## Core Components

- Compilers
- GCC (g++)
- Clang (clang++)
- MSVC (cl.exe) β€” Windows
- Build systems
- CMake (recommended)
- Meson, Bazel (alternatives)
- Package managers
- Conan, vcpkg
- Testing
- Catch2, GoogleTest
- Formatting & linting
- clang-format, clang-tidy
- Debugging & profiling
- gdb, lldb, Visual Studio Debugger, valgrind, perf
- Static analysis
- cppcheck, clang-tidy, clang-analyzer
- CI/CD
- GitHub Actions, GitLab CI, Azure Pipelines
- IDEs & Editors
- Visual Studio Code (with C/C++ extension), CLion, Visual Studio, Qt Creator

## Basic Example

Hello world (file: src/main.cpp)
```cpp
#include <iostream>

int main() {
std::cout << "Hello, C++ tech stack!\n";
return 0;
}
```
Expected output:
```
Hello, C++ tech stack!
```

## Minimal CMakeLists.txt
```cmake
cmake_minimum_required(VERSION 3.16)
project(hello_cpp LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
add_executable(hello src/main.cpp)
```

## Example unit test (Catch2)
```cpp
// tests/test_example.cpp
#define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>

int add(int a, int b) { return a + b; }

TEST_CASE("addition works") {
REQUIRE(add(2,3) == 5);
}
```

## CI snippet (GitHub Actions - build & test)
```yaml
name: CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
compiler: [gcc, clang]
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential cmake
- name: Configure
run: cmake -S . -B build
- name: Build
run: cmake --build build --config Release
- name: Test
run: ctest --test-dir build --output-on-failure
```

## File organization
```
project/
β”œβ”€ src/
β”‚ └─ main.cpp
β”œβ”€ include/
β”‚ └─ project/
β”œβ”€ tests/
β”‚ └─ test_example.cpp
β”œβ”€ CMakeLists.txt
└─ .github/workflows/ci.yml
```

## Common Pitfalls
- Undefined behavior (use sanitizers: -fsanitize=address,undefined,leak)
- Mixing ABIs or incompatible compiler flags
- Missing header guards / pragma once issues
- Manual memory mistakes β€” prefer smart pointers and RAII

## Best Practices
- Use modern C++ (RAII, smart pointers, move semantics, constexpr, spans)
- Keep headers minimal; prefer pimpl or modules for large projects
- Enforce style with clang-format and checks in CI
- Write unit tests and run sanitizers in CI
- Use CMake modern targets and interface libraries (target_include_directories / target_compile_features)

## Related Topics
- C++ core guidelines β€” https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
- CMake documentation β€” https://cmake.org/documentation/
- Conan β€” https://conan.io
- Catch2 β€” https://github.com/catchorg/Catch2

## References
- cppreference: https://en.cppreference.com
- Sanitizers & Undefined Behavior: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
124 changes: 124 additions & 0 deletions docs/c-sharp/c-sharp-basics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# C# Tech Stack

Brief, practical tech stack and examples for modern C#/.NET projects (aligned with CONTRIBUTING.md style).

## What is this tech stack?
A concise set of SDKs, frameworks, tools and practices for building cross-platform .NET applications: web, APIs, libraries, and CLI tools.

## Core Components
- Runtime / SDK
- .NET SDK (dotnet 6, 7, 8+)
- Frameworks
- ASP.NET Core, MAUI, Blazor
- Build & tooling
- dotnet CLI, MSBuild
- Package manager
- NuGet
- Testing
- xUnit, NUnit, MSTest
- Formatting & linting
- dotnet format, StyleCop.Analyzers, EditorConfig
- Debugging & profiling
- Visual Studio debugger, dotnet-trace, dotnet-counters, JetBrains dotTrace
- Static analysis
- Roslyn analyzers, SonarQube
- CI/CD
- GitHub Actions, Azure Pipelines, GitLab CI
- IDEs
- Visual Studio, VS Code (C# extension), Rider

## Basic Example

Program.cs
```csharp
using System;

class Program {
static void Main() {
Console.WriteLine("Hello, .NET!");
}
}
```
Expected output:
```
Hello, .NET!
```

## Minimal .csproj
```xml
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
</Project>
```

## Example unit test (xUnit)
```csharp
// tests/CalculatorTests.cs
using Xunit;

public class Calculator {
public int Add(int a,int b) => a + b;
}

public class CalculatorTests {
[Fact]
public void Add_Works() {
var c = new Calculator();
Assert.Equal(5, c.Add(2,3));
}
}
```

## CI snippet (GitHub Actions)
```yaml
name: .NET CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- run: dotnet restore
- run: dotnet build --configuration Release --no-restore
- run: dotnet test --no-build --verbosity normal
```

## File organization
```
project/
β”œβ”€ src/
β”‚ └─ ProjectName/
β”‚ β”œβ”€ Program.cs
β”‚ └─ ProjectName.csproj
β”œβ”€ tests/
β”‚ └─ ProjectName.Tests/
β”œβ”€ .github/workflows/
└─ README.md
```

## Common Pitfalls
- Mixing target frameworks or incompatible package versions
- Ignoring nullable reference warnings
- Heavy synchronous I/O on ASP.NET threads
- Leaking DI scopes or disposing shared services

## Best Practices
- Prefer async/await for I/O
- Use DI and small services
- Enable analyzers and treat warnings as errors in CI
- Pin package versions for libraries
- Write unit and integration tests; run them in CI

## Related Topics
- ASP.NET Core Docs β€” https://learn.microsoft.com/aspnet/core
- .NET API Browser β€” https://learn.microsoft.com/dotnet/api

## References
- https://dotnet.microsoft.com
- xUnit: https://xunit.net
97 changes: 97 additions & 0 deletions docs/html/html-basics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# HTML Tech Stack

Concise HTML tech stack and examples for building accessible, performant web pages (aligned with CONTRIBUTING.md style).

## What is this tech stack?
Tools, validators, linters and workflows to author semantic, accessible HTML and integrate with modern front-end build systems.

## Core Components
- Language
- HTML5 (semantic elements)
- Tooling & bundlers
- Vite, webpack, Parcel (optional for apps)
- Template engines / frameworks
- Static HTML, Pug, Handlebars; integrates with React/Vue/Svelte
- Linting & validation
- HTMLHint, W3C validator, Nu HTML Checker
- Accessibility & testing
- axe, Lighthouse, Playwright, Cypress
- Formatting
- Prettier
- CI/CD
- GitHub Actions, Netlify, Vercel
- Editors
- VS Code (Emmet, Live Server), WebStorm

## Basic Example

index.html
```html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Hello HTML</title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<header><h1>Welcome</h1></header>
<main>
<p>Hello, HTML tech stack!</p>
</main>
<footer>Β© Example</footer>
</body>
</html>
```
Expected: Page with "Welcome" heading and paragraph.

## Starter workflow
- Validate with W3C / HTMLHint
- Format with Prettier
- Test accessibility with axe / Lighthouse
- Bundle static assets with Vite or deploy static site

## CI snippet (GitHub Actions - static checks)
```yaml
name: HTML checks
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
with: node-version: '18'
- run: npm ci
- run: npx htmlhint "**/*.html"
- run: npx prettier --check "**/*.{html,css,js,md}"
```

## File organization
```
site/
β”œβ”€ index.html
β”œβ”€ about.html
β”œβ”€ assets/
β”‚ β”œβ”€ styles.css
β”‚ └─ images/
└─ README.md
```

## Common Pitfalls
- Missing alt text or improper heading order
- Forgetting viewport meta for mobile
- Inline styles that hamper maintainability
- Broken links or incorrect MIME types

## Best Practices
- Use semantic elements (main, nav, header, footer, article)
- Add meaningful alt text and ARIA where needed
- Keep HTML small and defer nonessential scripts
- Run accessibility checks in CI

## Related Topics
- Accessibility (WCAG) β€” https://www.w3.org/WAI/standards-guidelines/wcag/
- Lighthouse β€” https://developers.google.com/web/tools/lighthouse
Loading