3 ms·
>the headers files are a pain and feel unnecessary. >no common package manager. I actually really love these. The best thing about C(++) is that, more than be
by kurisufag 3y ago
>the headers files are a pain and feel unnecessary.
>no common package manager.
I actually really love these. The best thing about C(++) is that, more than being simple a la Python, things are /obvious/. When writing Python code, for example, I often find myself opening a REPL window and testing small language features ("...can you __import__ a module twice if you bind both copes to different variables? do they have unique module-scoped state?"). "take this text file and insert it into this other text file" requires ZERO new considerations. ditto with having specific memory structures for objects, etc. etc.
oh, and package managers are evil. you end up getting locked into some bullshit ecosystem or workflow that you never wanted to sign up for, not to mention the obvious security issues (it seems like a large npm or pip package gets compromised once a month).
- boring_twenties 3y agoOh, things are obvious in C++, huh? Is the result of this function copied when it returns? auto f1() { if (check_something()) { std::optional<foo> result(std::in_place, arg1, arg2...); if (result->check_something_else()) { /\* do something unrelated */ } return result; } else { return std::optional<foo>(std::nullopt); } } How about this one? auto f2() { std::optional<foo> result(std::nullopt); if (check_something()) { result.emplace(arg1, arg2...); if (result->check_something_else()) { /\* do something unrelated \*/ } } return result; }