• 0 Posts
  • 63 Comments
Joined 1 year ago
cake
Cake day: July 9th, 2023

help-circle
  • My head canon for sea-based Kaiju is they have a sack of muscles somewhere inside their body that can expand a cavity, kind of like the diaphragm expands the lungs, except instead of taking in air or water it just creates a volume of vacuum inside of them. This makes them extremely bouyant relative to the surrounding sea pressure, so they rapidly ascend and can casually float like a boat near the surface.

    But if they ever want to dive again, they just let that cavity collapse and all their bouyancy goes away.




  • Still much better than C++ templates, and I say that as someone who used to genuinely love C++ template metaprogramming. Admittedly Rust traits+generics are far more limited than C++ templates, but very often I find that to be a positive. The list of things that I feel traits+generics are missing is small and rapidly shrinking.






  • 5C5C5C@programming.devtoLemmy Shitpost@lemmy.world🤠 Yee-haw!
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    20 days ago

    Might be interesting if we could compare the percentage of pitbulls that have killed or maimed a child versus the percentage of IDF soldiers that have killed or maimed a child.

    Maybe even more informative would be the average number of children killed or maimed per pitbull versus the average number of children killed or maimed per IDF soldier 🤔



  • I use thread sanitizer and address sanitizer in my CI, and they have certainly helped in some cases, but they don’t catch everything. In fact it’s the cases that they miss which are by far the most subtle instances of undefined behavior of all.

    They also slow down execution so severely that I can’t use them when trying to recreate issues that occur in production.



  • And even if you do get to use pure modern C++ you’ll still get burned by subtle cases of undefined behavior (e.g. you probably haven’t memorized every iterator invalidation rule for every container type) that force you to spend weeks debugging an inexplicable crash that happened in production but can only be recreated in 1/10000 runs of your test suite, but vanishes entirely if you compile in debug mode and try to use gdb.

    And don’t even get me started on multi-threading and concurrency.


  • 5C5C5C@programming.devtoProgrammer Humor@programming.devC++
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    edit-2
    22 days ago

    There’s a difference between “You have to decide when to synchronize your state” and “If you make any very small mistake that appears to be perfectly fine in the absence of extremely rigorous scrutiny then this code block will cause a crash or some other incomprehensible undefined behavior 1/10000 times that it gets run, leaving you with no indication of what went wrong or where the problem is.”


  • 5C5C5C@programming.devtoProgrammer Humor@programming.devC++
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    edit-2
    22 days ago

    I’m not saying you can’t do multi-threading or concurrency in C++. The problem is that it’s far too easy to get data races or deadlocks by making subtle syntactical mistakes that the compiler doesn’t catch. pthreads does nothing to help with that.

    If you don’t need to share any data across threads then sure, everything is easy, but I’ve never seen such a simple use case in my entire professional career.

    All these people talking about “C++ is easy, just don’t use pointers!” must be writing the easiest applications of all time and also producing code that’s so inefficient they’d probably get performance gains by switching to Python.