Live data from Hacker News

Matt Godbolt sold me on Rust by showing me C++

collabora.com

671–675 of 675 posts

Re: Matt Godbolt sold me on Rust by showing me C++

#671

Earlier quoted context omitted.

Making something longer doesn’t make it easier to read, especially in repetition.

Making something explicit does.

Would it be better if you wrote out the type of every variable every time you used it? That would be more explicit.

Re: Matt Godbolt sold me on Rust by showing me C++

#672

Earlier quoted context omitted.

No, implicit conversion is a deliberate C++ feature and no analog existed in C. Like a lot of awful things about C++ this is their own choice and it's frustrating that they try to blame C for their choices. In C++ when we define a class Foo (a thing which doesn't exist in C) and we write a constructor Foo(Bar x) (which doesn't exist in C) which takes a single parameter [in this case a Bar named x], that is implicitly…

My copy of K&R disagrees with you that implicit conversion didn’t exist in C. See section 2.7 “Type conversions”. “Implicit arithmetic conversions work much as expected. In general, if an operator like + or * that takes two operands (a binary operator) has operands of different types, the ``lower'' typekis promoted to the ``higher'' type before the operation proceeds.” It goes on including giving a table of all the c…

Where do you see the disagreement?

Numbers are implicitly converted to the “largest” and perhaps “floatiest” representation.

Re: Matt Godbolt sold me on Rust by showing me C++

#673
post #660

Earlier quoted context omitted.

Defined good code TO YOU. You've failed to recognize there is no objective and universally recognized metric for good code within our industry. The closest thing we have to it is number of defects per line of code and how severe those defects are through CVEs. That's it. You've mistaken your personal preferences and aesthetic sense for absolute truth. The arrogance is astounding.

> have to choose between immediate callers handling failures (they don't always have the context to do so because they're not aware of the context of callers higher up on the call stack) or between propagating all of your error values all the way up the stack to the error handling point and making your program fantastically brittle and insanely hard to refactor. This is a bad choice to have to make. If you believe ot…

You've certainly demonstrated something, though likely not what you intended.

Re: Matt Godbolt sold me on Rust by showing me C++

#674
post #664

Earlier quoted context omitted.

The last fifty years have shown us that you can't — at least not sustainably and at scale. You can do so at one moment in time, or for smaller projects, but not in the face of large scale projects with team members changing over time.

I don't this the last fifty years show this at all, although Rust proponents want you to believe this.

[deleted]

Re: Matt Godbolt sold me on Rust by showing me C++

#675
post #664

Earlier quoted context omitted.

The last fifty years have shown us that you can't — at least not sustainably and at scale. You can do so at one moment in time, or for smaller projects, but not in the face of large scale projects with team members changing over time.

I don't this the last fifty years show this at all, although Rust proponents want you to believe this.

I guess.
Post reply on HN