Hacker News new | ask | show | jobs
by WalterBright 4784 days ago
I don't really understand your post. You criticized D for having more features than C++, and Go for having fewer.
3 comments

That's exactly how I feel, I guess. D seems to have a lot more features (import, public import, and static import?) and I'm no expert but I feel some aren't all that necessary/add enough value. Go has fewer than C++, which I think is really good, except for some few ones that I wish were there. Only generic programming/templates off the top of my head actually.
And exceptions, or any other way to better handle error conditions, rather than that "if hell".
See I don't know about that. Maybe exceptions was one of the features that was good to be left out. I think maybe the comma ok idiom forces the programmer to more actively check for errors and recover from them, and there is no need to do things like RIIA. Maybe also the code is clearer to read, because you can see "if not ok then do_this()" and know that this is error checking/recovery code, instead of looking up the call stack to see where the exception that was thrown in one place is being handled.
I feel like panic/recover give me 90% of what I need from exceptions.
If only D had Rust like reference counted embedded smart pointers... [for a deterministic memory management].

I think that would be much easy to add than C++esque `smart pointers as library`.

Go <what I want> C++ D
Have you tried Rust?
Read some code thanks to your comment. I think I will try it.