ProgrammingPro #95: C++98–23 Benchmarks, GitHub AI Secret Scans, Fancy F-Strings in Python, and Hardware-Aware Coding🏎️
The ACCU Conference: By Programmers, For Programmers
Running since 1997, ACCU is one of the longest-standing dev conferences—originally C/C++ focused, now covering everything from Python and Rust to Kotlin, Go, and more.
Use code PACKT2025 for 10% off your ticket.
Welcome to a brand new issue of ProgrammingPro.
In today’s Expert Insight, we share an original article by Ferenc-Lajos Deák, coauthor of Debunking C++ Myths, tracing C++ from 98 to 23 with real code and performance benchmarks that reveal how each standard holds up.
News Highlights: GitHub launches AI-powered secret scanning to cut false positives; critical Next.js auth bypass patched in v14+; Claude, Gemini, and OpenAI roll out major AI updates; and Oracle’s ML-optimized GraalVM boosts Java microservice performance by 7.9%.
My top 5 picks from today’s learning resources:
I Want My Own Fancy F-String Format Specifiers… Sure You Can🪡
Options Pattern Validation in ASP.NET Core With FluentValidation🧪
Hardware-Aware Coding: CPU Architecture Concepts Every Developer Should Know🏎️
But there’s more, so dive right in.
Stay Awesome!
Divya Anne Selvaraj
Editor-in-Chief
🗞️News and Analysis🔎
GitHub Leverages AI for More Accurate Code Secret Scanning: GitHub's AI-powered secret scanning now uses context analysis and multiple LLM techniques to reduce false positives and improve secret detection accuracy in code.
Next.js team fixes vuln that allows auth bypass when middleware is used, revises documentation recommending this method: The critical vulnerability allowed easy auth bypass via a specific request header, affecting all versions and is fixed in v14+.
Mar 21, 2025: AI updates from the past week: Claude can now browse the web for real-time responses; Google launched Gemini Canvas for collaborative coding; and OpenAI upgraded its audio models for better transcription and speech synthesis.
Oracle releases ML-optimized GraalVM for JDK 24: The version introduces GraalNN, an ML-based profiling system delivering 7.9% peak performance gains in microservices.
.NET 10 Preview 2: Enhanced Reconnection UI, Improved Blazor Features, and Updates across the Stack: Preview 2 also introduces enhanced navigation behavior, OpenAPI metadata generation, and UI updates in .NET MAUI.
The future of Scala: Pioneering features are now commonplace so what comes next?: Many features once unique to Scala are now mainstream, and adoption of Scala 3 remains slow due to incompatibility with Scala 2.
Microsoft introduces Hyperlight Wasm for WebAssembly workloads: The experimental micro-VM enables secure, low-latency execution of WebAssembly workloads in languages like C, Python, and Rust.
🎓Tutorials and Learning Resources💡
Legend:🎓 Tutorial/Course | 💼 Case Study | 💡 Insight/Analysis |
📖Open Access Book or Comprehensive Resource | 🗞️Something New
Python
🎓I Want My Own Fancy F-String Format Specifiers… Sure You Can: Shows you how to implement custom f-string format specifiers in Python by defining the
.__format__()
method, enabling tailored string output logic within your classes.💡fastplotlib: driving scientific discovery through data visualization: Introduces fastplotlib, a new Python library for GPU-accelerated, interactive scientific visualization built on modern graphics APIs like WGPU.
💡Defining AI tools in python: compares three approaches to defining AI agent tools in Python: using function docstrings, pydantic models, or supporting both.
C# and .NET
🎓How To Validate Email Addresses in C#?: Compares regex-based, built-in .NET classes, and simplified logic, ultimately recommending a lightweight custom method that avoids regex complexity and is resilient to malformed inputs.
🎓How to Build a 2D Safe Code Breaker Mini-Game in Unity: Walks you through building a 2D “Safe Code Breaker” mini-game in Unity using UI elements, C# scripting, and audio feedback.
🎓Options Pattern Validation in ASP.NET Core With FluentValidation: Shows you how to use FluentValidation with ASP.NET Core’s Options Pattern to validate configuration settings at startup, offering a more powerful alternative to Data Annotations.
C++ and C
💡C++26 Expansion Tricks: Demonstrates advanced compile-time expansion techniques in C++26 using reflection (P2996), structured bindings (P2686), and expansion statements (P1306).
🗞️C++ Dynamic Debugging: Full Debuggability for Optimized Builds: The feature introduced in Visual Studio 2022 (v17.14 Preview 2) enables full debugging of optimized C++ code by dynamically deoptimizing breakpoints or stepped-into functions.
📖Open Access Book | Beej's Guide to C Programming by Brian "Beej Jorgensen" Hall: A comprehensive resource designed for individuals who have prior experience with other programming languages and wish to learn C.
Java
🎓Stream Gatherers: The Missing Piece in Java Stream Processing: Explains how to build and apply custom gatherers, including stateful, stateless, and parallel-capable examples.
🎓How to query CSV as a database table in Java with esProc: Shows you how to use esProc to query CSV files in Java as if they were database tables, by embedding SPL statements via esProc's JDBC driver.
JavaScript and TypeScript
🎓UI Algorithms: A Tiny Undo Stack: Explains how to implement a lightweight, robust undo stack for UI actions using two arrays—
past
andfuture
—instead of index-based stacks.💡JavaScript numbers have an (adoption) problem: Explores how JavaScript’s exclusive use of floating-point numbers causes precision issues, bitwise limitations, and unexpected behavior and recommends using BigInt.
💡Speeding up Typescript Go by 100x: Delves into how caching subtlety in TypeScript's type system can dramatically affect compiler performance and how tsgo’s internals diverged from tsc before the fix.
Go
💼Faster interpreters in Go: Catching up with C++: Explains the design evolution of Vitess’s SQL evaluation engine — from an AST interpreter to a specialized bytecode virtual machine.
🗞️Goodbye core types - Hello Go as we know and love it!: Go 1.25 removes the concept of “core types” from the language spec, replacing it with clearer, operation-specific rules.
Rust
🗞️Rust Additions For GCC 15 Bring Support For if-let Statements, Other Improvements: The version's Rust front-end (gccrs) now also supports
Clone
, andCopy
derives, with upcoming support forPartialOrd
andPartialEq
.🗞️Fastrace: A Modern Approach to Distributed Tracing in Rust: This high-performance, zero-cost distributed tracing library for Rust integrates seamlessly with standard logging and supports automatic context propagation.
Swift
🗞️Introducing SwiftMCP: This open-source Swift macro framework turns documented Swift functions into AI-callable tools using Model Context Protocol, generating metadata, wrappers, and server integration with minimal setup.
🎓SwiftUI TabView: Explained with Code Examples: Explains how to implement and customize tab-based navigation in SwiftUI using practical examples for both simple and advanced app structures.
PHP
🗞️Rusty string formatting in PHP: Introduces f, a PHP package inspired by Rust's
format!()
macros, offering cleaner,{}
-based string formatting with support for positional, named, and padded placeholders.
SQL
🗞️SQLCritic: Correcting Text-to-SQL Generation via Clause-wise Critic: Proposes a novel method to improve text-to-SQL accuracy by evaluating and correcting generated SQL queries clause-by-clause using a critic model.
Ruby
📖Ruby, Ractors, and Lock-Free Data Structures: A comprehensive online resource authored by Ilya Bylich, focusing on concurrent data structures within the Ruby programming language.
💡My Ruby Debugging Tips in 2025: Shares tips focussed on improved workflows using
debug.gem
, Ruby LSP, and integrations like Code Lens and RSpec support.
Kotlin
🗞️Kotlin bolsters K2 compiler plugin support, WebAssembly debugging: Kotlin 2.1.20’s enhancements to K2 compiler plugins make kapt default and improve Kotlin/Wasm debugging with DWARF support.
💡Migration of an iOS/Android Application to Kotlin Multiplatform: Methodology and Key Steps: Recommends gradually shifting cross-cutting modules, data, business logic, and presentation layers to shared Kotlin code.
🧠Expert Insight: From C++98 to C++23: The Arithmetic Mean, Benchmarked and Optimized📚
Exploring the evolution of C++ through arithmetic mean calculations and performance analysis.
by Ferenc-Lajos Deák, coauthor of Debunking C++ Myths
Averaging algorithms are computational techniques used to determine the mean or average value of a set of numbers. They are widely used in machine learning (model optimization), signal processing (noise reduction), finance (trend analysis), and networking (traffic smoothing). Some common averaging algorithms include Arithmetic Mean (Simple Average), Moving Average (Sliding Window Average), Harmonic Mean, and Geometric Mean.
In this article we will explore one of the most common averaging algorithms: the Arithmetic Mean, and its implementation in C++. We will explore how to compute the average of a vector using five different approaches, each corresponding to a major C++ standard, from C++98 to C++23. Additionally, we will benchmark these implementations to analyze their performance and efficiency. Finally, we will dig into the code generated by the two most used compilers on Linux platforms, GCC and Clang, and perform a thorough analysis and see which one comes out the winner.
Readers will gain a deeper understanding of Practical C++ implementation across different standards: you will see how to compute the arithmetic mean of a vector using various C++ techniques and understand the evolution of the language from C++98 to C++23. You will also gain insights into optimizing code for performance, while keeping Modern C++ coding practices in mind and learn how they can be used to write efficient and readable code...
Computing the Average: Five Approaches
Let us now delve into five versions of a function that calculates the average of a vector of random integers. Each version utilizes a different C++ standard, demonstrating how modern C++ simplifies and makes common programming tasks more readable, but before introducing them, here is the code that generates the vector:
// Initialize random number generator
std::random_device rd;
std::mt19937 gen(rd());
std::uniform_int_distribution<int> value_dist(1, 100);
// Generate random vector
std::vector<int> numbers(50000);
std::ranges::generate(numbers, [&]() { return value_dist(gen); });
1. C++98: Classic for-loop Approach
In C++98, we relied on manual iteration using a basic for loop:
// C++98: Classic for-loop approach
double average_cpp98(const std::vector<int>& numbers) {
int sum = 0;
for (size_t i = 0; i < numbers.size(); ++i) {
sum += numbers[i];
}
return static_cast<double>(sum) / numbers.size();
}
This approach was straightforward but lacked modern conveniences like range-based loops or built-in algorithms.
2. C++11: Range-based Loop
With C++11, we gained access to range-based loops, making iteration more concise and readable:
// C++11: Range-based loop
double average_cpp11(const std::vector<int>& numbers) {
int sum = 0;
for (int num : numbers) {
sum += num;
}
return static_cast<double>(sum) / numbers.size();
}
This improved readability by removing explicit indexing and is one of the many usability improvements introduced in C++11.
3. C++14: Using std::accumulate
C++14 introduced functional-style algorithms such as std::accumulate, which simplified summing the elements:
// C++14: Using std::accumulate
double average_cpp14(const std::vector<int>& numbers) {
auto sum = std::accumulate(numbers.begin(), numbers.end(), 0);
return static_cast<double>(sum) / numbers.size();
}
This approach is more declarative and eliminated the need for a loop. C++14 focused on minor refinements and usability improvements over C++11.
4. C++17: Using std::reduce
C++17 introduced std::reduce, which is optimized for parallel execution:
// C++17: Using std::reduce (supports parallel execution)
double average_cpp17(const std::vector<int>& numbers) {
int sum = std::reduce(std::execution::seq, numbers.begin(), numbers.end());
return static_cast<double>(sum) / numbers.size();
}
std::reduce provides potential performance gains by allowing parallel execution when used with std::execution::par. C++17 marked a shift towards greater use of parallelism and optimization in the Standard Library.
Author Bio: Ferenc-Lajos Deák is a seasoned software developer with a strong foundation in mathematics and theoretical computer science, currently based in Trondheim, Norway. His career spans roles across diverse domains, including autonomous vehicles, real-time traffic systems, multimedia, and telecommunications. An avid open-source enthusiast, he maintains several live projects
and has authored more than a dozen articles for various technical publications, focusing on one of his passions: programming.
His book Debunking C++ Myths coauthored alongside Alexandru Bolboaca, was published by Packt in December 2024.
Get the eBook for $31.99 $27.99
🌟Advanced Concepts🚀
Applying Flow Metrics to Design Resilient Microservices: Explains how flow metrics such as Work-in-Progress (WIP), age, cycle time, and throughput can be applied to microservices to detect and contain system congestion.
AI Trends Disrupting Software Teams: Outlines five trends including generative development with code assistants and autonomous agents, AI-powered operations and observability, dynamic documentation, AI-integrated SaaS interfaces, and agentic systems for business automation.
Hardware-Aware Coding: CPU Architecture Concepts Every Developer Should Know: Explains instruction pipelining, memory caching, and speculative execution using a drive-through analogy.
Timescale architecture for real-time analytics: Explores how to build scalable, high-ingest, low-latency analytics apps using familiar SQL while gaining real-time insights over large time-series datasets.
🛠️Useful Tools⚒️
Lynx: An open-source framework that lets developers build native mobile and web apps using familiar web technologies, with high performance, Rust-based tooling, and cross-platform flexibility.
Unvibe: A Python tool that uses AI to generate and refine code until it passes your unit tests, making it especially effective for large projects with good test coverage.
STUMPY: A BSD-licensed, NumFOCUS-affiliated Python library for scalable time series analysis using matrix profiles, with support for docs, testing, and reproducibility.
That’s all for today.
We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most useful here.
If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want to advertise with us.
If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, just leave a comment below!