The Coded Message
thecodedmessage.com · Personal blog · on HN since 2021
The Coded Message is a programmer's blog on Rust and C++, covering move semantics, RAII, and object-oriented design.
What HN saysHN commenters cite it as an example of C++ programmers moving to Rust and for its critique of C++ move semantics and memory safety.
34HN people shared it
5linked it in comments
57stories submitted
837story points
10 months agolast shared
2021people per year2026
Most-shared posts
- 1Sayonara, C++, and Hello to Rust6 people · 103 points · first shared 2021 · 165 comments on HN
- 2C++ Move Semantics Considered Harmful (Rust Is Better)6 people · 58 points · first shared 2021 · 36 comments on HN
- 3Rust Is Beyond Object-Oriented, Part 3: Inheritance4 people · 4 points · first shared 2023 · 1 comments on HN
- 4RAII: Compile-Time Memory Management in C++ and Rust3 people · 9 points · first shared 2022 · discussion on HN
- 5Can you have too many programming language features?3 people · 9 points · first shared 2022 · 3 comments on HN
- 6C++ Papercuts3 people · 4 points · first shared 2023 · discussion on HN
- 7My Reaction to Dr. Stroustrup’s Recent Memory Safety Comments3 people · 3 points · first shared 2023 · discussion on HN
- 8Endianness, API Design, and Polymorphism in Rust2 people · 84 points · first shared 2021 · 28 comments on HN
- 9Rust should not have provided `unwrap`2 people · 56 points · first shared 2022 · 127 comments on HN
- 10Netflix Should Become a Tech Company2 people · 7 points · first shared 2022 · 1 comments on HN
- 11Blocking Sockets and Async2 people · 3 points · first shared 2022 · discussion on HN
- 12My Dream C++ Additions2 people · 2 points · first shared 2023 · discussion on HN
- 13Trivia About Rust Types1 people · 104 points · first shared 2022 · 26 comments on HN
- 14In Defense of Async: Function Colors Are Rusty1 people · 89 points · first shared 2022 · 101 comments on HN
- 15Haskell error messages: come on1 people · 83 points · first shared 2022 · 76 comments on HN
What HN people wrote when they linked it
zahrevsky · 2026-01-03
Correct link: https://www.thecodedmessage.com/posts/oop-1-encapsulation/#comment-645…
Also, you have to wait a few seconds for the comments to load ¯ \ _ ( ツ ) _ / ¯
thecodedmessage · 2023-12-19
I am so sad there’s not more LoTR stories. Have written about this before: https://www.thecodedmessage.com/posts/tolkien/
ordu · 2022-11-18
There is a discussion that without rust's move semantics C++ cannot reach the safety levels of Rust. But rust's move semantic cannot be brought to C++ without breaking an existing code.[1]
In a short, C++ approach is to give any object a "blank state" which it must turn into after the value was moved from it. It is an attempt to track state "value was moved out" dynamically. Rust tracks it statically by treating a variable whose value was moved out as uninitialized variable and ensuring that are no accesses to uninitialized variables.
[1] https://www.thecodedmessage.com/posts/cpp-move/
tialaramex · 2021-11-01
There certainly are C++ programmers who express this sentiment. e.g. https://www.thecodedmessage.com/posts/hello-rust/
On the other hand, if the thing you don't like about C++ is that it keeps changing you may be unsatisfied in Rust too because Rust has in some ways an even faster pace of changes. Rust as it was written in 2015 still compiles on a modern Rust compiler (with edition set to "2015" and modulo any security issues) but it is no longer idiomatic Rust.
Shawnecy · 2024-03-18
About a year ago, Stroustrup wrote a similar response[0] to a similar statement from the NSA[1].
I wasn't really convinced and am more in agreement with this response to Stroustrup[2] from an embedded Linux developer. To quote from near the end of their response to Stroustrup:
> In the meantime, it is unfair for Dr. Stroustrup to call safe programming languages novelties or to pretend that C++ isn’t already far behind the times on this. This was already an important criticism of C++ decades ago, when Java first came out in the 90’s and was referred to as a “managed programming language.”
I'm not really buying that C++ is really all that commonly safe when we have stats like these[3]:
> A recent study found that 60-70% of vulnerabilities in iOS and macOS are memory safety vulnerabilities. Microsoft estimates that 70% of all vulnerabilities in their products over the last decade have been memory safety issues. Google estimated that 90% of Android vulnerabilities are memory safety issues. An analysis of 0-days that were discovered being exploited in the wild found that more than 80% of the exploited vulnerabilities were memory safety issues 1.
> The Slammer worm from 2003 was a buffer overflow (out-of-bounds write). So was WannaCry (out-of-bounds write). The Trident exploit against iPhones used three different memory safety vulnerabilities (two use-after-frees and an out-of-bounds read). HeartBleed was a memory safety problem (out-of-bounds read). Stagefright on Android…