Skip to content

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Explore BestHub

#C#

RSS feed
Follow or choose interest 7-day signal and related keywords

Latest articles

500 articles in the current browsing window, ordered by publication date.

Master CMake Basics: A Simple, Step‑by‑Step Guide to Build Automation

This article walks you through why CMake is a more elegant, cross‑platform alternative to hand‑written Makefiles, explains its core benefits, and provides a complete, hands‑on tutorial that covers the basic workflow, a minimal project example, multi‑source handling, and multi‑directory organization with clear code snippets.

Mastering Finite State Machines for Game Objects: From Basics to NPC Patrols

This article explains why finite state machines (FSM) are essential for game development, outlines their core concepts, demonstrates common pitfalls of if‑else logic, and provides step‑by‑step Unity C# examples for object state switching and intelligent NPC patrol behavior, including code snippets and integration tips.

Unlock Fast C Utilities: Struct Sizes, CPU Temp, File Size, IP & More

This article presents a collection of handy C code snippets that demonstrate how to quickly obtain struct member sizes and offsets, read CPU temperature, determine file sizes, fetch system timestamps, retrieve MAC and IP addresses, perform file I/O, display progress bars, format log output, and enable core dump generation, each accompanied by sample usage and expected results.

JD's Self‑Developed HarmonyOS Image Library (DImage): Architecture, Implementation, and Performance Optimizations

This article details JD's self‑built HarmonyOS image library (DImage), covering its background, research on existing solutions, C++‑based cross‑platform architecture, core modules, performance‑focused pipeline, monitoring and recovery mechanisms, and future optimization directions, all aimed at high‑performance image handling for the JD app on HarmonyOS.

Deep Dive into Linux Kernel task_struct: Structure, Fields, and Usage

This article provides a comprehensive analysis of the Linux kernel's task_struct data structure, detailing its members such as task IDs, parent‑child relationships, state flags, credentials, scheduling information, signal handling, memory and file management, kernel stack layout, and its role in process creation via system calls like fork.

Understanding the Implementation and Mechanisms of the C malloc Function

This article explains the purpose, prototype, and usage of C's malloc function, delves into its underlying implementation using free‑list mechanisms, virtual‑memory translation, system calls like brk and mmap, and compares it with related functions such as calloc, realloc and new, while providing practical code examples and best‑practice guidelines.

Understanding Linux ptrace: Implementation, Usage, and Debugging Techniques

This article provides a comprehensive overview of the Linux ptrace system call, explaining its role in process debugging, detailing request parameters, demonstrating practical C examples for tracing system calls, single‑stepping, setting breakpoints, and exploring how DWARF debugging information links source code to executable addresses.

Deep Dive into Netty’s Asynchronous Model, Epoll, IO Multiplexing, and JNI with Hands‑On C Code

This article explains Netty’s asynchronous architecture, compares classic multithread, Reactor, select, poll and epoll models, clarifies level‑triggered versus edge‑triggered event handling, and provides step‑by‑step JNI and hand‑written epoll server examples in C to illustrate high‑performance backend development.

C++26 Reflections, Safety, and Emerging Security Guidelines

After 22 years at Microsoft, Herb Sutter departs for Citadel while staying ISO C++ chair, declaring 2024 pivotal as C++26 introduces reflection‑driven compile‑time libraries and default safety—potentially the most impactful release since C++11—while U.S. CISA and the FBI urge memory‑unsafe language users to publish safety roadmaps by January 2026.

Dynamic Cross‑Platform Rendering Architecture and Implementation on HarmonyOS

This article explains the end‑to‑end architecture, principles, and code implementation of the dynamic cross‑platform framework (Roma/Dynamic) on HarmonyOS, covering template loading, JS‑C++‑ArkTS instance creation, V‑Dom and Component tree construction, rendering pipeline, view updates, and performance optimizations.

Ctrip's Weak Network Detection Model: Design, Implementation, and Evaluation

This article details Ctrip's end‑to‑end weak‑network identification model, covering background, metric selection, data collection on iOS and Android, processing pipelines with dynamic weighting, weighted median calculations, success‑rate trends, threshold tuning, and deployment results across multiple platforms.

Garbage Collection Algorithms and Reference Counting in QuickJS

QuickJS manages memory using reference counting for each object combined with a cycle‑collector that periodically scans roots, decrements child references, and frees objects whose counts drop to zero, while also supporting traditional reachability‑based garbage‑collection techniques such as mark‑sweep, copying, and generational collection.

Technical Principles and Implementation of Game Memory Modifiers for "Black Myth: Wukong"

This article explains the technical mechanisms behind game memory modifiers—including memory scanning, DLL injection, debugging tools, file editing, anti‑cheat evasion, and pointer scanning—using the "Black Myth: Wukong" trainer as a concrete example, and provides complete C++ code samples.

Understanding Python's Virtual Machine Execution and Runtime Stack

This article explains how the Python interpreter initializes its runtime environment, compiles source code into PyCodeObject bytecode, creates stack frames, and executes the bytecode using functions like PyEval_EvalFrame and _PyEval_EvalFrameDefault while detailing the role of the runtime stack and its associated C macros.

Inside Linux Memory Compaction: A Source‑Code Walkthrough of Memory Management

The article explains how Linux manages memory page watermarks, when the allocator falls back to kswapd, and the exact conditions that trigger direct compaction via __alloc_pages_direct_compact, then walks through the core compaction functions—try_to_compact_pages, compact_zone_order, compact_zone, and the page‑migration helpers—illustrated with flow diagrams and real kernel code.

Weak Pointers Across Go, Rust, Java, and C#: Design, Implementation, and Use Cases

This article examines the concept of weak pointers and weak references in Go, Rust, Java, and C#, comparing their implementations, explaining their memory‑management semantics, presenting concrete code examples, and discussing the upcoming Go weak‑pointer proposal and practical scenarios such as caching and event handling.

Synchronizing Linux Shared Memory IPC: Semaphores, Mutexes, and Condition Variables (with Code)

The article explains how to ensure data correctness in Linux inter‑process shared memory communication by using synchronization mechanisms—semaphores, mutexes, and condition variables—providing step‑by‑step code examples for each method and discussing their proper initialization, usage, and potential pitfalls.

Essential C Utility Code Snippets Every Embedded Developer Should Know

This article presents a curated collection of high‑impact C utility code examples—including a circular buffer, assertion macro, bit‑reversal function, fixed‑point arithmetic, endianness conversion, bit masks, timer handling, binary search, and a simple bitset—explaining their purpose and showing ready‑to‑use implementations for embedded systems.

Why Rust’s Mutex API Looks Different from C’s and What It Means for Safety

The article analyses the design of Rust’s Mutex API, compares it with the classic C/POSIX mutex API, explores alternative Rust designs that mimic C, and demonstrates through concrete code examples why Rust’s guard‑based approach preserves safety while a C‑style API would re‑introduce data‑race hazards.

How AI Code Assistant Supercharges 3A Game Development in Unreal Engine

The article examines the launch of the Chinese 3A title "Black Myth: Wukong", analyzes programmers' challenges in high‑cost game development, presents survey data on AI coding tools, introduces Tencent Cloud AI Code Assistant, and provides a step‑by‑step tutorial for integrating the assistant into Unreal Engine projects using Rider.

Technical Stack of the Chinese AAA Game “Black Myth: Wukong”

The article examines the technology behind the Chinese AAA title “Black Myth: Wukong”, revealing its use of Unreal Engine 5 with C++ as the core language, additional JavaScript integration via Unreal.js, and discusses community speculation about tools like PuerTS while also containing promotional material for development tools.

Technical Analysis of “Black Myth: Wukong” – Engine, Languages, and Cultural Integration

The article examines how the Chinese AAA title “Black Myth: Wukong” leverages Unreal Engine 5, C++, Blueprint visual scripting, and even a custom C#‑based USharp plugin to deliver cutting‑edge graphics, physics, AI, and culturally rich gameplay, illustrating the convergence of advanced technology and Chinese heritage in modern game development.

What Language Powers Black Myth: Wukong and What It Means for China’s Software Industry

The article explains that Black Myth: Wukong is built mainly with C++ on Unreal Engine, outlines the engine's royalty model, and uses this case to highlight why Chinese developers favor Java and Python over C++, the challenges of low‑level software development in China, and the need for more domestic C/C++ talent.

Hot Update Technology in Game Development: Architecture Design and Validation of Asset Bundle + DLL Replacement C# Hot Update Scheme

This article reviews the evolution of hot‑update methods in games, critiques Lua, PuerTS, and HybridCLR, and proposes a minimalist Unity solution that combines AssetBundle resource updates with runtime DLL loading via reflection, demonstrating a simple, low‑dependency architecture validated on Android VR projects.

Mastering C State Machines: Switch‑Case, Table‑Driven, and Function‑Pointer Techniques

This article explains how to implement finite state machines in C using three classic approaches—switch‑case, table‑driven, and function‑pointer—detailing their structures, code examples, trade‑offs, and safety considerations for embedded and general‑purpose software development.

Master Essential C Language Features: Bitwise Ops, Macros, Conditional Compilation, and More

This guide explains core C programming concepts—including bitwise operators, macro definitions, conditional compilation directives, extern declarations, typedef aliases, struct usage, and the static keyword—providing clear examples and code snippets to help developers write more efficient and maintainable code.

Mastering Domain-Driven Design: Core Concepts, Layers, and Practical C# Examples

Domain-Driven Design (DDD) is a software development methodology that bridges business and technology by defining clear domain models, improving communication, code quality, and handling complexity through layered architecture, with concrete C# examples of entities, value objects, aggregates, and domain services.

Understanding __disable_irq() and __enable_irq() Intrinsic Functions in ARM Cortex-M

The article explains that __disable_irq() and __enable_irq() are compiler‑provided intrinsics that expand to CPSID i and CPSIE i instructions, return the prior PRIMASK state, globally mask CPU interrupt handling without stopping hardware events, and contrasts them with CMSIS __NVIC_DisableIRQ/EnableIRQ which control individual interrupt lines.

Multithreading Programming: Concepts, Synchronization, and Best Practices

Multithreaded programming splits tasks across logical and hardware threads to exploit multicore CPUs, requiring careful use of synchronization primitives such as mutexes, read‑write locks, condition variables, and lock‑free atomics, while avoiding pitfalls like race conditions, deadlocks, and false sharing for correct, high‑performance software.

Performance Optimizations and Benchmark Analysis of RaftKeeper v2.1.0

The article presents a detailed engineering analysis of RaftKeeper v2.1.0, describing benchmark methodology, performance gains across create, mixed, and list workloads, and four major optimizations—including response serialization parallelism, list‑request handling, system‑call reduction, thread‑pool redesign, and asynchronous snapshot processing—demonstrating substantial throughput and latency improvements in large‑scale ClickHouse deployments.

C++ Surpasses C in the TIOBE Ranking and Its Historical Development, with Go and Rust Milestones

This article reports that C++ has overtaken C to rank second in the latest TIOBE index, outlines the historical evolution of C++ across three phases, highlights the recent record climbs of Go and Rust, and notes the broader usage of these languages despite the presence of promotional material.

Vectorized Execution in Apache Spark: Meituan’s Practice with Gluten and Velox

Meituan enhances Apache Spark by integrating the Gluten‑Velox vectorized execution engine, converting row‑wise operations to columnar SIMD processing, which yields over 40 % memory savings and up to 13 % faster runtimes across thousands of ETL jobs, while addressing stability, ORC support, shuffle redesign, and off‑heap memory optimization.

Mastering C State Machines: Switch‑Case, Table‑Driven, and Function‑Pointer Techniques

This article explains how to implement finite state machines in C using three approaches—switch‑case, table‑driven, and function‑pointer—detailing their structures, code examples, trade‑offs, and extensions such as compressed tables and hierarchical state machines for robust embedded systems.

Why iLogtail Needed a Complete Architecture Overhaul and How It Was Done

This article explains the evolution of iLogtail from a single‑file collector to a multi‑language, plugin‑based observability pipeline, outlines the motivations for refactoring, describes the new unified data model, plugin abstractions, pipeline design, configuration management, hot‑reload mechanisms, and the separation of enterprise and open‑source code, providing a comprehensive view of the architectural upgrade.

Cross‑Platform Architecture for WeChat Pay: Reducing Code, Improving Quality and Productivity

This article describes how a C++‑based cross‑platform framework and a unified routing mechanism were built for WeChat Pay to eliminate platform‑specific bugs, streamline data flow, improve crash stability, cut code size by nearly 45%, and boost development productivity across iOS and Android.

Introduction and Implementation of MaxSDK for Unity Cross‑Platform Game Development

The article presents MaxSDK, a unified C# SDK for Unity that abstracts platform‑specific native SDKs across Android, iOS, Windows, macOS and future platforms, offering a singleton interface, abstract base classes, data models, and callback listeners to dramatically cut integration effort, maintenance cost, and enable easy extension to other engines.

Unlocking C++ Object Memory Layout: From Basics to Inheritance and ASLR

This article walks through C++ object memory layout using concrete examples, covering basic data members, methods, private and static members, inheritance (with and without virtual functions), compiler optimizations, and address‑space layout randomization, all demonstrated with GDB inspections and code snippets.

Understanding C Memory Layout on STM32: Stack, Heap, and Data Segments Explained

This article explains C language memory partitioning—including stack, heap, global/static, constant, and code sections—illustrates their characteristics and growth directions, then applies the concepts to STM32F103 by showing memory map details and providing a complete Keil‑based C program that prints the addresses of variables in each region.

How Justine Tunney Built a Six‑OS C Web Server and Other Groundbreaking Projects

The article showcases Justine Tunney’s remarkable engineering feats—from the RedBean web server that runs the same binary on six operating systems, to the cosmopolitan libc, a 512‑byte sectorLisp, the Blinkenlights visual debugger, the RoseHub security effort, and the llamafile tool that packages large language models into a single portable executable.

Understanding POSIX: Concepts, Network APIs, and Semaphore Programming in C

This article explains the POSIX standards, their role in providing portable Unix-like system interfaces, demonstrates network client‑server programming with POSIX sockets, analyzes key socket functions and the TCP three‑way handshake, and introduces POSIX named and unnamed semaphores with example code for synchronization and producer‑consumer patterns.

Performance Optimization Techniques for Backend Systems: Replacing Protobuf with C++ Classes, Cache‑Friendly Structures, jemalloc, and Lock‑Free Data Structures

The article presents practical backend performance optimization methods—including substituting Protobuf with native C++ classes, employing cache‑friendly data structures, integrating jemalloc/tcmalloc, using lock‑free double‑buffer designs, and tailoring data formats—to achieve up to three‑fold speed improvements and significant latency reductions.

Fundamentals of Modern C++: Types, Pointers, Functions, and Classes

The article offers a concise, modern C++ (C++11+) tutorial covering fundamental built‑in types, variable declaration with auto and uniform initialization, pointer and array handling, function definitions, overloading, templates, class design—including constructors, move semantics, inheritance, virtual functions—and essential standard‑library utilities such as smart pointers and std::function.

Up to 500 articles, 100 per page. The archive offers another way to explore older articles.