C++ Moment
C++ Moment
I think itās pretty useful, be interested to hear your hangups with it though because itās definitely not perfect.
If something goes wrong and I have a stack trace, that plus the type of exception will almost always be enough for me to figure out whatās wrong at least as a starting point. Iāve worked mostly with JVM languages in my career though so maybe I just donāt know how bad it actually is.
The same applies to using the core dump.
In fact, the Python one is the lest useful of the trio.
gdb you will indeed be amazed at how fucking powerful it is. If your server crashes grab that core dump!
Great fun and a good way to brush up on your assembly skills
Just load it on the debugger and leave your asm skill gather patina.
My favorite compile error happened while I was taking a Haskell class.
ghc: panic! (the āimpossibleā happened)
The issue is plainly stated, and it provides clear next steps to the developer.
this should never happen
I know this is supposed to be humorous, but thereās a reason why these languages can, and are doing what theyāre doing.
Core dumps are also worth learning about, theyāre really helpful if you understand them.
Yes. Itās a surprisingly bad debugger the more you think about it. I use it largely in assembly and it loves to spit out random errors about memory it tried to access based on the current register state. The shortcuts are kind of dumb.
It certainly works but I wouldnāt call it a pleasure to use.
I use gdb with great success for x64, rv64, and c:
info registers rip or just setup tui:
C++ iirc is used mostly for microprocessor code
lol no, itās used almost everywhere where performance is important and people want(ed) OOP, from tiny projects to web browsers (Chrome, Firefox) to game engines (Unreal, CryEngine). Many of these are hugely complex and do encounter segfaults on a somewhat frequent basis.
Saying C++ is mostly used for embedded applications is like saying C# is mostly used for scripting games, i.e. it doesnāt nearly cover all the use cases.
higher-level languages also exist
This depends on your definition of āhigher-levelā, but many people would argue that C++ is on a similar level to Java or C# in terms of abstraction. The latter two do, however, have a garbage collector, which vastly simplifies memory management for the programmer(generally anyway).
I also currently use it for a new project since all needed 3rd party libraries are from a very specific domain and the project has a deadline, so writing and testing wrappers for Rust that would provide me with any meaningful advantages down the road are too costly to budget for before the deadline.
That could become part of a future refactoring, though.
At least you are getting a dump, count your blessings. Could be worse!
Just hook your app to a debugger and load the dumb.
Raw adjust with tabs, fine adjust with spaces.
Donāt laugh, people are actually doing that.
Find me anyone who claims they use tabs for indentation, and I bet Iāll find at least one case where theyāre using both tabs and spaces.
The only safe way to avoid war crimes is to avoid tabs.
Why would I use spaces if I use tabs?
To comply with Pythonās best practices:
Also, it seemd like a huge waste of time hitting the space bar so many timesā¦
You use an editor that doesnāt auto-indent?

This document gives coding conventions for the Python code comprising the standard library in the main Python distribution. Please see the companion informational PEP describing style guidelines for the C code in the C implementation of Python.
I donāt use an ide, but I wrote a script that replaces any space I type with four.
I havenāt worked out all the use cases yet, though.
Linux kernel?
The kernel definitely mixes tabs and spaces:
If youāre a programmer, or think you might want to be one, I highly recommend this channel. Heās a savant at all sorts of low level things, quite funny and entertaining, and does a fantastic job of explaining whatās going on.