4 ms·
Being simple... And then there comes Rust in all its glory with "my string constant".to_string() awkwardness and Golang with datetime to string formmating usin
by HackerThemAll 3y ago
Being simple...
And then there comes Rust in all its glory with "my string constant".to_string() awkwardness and Golang with datetime to string formmating using "2006-01-02 15:04:05.999999999 -0700 MST"...
Modern languages are full of idiosyncrasies that work like putting left hand in the right pocket, and from behind.
- avgcorrection 3y ago> And then there comes Rust in all its glory with "my string constant".to_string() awkwardness Would you feel better if it was `"my string constant".to_owned_string()`?
- laerus 3y agoYou are confusing "simple" with "easy". When you are trying to solve hard problems the "easy" way you are going to have bigger problems later than just awkwardness.
- bunderbunder 3y agoI'm not sure I would call Rust's solution "simple" either. My sense is that fine-grained, per-object, deterministic memory management simply cannot be made simple or easy, because the very thing you're trying to do is inherently complex and difficult. I realize it doesn't provide the same level of safety guarantees that you get out of Rust, but I am very sympathetic to Zig's approach of having no implicit default allocator, so that I can instead just use something simple and easy to reason about like an arena allocator in the 90% of cases where that's good enough for my purposes.
- notTooFarGone 3y agoYou could use the constants that everyone uses like time.RFC3339 or ISO 8601. Why it is under the hood allowed to define your own timeformat is quite obviously legacy data. At least it's human readable.