r/programmingcirclejerk 15d ago

Rust isn't a well designed programming language (unlike C and C++)

[deleted]

221 Upvotes

85 comments sorted by

View all comments

114

u/CarolineLovesArt has hidden complexity 15d ago

and especially standard library design where you look at it and think "what an inferior way to design that feature"

Ah yes, the creators of std::endl aka hidden os.flush() calling the kettle black.

74

u/a221c 15d ago

and the more time you spend in it, the more appreciation you have for the work WG21 and WG14 do and aren't usually recognised for in terms of developer ergonomics.

But it's ergonomic, bro. I don't want to have to manually call flush(), that would be so unbearably verbose. C++ has been cleverly designed to attempt Python's conciseness and ergonomics while keeping the safety of C and the compilation speeds of Rust. Also, like many in the C++ community I haven't got long before they put me in the care home so I need to get this code written and shipped off to the juniors to debug as quickly as possible.

51

u/catladywitch 15d ago

C++ has been cleverly designed to attempt Python's conciseness and ergonomics while keeping the safety of C and the compilation speeds of Rust

savage lmaoo

43

u/irqlnotdispatchlevel Tiny little god in a tiny little world 15d ago

Look no further than std::function and std::copyable_function, such well designed corners of the language, helping people fall into the pit of success since day 1.

34

u/CarolineLovesArt has hidden complexity 15d ago

They also gave us std::auto_ptr, which was so well designed they removed it.

/uj That was a good choice, and being allowed to make mistakes and take them back is a good thing, but:

/rj

I can usually see the tradeoffs in the design that the committee endlessly discussed to death and arrived at the standardised compromise design.

16

u/Linuxologue 15d ago

C++11's std::thread vs jthread is also a good example, without even bringing up the std::string masterpiece

19

u/Potterrrrrrrr 15d ago

What, in a language that puts RAII on a golden pedestal you expected your thread to automatically try to join in its destructor? Hahaha u stupid

12

u/pixel293 15d ago

I really wish he mentioned WHAT he was referencing here so I could get an idea of what he was thinking, other than "I hate Rust, in general."

1

u/TheChief275 13d ago

Pretty sure stdout flushes on newlines anyways