The Hunt for the Elusive Bug: A C++ Developer's Odyssey
Hey C++ aficionados of r/cpp,
Prepare yourselves for a saga from the trenches of C++ development—a tale of perseverance, frustration, and the relentless pursuit of elusive bugs. Join me on a journey through the labyrinthine corridors of code, where attention to detail reigns supreme and every misplaced semicolon is a potential landmine.
Imagine yourself knee-deep in C++ code, navigating the treacherous waters of memory management and pointer arithmetic. You're on the trail of a bug that has eluded capture for far too long—a bug that mocks your efforts with its stubborn resilience.
Hours turn into days as you comb through your codebase, searching for the elusive culprit that dares to defy your logic. And then, just when you're on the brink of despair, you spot it—a tiny oversight that has evaded your gaze until now: a missing
But in the world of C++, where elegance meets complexity, every bug is a lesson waiting to be learned. You debug, you iterate, and you emerge stronger than before, armed with newfound knowledge and a steely resolve.
So, to all my fellow C++ developers, I offer this advice: Embrace the challenge of debugging, for it is through the crucible of trial and error that we refine our craft. Stay vigilant, stay determined, and never underestimate the importance of attention to detail in the pursuit of elegant solutions.
Have you ever encountered a bug that tested your patience in the world of C++? Share your tales of triumph (or tribulation) in the comments below!
Link to "Powers of Ten" Video
Comments are welcome!
https://redd.it/1c99bxa
@r_cpp
Hey C++ aficionados of r/cpp,
Prepare yourselves for a saga from the trenches of C++ development—a tale of perseverance, frustration, and the relentless pursuit of elusive bugs. Join me on a journey through the labyrinthine corridors of code, where attention to detail reigns supreme and every misplaced semicolon is a potential landmine.
Imagine yourself knee-deep in C++ code, navigating the treacherous waters of memory management and pointer arithmetic. You're on the trail of a bug that has eluded capture for far too long—a bug that mocks your efforts with its stubborn resilience.
Hours turn into days as you comb through your codebase, searching for the elusive culprit that dares to defy your logic. And then, just when you're on the brink of despair, you spot it—a tiny oversight that has evaded your gaze until now: a missing
long keyword. Such a seemingly innocuous detail, yet its absence has thrown your entire project into disarray, leaving you grappling with frustration and disbelief.But in the world of C++, where elegance meets complexity, every bug is a lesson waiting to be learned. You debug, you iterate, and you emerge stronger than before, armed with newfound knowledge and a steely resolve.
So, to all my fellow C++ developers, I offer this advice: Embrace the challenge of debugging, for it is through the crucible of trial and error that we refine our craft. Stay vigilant, stay determined, and never underestimate the importance of attention to detail in the pursuit of elegant solutions.
Have you ever encountered a bug that tested your patience in the world of C++? Share your tales of triumph (or tribulation) in the comments below!
Link to "Powers of Ten" Video
Comments are welcome!
https://redd.it/1c99bxa
@r_cpp
YouTube
When you miss a long long
https://www.youtube.com/channel/UCZhIVX3stdZPH8MimLUauZQ?sub_confirmation=1
#programming #java #javaprogramming #code #codes #coder #codemasters #algorithm #algo #algorithms #dsa #data #datascience #datastructures #datset #leetcode #daliyvlog #daily…
#programming #java #javaprogramming #code #codes #coder #codemasters #algorithm #algo #algorithms #dsa #data #datascience #datastructures #datset #leetcode #daliyvlog #daily…
Implementing IRQ Handlers in C++23 on the Sega Dreamcast
https://fxtwitter.com/falco_girgis/status/1798947168101056574
https://redd.it/1daekxx
@r_cpp
https://fxtwitter.com/falco_girgis/status/1798947168101056574
https://redd.it/1daekxx
@r_cpp
FxTwitter / FixupX
Falco Girgis (@falco_girgis)
It's been FAR too long since I've been able to morally offend my C programmer colleagues with C++. So here's a closure being installed as an IRQ handler on the Sega #Dreamcast via a generic adapter that allows any callable to be invoked through the C API…
Understanding C++ File Extensions and the GCC Compilation Process
**Different C++ File Extensions**: In C++, you can use various file extensions like .cc, .cp, .cxx, .cpp, .c++, and .c.
**GCC: The Versatile Compiler**: GCC can handle all these extensions easily.
**Converting .cpp Files**:
* **Preprocessing**: Turn .cpp files into .ii files to get better debugging information.
* **Assembly**: Change .cpp files into .s files to see the low-level code.
* **Object Code**: Compile .cpp files into .o files to prepare for making an executable.
**Important GCC Options**:
* **-E**: Preprocess only.
* **-S**: Compile to assembly code.
* **-c**: Compile to object code.
For example:
// Compile the code to executable:
g++ prog1.cpp -o prog1
// Generate preprocessed CPP program:
g++ -E prog1.cpp -o prog1.ii
// Generate assembly code:
g++ -S prog1.cpp -o prog1.s
// Compile preprocessed code to object file:
g++ -c prog1.ii -o prog1.o
// Alternatively, compile directly from source to object file:
g++ -c prog1.cpp -o prog1.o
**Building a Command**:
g++ [options] [source files] [object files] [libraries] -o output_file
**Why Learn This?** Knowing these details makes you more efficient in developing and debugging C++ programs. It’s especially useful for senior software engineers who want to write better, optimized code.
#SoftwareEngineering #CPP #GCC #Programming #CodeOptimization #Debugging #CompilerOptions #CodingTips
https://redd.it/1djek8r
@r_cpp
**Different C++ File Extensions**: In C++, you can use various file extensions like .cc, .cp, .cxx, .cpp, .c++, and .c.
**GCC: The Versatile Compiler**: GCC can handle all these extensions easily.
**Converting .cpp Files**:
* **Preprocessing**: Turn .cpp files into .ii files to get better debugging information.
* **Assembly**: Change .cpp files into .s files to see the low-level code.
* **Object Code**: Compile .cpp files into .o files to prepare for making an executable.
**Important GCC Options**:
* **-E**: Preprocess only.
* **-S**: Compile to assembly code.
* **-c**: Compile to object code.
For example:
// Compile the code to executable:
g++ prog1.cpp -o prog1
// Generate preprocessed CPP program:
g++ -E prog1.cpp -o prog1.ii
// Generate assembly code:
g++ -S prog1.cpp -o prog1.s
// Compile preprocessed code to object file:
g++ -c prog1.ii -o prog1.o
// Alternatively, compile directly from source to object file:
g++ -c prog1.cpp -o prog1.o
**Building a Command**:
g++ [options] [source files] [object files] [libraries] -o output_file
**Why Learn This?** Knowing these details makes you more efficient in developing and debugging C++ programs. It’s especially useful for senior software engineers who want to write better, optimized code.
#SoftwareEngineering #CPP #GCC #Programming #CodeOptimization #Debugging #CompilerOptions #CodingTips
https://redd.it/1djek8r
@r_cpp
Reddit
From the cpp community on Reddit
Explore this post and more from the cpp community
CSS parsing in C++ with an in-depth look
>CSS parsing in C++ with an in-depth look
https://redd.it/1ev4015
@r_cpp
>CSS parsing in C++ with an in-depth look
https://redd.it/1ev4015
@r_cpp
YouTube
CSS parsing in C++ with an in-depth look ( subscribe to create a community )
CSS parsing in C++ with an in-depth look at the CParseCSS class and its related components.
Source code on github
github.com/srgank/css_parser
#coding #cpp #programming #css #parser
Source code on github
github.com/srgank/css_parser
#coding #cpp #programming #css #parser
The History of Object-Oriented Programming - Uncle Bob
https://youtu.be/H5ey93I_zMA
https://redd.it/1fcae85
@r_cpp
https://youtu.be/H5ey93I_zMA
https://redd.it/1fcae85
@r_cpp
YouTube
The History of Object-Oriented Programming - Uncle Bob
#objectorientedprogramming #oop #Simula #algol68 #smaltalk #Cpp #c++ #algol68
In this video Robert C. Martin (Uncle Bob) speaks on the origins of object-oriented programming and along with it also object-oriented programming languages. He speaks on Algol68…
In this video Robert C. Martin (Uncle Bob) speaks on the origins of object-oriented programming and along with it also object-oriented programming languages. He speaks on Algol68…
SQLite-Editor (open source code ) SQL-SELECT-WIZARD
https://youtube.com/watch?v=sKxhmifqmnA&si=o7u6fvMdS-Hqk6rY
https://redd.it/1hj9gbi
@r_cpp
https://youtube.com/watch?v=sKxhmifqmnA&si=o7u6fvMdS-Hqk6rY
https://redd.it/1hj9gbi
@r_cpp
YouTube
SQLite-Editor (open source code ) SQL-SELECT-WIZARD
SQLite-Editor (open source code ) SQL-SELECT-WIZARD
full source code on github github.com/srdzank/SQLite-Editor
#programming #cpp #sql #sqlite
full source code on github github.com/srdzank/SQLite-Editor
#programming #cpp #sql #sqlite
I want to share my video about C++.
I made a short tutorial on how to work with pointers in C++, I recommend it to the newbies to watch.
https://youtu.be/LNGQVVYxuAA
https://redd.it/1hjdzb0
@r_cpp
I made a short tutorial on how to work with pointers in C++, I recommend it to the newbies to watch.
https://youtu.be/LNGQVVYxuAA
https://redd.it/1hjdzb0
@r_cpp
YouTube
How to Work with Pointers in C++ It's Easy!
In this video, you will learn how to work with pointers in C++, you will learn how to work with them using the code that was written for an example.
#cpp #development #devs #tutorial #tutorials
#cpp #development #devs #tutorial #tutorials
Bolting on serializable, inspectable, precondition checkable, stack allocated coroutines onto CPP.
I am DSL designer in academia, a few years ago we identified a coroutine use case that required serializable, inspectable, precondition checkable and stack allocated coroutines in CPP. Instead of attempting the standardization process for cpp which would have taken took too much time and potentially lead nowhere, we decided implement the features as standalone cpp interoperable DSL (we have the same ABI as C) in the hope that if the DSL is interesting, then the ideas would spread to other languages. As far as we are aware, the mix of coroutine features we have is compleatly unique, and they enable one-click testing, automatic remote execution, automatic tracing and more.
language doc
cool example about preconditions in coroutines
Beside showcasing the language, this thread is mostly about collecting feedback about the article, in particular one example where we show case how people must write cpp today, and what precondition checkable, inspectable and serializable coroutines enable. The example describes the requirements of a problem as simple as rolling a dice twice in a video game, shows how you are forced to write cpp and how you could write it if you had serializable, inspectable and precondition checkablee coroutines. As far as I can think the statement is correct, the implementation in the link is pretty much the best possible cpp implementation, even macro tricks would not really improve the situation. Is there any way i can make the cpp example shorter, better and/or a fairer comparison?
https://redd.it/1ksachf
@r_cpp
I am DSL designer in academia, a few years ago we identified a coroutine use case that required serializable, inspectable, precondition checkable and stack allocated coroutines in CPP. Instead of attempting the standardization process for cpp which would have taken took too much time and potentially lead nowhere, we decided implement the features as standalone cpp interoperable DSL (we have the same ABI as C) in the hope that if the DSL is interesting, then the ideas would spread to other languages. As far as we are aware, the mix of coroutine features we have is compleatly unique, and they enable one-click testing, automatic remote execution, automatic tracing and more.
language doc
cool example about preconditions in coroutines
Beside showcasing the language, this thread is mostly about collecting feedback about the article, in particular one example where we show case how people must write cpp today, and what precondition checkable, inspectable and serializable coroutines enable. The example describes the requirements of a problem as simple as rolling a dice twice in a video game, shows how you are forced to write cpp and how you could write it if you had serializable, inspectable and precondition checkablee coroutines. As far as I can think the statement is correct, the implementation in the link is pretty much the best possible cpp implementation, even macro tricks would not really improve the situation. Is there any way i can make the cpp example shorter, better and/or a fairer comparison?
https://redd.it/1ksachf
@r_cpp
Anyone know what is he using
https://youtu.be/91NWEtO1yU8?feature=shared
https://redd.it/1osjz2d
@r_cpp
https://youtu.be/91NWEtO1yU8?feature=shared
https://redd.it/1osjz2d
@r_cpp
YouTube
study with me | code with me | HHKB Type-S | 40 min real time | no talking | Learn C++ | 2025.01.12
study with me | code with me | HHKB Type-S | 40 min real time | no talking | Learn C++ | 2025.01.12
- Happy Hacking keyboard (HHKB Professional HYBRID Type-S (Snow/Blank))
- Logitech MX Anywhere 3S mouse
- Blue Yeti USB microphone
tags
studywithme codewithme…
- Happy Hacking keyboard (HHKB Professional HYBRID Type-S (Snow/Blank))
- Logitech MX Anywhere 3S mouse
- Blue Yeti USB microphone
tags
studywithme codewithme…
Performance and where to find it
https://www.youtube.com/watch?v=86IQ9YI4Nuw
https://redd.it/1owvg68
@r_cpp
https://www.youtube.com/watch?v=86IQ9YI4Nuw
https://redd.it/1owvg68
@r_cpp
YouTube
Dušan Jovanović — Performance and where to find it — 26.2.2025.
Building performant software is an important aspect when working on any programming project. This holds much more value when working on C++ projects, which are usually the most critical performing piece in the software stacks.
Dušan talks about where we…
Dušan talks about where we…
C++26 ends a 40-year footgun
Reading an uninitialized variable has been undefined behavior in C++ for 40 years -- the kind optimizers exploit into real bugs. C++26 (P2795) reclassifies it as erroneous behavior: still a bug, still warned about, but defined, bounded, and not exploitable.
The demo poisons the stack, then reads an uninitialized int. As C++23 it prints garbage; as C++26, the same code prints a defined 0, every run. Live in your browser.
And [[indeterminate\]\] lets you opt back out when you really want an uninitialized buffer -- on purpose this time.
Read it: https://wrocpp.github.io/posts/erroneous-behavior/?utm_source=reddit&utm_medium=social&utm_campaign=post-erroneous-behavior
\#cpp #cplusplus #cpp26 #safety #programming
https://redd.it/1uo5y63
@r_cpp
Reading an uninitialized variable has been undefined behavior in C++ for 40 years -- the kind optimizers exploit into real bugs. C++26 (P2795) reclassifies it as erroneous behavior: still a bug, still warned about, but defined, bounded, and not exploitable.
The demo poisons the stack, then reads an uninitialized int. As C++23 it prints garbage; as C++26, the same code prints a defined 0, every run. Live in your browser.
And [[indeterminate\]\] lets you opt back out when you really want an uninitialized buffer -- on purpose this time.
Read it: https://wrocpp.github.io/posts/erroneous-behavior/?utm_source=reddit&utm_medium=social&utm_campaign=post-erroneous-behavior
\#cpp #cplusplus #cpp26 #safety #programming
https://redd.it/1uo5y63
@r_cpp
wrocpp.github.io
C++26 ends a 40-year footgun: uninitialized reads
Reading an uninitialized variable has been undefined behavior in C++ for four decades, and optimizers have happily exploited it. C++26 (P2795) reclassifies it as erroneous behavior: still a bug, still diagnosed, but with defined, bounded, non-exploitable…