Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
thecodedmessage
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
thecodedmessage
3y ago
C++ was grungy in the 90’s, and, well, Rust as it is now is better than C++ as it is now, the comparison that matters now. Rust in 30 years will be better than C++ in 30 years. And safety is a big deal feature, and Rust has it. If it doesn’
32.
▲
by
thecodedmessage
3y ago
Thanks! It’s still not as ergonomic as full first class support, but I did have the situation in my head as worse than it was. This has been fixed :)
33.
▲
by
thecodedmessage
3y ago
I never recommended Go :-) I'd personally rather program C++ than Go, so I can see where you're coming from! That said, C++ is abandonware, switch to a modern language :-) :-)
34.
▲
by
thecodedmessage
3y ago
I'm just spoiled from being able to return and consume a tuple in Rust without writing a standard library function or type name once :-) I'm glad C++ has got it down to one though! Now if only people will start using this instea
35.
▲
by
thecodedmessage
3y ago
You still have to write boilerplate to return them, though :-( But I agree it's better :-) Unfortunately, I'm on C++11 for this project, will be on C++03 for others :-(
36.
▲
by
thecodedmessage
3y ago
Yes, the "C++ is not usable on its own and needs other tools" defence of C++ :-)
37.
▲
by
thecodedmessage
3y ago
What part of "first-class" don't you understand?? ETA: std::variant is one of the least ergonomic user interfaces I've ever seen. std::tuple seems great until you realize that most PLs that support tuples just do "(
38.
▲
by
thecodedmessage
3y ago
Author of the blog post here. I am limited to C++11 for this, and will be limited to C++03 for some related projects. I did say C++11 in that comment, as I am of course aware that C++ has "fixed" that issue, but I'm still e
39.
▲
by
thecodedmessage
3y ago
I said "In C++11" because I am aware that it has been fixed later. But I'm stuck in C++11 for platform reasons and so I get to complain about its problems too. But of course, it is because I am aware that this has been fixed
40.
▲
by
thecodedmessage
3y ago
No, you cannot use '= default' for the assignment operators if you have custom copy/move constructors. I thought this was clear that this was my complaint in the post. I will make it clearer in the post. IF you customize the
41.
▲
by
thecodedmessage
3y ago
See, I CAN program C++. I still prefer Rust. “Some people who can use other systems fine, can’t use my preferred system” is possibly the worst defense of a system. It’s bad. It’s not something to be proud of.
42.
▲
by
thecodedmessage
3y ago
Yeah, but I’m simply not convinced this cliche is that bad.
43.
▲
by
thecodedmessage
3y ago
Can you explain why it’s bad if a central bank is in the hole? Like, what bad practical effects does it have?
44.
▲
by
thecodedmessage
4y ago
> Maybe he wants to avoid the ten million reply guy Rust evangelists out there Well, he doesn't get to. If he's going to imply that one of the major selling points of Rust over C++ barely matters, he's going to get a respo
45.
▲
by
thecodedmessage
4y ago
> If he was, then why didn't he mention it? You seem to know what Stroustrup's inner thoughts are, so tell me, why didn't he mention it? As I say immediately afterwards, if he wasn't, he should've been. If Strous
46.
▲
by
thecodedmessage
4y ago
You can still have rogue references to deleted objects in such a situation, or invalidated iterators, or plenty of other undefined behaviors even using just modern C++ features.
47.
▲
by
thecodedmessage
4y ago
Therefore, what, exactly? Do you think Stroustrup is not aware of Rust? Do you seriously think he wasn't thinking about Rust when he wrote this? Even if he wasn't, don't you think he should've been? Do you not think the
48.
▲
by
thecodedmessage
4y ago
I just don't think this is a remotely justifiable reading.
49.
▲
by
thecodedmessage
4y ago
Ada and Rust aren’t really comparable, and more importantly Ada and C++ aren’t really comparable. The key feature of Rust isn’t that it’s safe — many programming languages are, after all. The key feature of Rust is that it manages to have a
50.
▲
by
thecodedmessage
4y ago
Squeak implements it with horrible performance, IIRC
51.
▲
by
thecodedmessage
4y ago
I'm happy you're happy, but I don't think that's most people's experience. Perhaps compared to pre-modern C++.
52.
▲
by
thecodedmessage
4y ago
I back it up, I promise. I don't think it's overstated, except in that perhaps "considered harmful" is ... considered so harmful that there's no appropriate use anymore. But C++ move semantics are quite problematic,
53.
▲
by
thecodedmessage
4y ago
Thanks so much! That article was the original (anti-)inspiration for this post. It is so condescending: "Moves are so simple if you pretend you don't understand what they're for and why they're preferable to copies, and
54.
▲
by
thecodedmessage
4y ago
Thanks for the compliment! I wanted to go more into pinning, but this post was already extremely long (and many people have already complained about how long it is). So everything you said is very on-point, just covered by "the detai
55.
▲
by
thecodedmessage
4y ago
Rust fans might complain that the static code analysis is not built in, and therefore working a "C++ job" will expose you to code that has not been properly statically analyzed, or not with an analyzer up to your personal standard
56.
▲
by
thecodedmessage
4y ago
Author here! C++ has serious problems. Linus Torvalds agrees. Bryan Cantrill agrees. Many, many experienced systems programmers agree. Rust solves many of the problems with C++, as a systems programming language. That is the scope of my arg
57.
▲
by
thecodedmessage
4y ago
Author here! My "example" is showing an equivalent to what the C++ compiler actually outputs, inlining the `std::string` abstraction, given the input code, which in this context was C++03, and before emplace. But emplace doesn