3 ms·
Until Rust there was no real alternative. All other 'better' languages use a garbage collector which is a no-go in most of the situations where C++ is used.
by IshKebab 10y ago
Until Rust there was no real alternative. All other 'better' languages use a garbage collector which is a no-go in most of the situations where C++ is used.
- the_why_of_y 10y agoNot all - Ada, Modula-2, Object Pascal tried to compete in that space, but developers were more interested in C++ because it allowed them to just #include their existing C headers. Also, before GNAT became available around 1995, Ada vendors invoiced several limbs for a license.
- swift 10y agoObjective C probably also deserves to be on that list.
- dom0 10y agoThere were some comparable languages, but they usually made it harder to use C code.
- loup-vaillant 10y agoC++ is often used in situations where a GC would have been perfectly fine. I'll go as far as to guess that most C++ projects are like this. In my little corner of the world, C++ is one of the most overused languages.
- IshKebab 10y agoUntil relatively recently GC pauses have been a real problem. Java used to have no upper bound on stop-the-world GC pauses - your program could literally stop doing anything for an entire minute. But these days GCs are much better, and especially with the Go GC having sub-millisecond pauses I think you are right that most projects written in C++ today could be written in Go. (And it seems like that is starting to happen.)
- user5994461 10y agoThe real alternative has always been Ada.