3 ms·
Wow: C++ > Garbage collection was never added into C++. Manual memory management is extremely error prone. C++ has memory management simplification: referenc
by je42 6y ago
Wow:
C++
> Garbage collection was never added into C++. Manual memory management is extremely error prone.
C++ has memory management simplification: reference couting via shared_ptr/unique_ptr. The trade-offs are different, but in C++ manually managing memory is not necessary unless you have a good reason.
> C++ is notorious for its slow compilation time. Significantly slower than Java, not as bad as Scala.
That depends on what you use and how you use it. However, this is tricky to figure out what slows down the compilation.
> In C++, all references are nullable.
Looks like this guy really needs to read up on C++.
References can point to null, but not so easily.
I think he means pointers.
> Catching/throwing errors is the preferred error handling mechanism.
I think he should really watch Herb Sutters Video[see 1] on the improvements of exception handling that are in the pipeline.
Herb also discusses the alternatives to exception handling.
C#
> Multi-paradigm?
C# has Pattern matching since 8.0 [see 2]
Python
> Python is dynamically typed, there’s not much more to say about the type system.
Dynamically but strongly typed one could say.
> In comparison, NPM in JavaScript is the only tool you’ll ever need.
JS has Yarn as well...
> I don’t recommend using Python for large projects, the language was not built with serious software engineering in mind.
no arguments provided...
and in fact there are very large python projects out there in the wild.
Also, pytest is one of the best test frameworks that i have seen.
Rust
> Rust was designed from the ground up to be fast. Compilation of Rust programs takes longer than compilation of Go programs.
i don't understand why he bashes C++ for slow compilation times and not rust. According to [see 3] rust is twice as slow on some benchmarks...
> Rust is the only modern language on our list with no garbage collection.
> This forces the developers to think about low-level memory management, and makes developer productivity suffer.
No mention of the borrow checker etc, I find extremely disappointing.
> Rust has no built-in support for immutable data structures.
Discussions like [4] should be referenced - i think when discussing this topic.
JS
> JavaScript has good libraries for working with immutable data (like Rambda/Immutable.js).
Weird that he doesn't mention the library efforts in C++ [5] and Rust [6] and Python for immutable data-structures [7][8]
----
[1] CppCon 2019: Herb Sutter “De-fragmenting C++: Making Exceptions and RTTI More Affordable and Usable” https://www.youtube.com/watch?v=ARYP83yNAWk https://www.youtube.com/watch?v=ARYP83yNAWk
[2] https://docs.microsoft.com/en-us/archive/msdn-magazine/2019/may/csharp-8-0-pattern-matching-in-csharp-8-0 https://docs.microsoft.com/en-us/archive/msdn-magazine/2019/...
[3] https://users.rust-lang.org/t/are-there-any-compilation-time-benchmarks-of-rust-vs-g-vs-clang/4895 https://users.rust-lang.org/t/are-there-any-compilation-time...
[4] https://users.rust-lang.org/t/persistent-data-structure-support/31732 https://users.rust-lang.org/t/persistent-data-structure-supp...
[5] https://github.com/arximboldi/immer https://github.com/arximboldi/immer
[6] https://github.com/orium/rpds https://github.com/orium/rpds
[7] https://github.com/MagicStack/immutables https://github.com/MagicStack/immutables
[8] https://github.com/tobgu/pyrsistent https://github.com/tobgu/pyrsistent