← Back to context

Comment by NTDF9

7 years ago

Glad to have left C++ behind. I thank it for making me a better software engineer but I don't think I want to work with core dumps for the rest of my life.

Are core dumps per se, really bad? I think, that the feature is useful. What is bad is frequency of it happening. For example: are Python's tracebacks better? Maybe I had a bad luck, but in my experience they happen with similar frequency. Core dumps allow you to go to debugger and see what has happened. You can easily send the file. If the crashed software goes without source you can't do a thing, but that's what was the intention. With obfuscated Python one would also be left with nothing.

  • I speculate the parent comment was referring to the frequency of core dumps: that he/she experiences more of them compared to the Python tracebacks you mentioned.

    Disclaimer, I'm speculating that's what they meant, because I feel the same way. It's more common(for me) for Python to refuse to run than to run anyway and later crash, compared to C++. That said, Python isn't a good analogy there...Rust or Golang are more likely to refuse to run for bad code instead of running anyway and crashing later.

  • Core dumps aren't bad themselves. But the ease and frequency by which other developers (and myself) can cause a core is just insane. It makes C++ more of a headache than anything.

I know; I prefer the ITS/Lispm environment in which you were always running in the debugger. But I think most users wouldn't like that. Bill Gates laughed at me when I once suggested it in passing.

> I thank it for making me a better software engineer

It's especially nice that Rust has kept this basic attitude from C/C++ and in fact strengthened it a lot and aligned it with modern trends, even as it got rid of the annoying "core dumped" part almost in its entirety.

(The latest tagline of Rust is "A language empowering everyone to build reliable and efficient software." Do notice the everyone part, and especially the empowering bit - as opposed to letting even novice developers hobble themselves with substandard, bootcamp-level software-dev practices!)

  • I wish Rust would have kept saner OOP style classes from C++ instead of this bizarre trait stuff. The whole language feels like everything is just different for the sake of being different. Why is it "fn blah (x -> int.. -> int" or whatever when the rest of the tokens seem designed to save keystrokes at the cost of readability? Everyone is used to "int x(int y..". I've learned it some and the concepts around memory ownership and everything are good but the syntax is needlessly weird and annoying.

    • Special keywords like `fn` make parsing simpler. Trailing return types are useful in languages that support generic programming, because they make it easier to write a function whose return type depends on the types of its generic inputs. Even C++ has this feature now, using decltype and arrow notation:

          template<typename T, typename U>
          auto add(T t, U u) -> decltype(t + u)
          {
              return t + u;
          }
      

      C++ is notoriously hard to parse. Consider the "most vexing parse", or the fact that refactoring tools for C++ are always flakier than their Java / C# / Go equivalents, or the fact that https://cdecl.org/ exists. New languages in the "expressive, high performance" niche cannot continue to be held back by C++ syntax.

      4 replies →

    • I actually greatly appreciate that function definitions begin with a dedicated keyword in Rust. I've always found it rather painful that definitions don't stand out from function calls in C and C++.

      1 reply →

    • Rust is not based on C++. People coming from Haskell/ML aren't used to C's backwards type declarations, and that's why they're not in Rust; the people who make Rust have experience with more than just C/C++. So it's not different for the sake of being different, it is actually trying to be similar ... just not similar to C.

      3 replies →

    • C++ classes vs. Rust traits isn't just a matter of syntax differences.

      Btw the function syntax is:

          fn foo(x: u16, y: u16) -> u32
      

      If it were more C++ like it'd be:

          u32 foo(u16 x, u16 y)
      

      Which is less keystrokes if anything.

      11 replies →

    • I agree. The language design is great, but they purposely use weird conventions everywhere. And by weird, I mean foreign to C++ programmers which is 90% of their user base.

      They should have done what java did. Copy C++ syntax, only change it when needed. I've ported over java code where 2/3 of lines are nearly identical.

      The async debacle is a great example of this. They settled on weird syntax instead of doing what every other language does, because of some holier than thou acedemic snobbery. If every other language does it that way, it would have worked fine in rust.

      5 replies →