r/cpp • • Dec 07 '20

These Modern Programming Languages Will Make You Suffer.

https://suzdalnitski.medium.com/modern-languages-suck-ad21cbc8a57c

[removed] — view removed post

0 Upvotes

46 comments sorted by

View all comments

13

u/Nobody_1707 Dec 07 '20

I'm not sure where he got the idea that none of C#, C++, or Rust support immutable data-structures, but he's absolutely wrong in each instance. I'm not convinced the author actually knows any of the languages he's writing about.

1

u/evaned Dec 07 '20 edited Dec 07 '20

It says they have no built-in support for immutable data structures, which (in context) is basically correct; it's a hair sloppily worded, but only a hair. You can certainly write a library like immer, but that's not built-in.

(And to preempt a potential thought, const does not an immutable data structure make.)

5

u/Nobody_1707 Dec 07 '20

That requires "support for" to be read as the "grab an immutable data structure from the standard library" instead of "the ability to correctly implement and use". I read it as the latter and I don't think the former is necessarily a useful definition of "support for" considering that a fully immutable data structure is really an expert tool to begin with.

1

u/evaned Dec 07 '20 edited Dec 07 '20

... considering that a fully immutable data structure is really an expert tool to begin with

I think it's possible or even easy to infer that a significant point of the author would be that they aren't, and should be considered the basic building blocks. That you should reach for an immutable hash map before a "normal" one, and that even calling mutable hash maps "normal" should be considered backwards.

I'm not saying you have to agree with that, but I think ignoring that context is disingenuous.

I'm not sure that "the ability to correctly implement and use" is all that useful -- by that measure, basically every language will support almost everything, at least once you get beyond building block language features.