Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Grundeir7258yIn Rust, you actually write assertions as part of the documentation. That way you're guaranteed that the documentation always stays up to date.
If someone changes the behaviour of the code without updating the documentation, your test suite will start to fail. -
snypenet2358yThis is why I practice TDD, my tests TEL you how this should work. Which sounds like Rust has the concept baked, am I understanding right?
-
Grundeir7258y@snypenet while I agree that TDD is awesome and tests are important, I don't believe they can be a substitute for having documentation.
I think you're indeed understanding correctly: in Rust, assertions are baked into documentation. (One caveat: it is possible to write docs without assertions, a bad programmer can still screw it up, as with any other language.) -
snypenet2358y@Grundeir I don't agree that tests couldn't replace documentation because gherkin provides a great higher level syntax for business or anyone to describe functionality and then create step definitions that execute that spec.
That's pretty cool. I might need to try rust.
Related Rants
Code never lies..
undefined
comments