
Criticizing the Rust Language, and Why C/C++ Will Never Die - pyprism
https://www.viva64.com/en/b/0324/
======
topspin
Myopic rant.

    
    
         "If your C++ code is not good enough or Java code is painfully
          slow, it's not because the technology is bad - it's because you
          haven't learned how to use it right."
    

More 'program better and you don't need Rust.' This was said of C++ by C
programmers and it regresses until we're programming punch cards in octal.

At one point the argument is (indirectly) made that Rust is on the "innovative
yet too idealistic" side of the ledger. This is bogus; Rust is pragmatic.
Otherwise release code would pay the cost of detecting integer overflows and
unsafe wouldn't exist. Rust just doesn't cop out on all the stuff that _can_
be dealt with in a reasonable manner.

    
    
         "static and dynamic analyzers [exist for C++]"
    

Dismissing the obvious value of providing one uniform and precise analyzer
integrated into the compiler is just bad thinking.

    
    
         "But these are actually two dialects of one language"
    

Unsafe changes a small and finite set of rules. It is an outrageous
exaggeration to claim a new 'dialect' is created by unsafe.

At one point the following construct rears it's ugly head again. It's become a
favorite for Rust haters:

    
    
        Vec<Rc<RefCell<Box<Trait>>>>
    

The cause of this somewhat unergonomic construct was dealt with over two years
ago[1], and a workable alternative using Cell<> existed at the time. Also, how
does a C++ advocate look at that type and somehow imagine it to be worse that
the utterly incomprehensible line noise that C++ templates routinely devolve
into? Hell, almost any given pointer to function in C is that bad or worse.

    
    
         "it doesn't have a decent inheritance and exceptions"
    

C++ doesn't have 'decent' inheritance either; most C++ programmers don't even
understand how inheritance in C++ actually works. Arguing that the lack of
exceptions in Rust is somehow a problem is deeply wrong; better and well
defined alternatives are provided. C++ exceptions are a failed language
feature and an enormous fount of UB. In all likelihood you're reading this
using a browser written by developers that have banned C++ exceptions from
their code bases (Google and Mozilla.)

    
    
         "Rust is safe indeed but, unfortunately, far from fast"
    

The one Computer Language Benchmarks Game benchmark cited here is cherry
picked. Rust does very well against C++ in that set of benchmarks, winning 6
of 10 at the moment and only a little less well against C. And we all know the
sort of issues inherent to those benchmarks; citing them without qualification
is either poor thinking or an insult to your intelligence. Two terrible
alternatives.

    
    
         "Macros used as a crutch to make up for the excessive verbosity
          caused by the absence of normal exceptions"
    

That doesn't make sense. _mic drop_

[1][https://github.com/rust-lang/rust/pull/24619](https://github.com/rust-
lang/rust/pull/24619)

~~~
igouy
> Myopic rant.

A 2 year old blog post adequately discussed back then --

[https://news.ycombinator.com/item?id=9531822](https://news.ycombinator.com/item?id=9531822)

> And we all know the sort of issues inherent to those benchmarks

Inherent to those benchmarks or inherent to benchmarks?

Innuendo.

