Alles dreht sich, alles bewegt sich.

  • 13 Posts
  • 62 Comments
Joined 3 years ago
cake
Cake day: April 21st, 2024

help-circle






  • There are lots of ways to write C++ code that looks perfectly reasonable but introduces horrible undefined behaviour. You need to be aware of lots of edge cases all the time and you will still make mistakes that can introduce difficult to trace bugs. One of my personal favourites is object slicing.

    class A {
       int foo;
    };
    
    class B : public A {
       int bar;
    };
    
    B b;
    A a = b;
    

    Looks OK? Well, a now only contains the A part of the object. The field bar is lost in the assignment. There are reasons for this behaviour but its a sharp edge nonetheless.

    These kinds of problems are numerous and you have to keep them in mind while programming C++. Some people don’t mind it but many do. Static analysis tools that can catch many of these errors exist, but I understand people who say they don’t want to deal with that and rather use a language where these kind of errors are not possible. Personally, I would also discourage people from starting new C++ projects today if they can avoid it.




  • Let me introduce all of you to hexcore:

    Won’t get me to stop, I got a Potion of Resist Arrest

    Every pally in the kingdom on my tail
    They be questin’ for me like the Holy Grail
    I’m a wizza with a warrant on my head
    In this county there’s a bounty for me dead

    They see me comin’ but they can’t stop this disaster
    They be runnin’ but I fly a little faster
    I dim the sun, enchant my gun, a trigger caster
    They got it comin’ son, all paladins are bastards







  • Well unlike the others who commented you seem to post regularly here. So your opinion is actually worth something. Usually I don’t have to do much in regards to moderation, just the usual spam. Its really only this type of thread where a popular person gets criticised for their AI use and their fan club shows up. Then I try to get ahead of that and kick them out so it doesn’t fester. Free marketplace of ideas is all well and good until one side makes enough noise to drown out every opposing voice and I see the AI side very much as the noisy one.