this post was submitted on 28 Jul 2023
34 points (97.2% liked)

Rust

6947 readers
24 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] BB_C@lemm.ee -3 points 2 years ago (10 children)

It's about not ignoring the clear underlying cause of the bug that is screaming at everyone who reads the bug description.

Include something along the lines of "We will use the URL crate and utilize its API to avoid trivial URL construction errors like this one in the future", and I may take your postmortem seriously.

A flawless developer does not exist, and at no point did I fault any developer directly for their development work. But that doesn't mean we should ignore something that is/was clearly and inherently wrong with the code. You would think this is all stating the obvious.

So it's not "just don’t write buggy code in the first place!”. It's "this code could clearly have been written in a way that would have prevented this bug from ever taking place".

And yes, good code matters. A good language matters. A good type system matters. A good use of a good language with its type system, patterns, abstractions, ecosystem, and all it got to offer matters. This is Rust afterall. If those things don't matter, then we might as well let the code be written in Python or JS, and fully recommit to the church of TDD.

[–] gnus_migrate@programming.dev 3 points 2 years ago (5 children)

A good language matters. A good type system matters. A good use of a good language with its type system, patterns, abstractions, ecosystem, and all it got to offer matters.

Eh research shows otherwise. Rust eliminates defects for a very particular set of problems, but when it comes to logical correctness it isn't better or worse than other languages. If those problems are prominent in your domain(such as you have to write a ton of concurrent code), Rust makes sense. Otherwise being well rested will have a bigger impact on the quality of your code than the best type system in the world.

In terms of dev practices, the only practice demonstrated to have a consistent positive impact on code quality is code reviews. Testing as well, but whether it's TDD or other kinds of testing doesn't really matter.

[–] BB_C@lemm.ee 2 points 2 years ago (4 children)

research shows otherwise

Can you share that research?

[–] gnus_migrate@programming.dev 1 points 2 years ago (2 children)

https://youtu.be/WELBnE33dpY

It's not that there is evidence that it doesn't matter, but there is no evidence showing that it does.

[–] PipedLinkBot@feddit.rocks 1 points 2 years ago

Here is an alternative Piped link(s): https://piped.video/WELBnE33dpY

Piped is a privacy-respecting open-source alternative frontend to YouTube.

I'm open-source, check me out at GitHub.

[–] BB_C@lemm.ee 1 points 2 years ago (1 children)

Eh research shows otherwise. Rust eliminates defects for a very particular set of problems, but when it comes to logical correctness it isn’t better or worse than other languages.

Can you concede, at least to yourself, that you made ^ this ^ up?

By the way, what you claimed "research shows" is so ridiculous that it's hilarious that you wrote it while being serious.

Hell, I cheekily mentioned Python and JS in particular because the former introduced type hints and the latter triggered creating TS as a saner shield.

Btw, that wrongly-constructed URL wasn't even an external one. We literally have web frameworks that make sure non-external URLs with invalid paths are impossible to construct. In other words, attempting to construct a wrong one would be a compile error.

[–] gnus_migrate@programming.dev 1 points 2 years ago

By the way, what you claimed “research shows” is so ridiculous that it’s hilarious that you wrote it while being serious.

There is still no research that definitively shows that static types reduce defects more than dynamic types, this is a fact. Turns out we are incredibly bad at studying this, so I don't know how you can say definitively that it is the case when even the people who study this for a living are not able to make that case.

load more comments (1 replies)
load more comments (1 replies)
load more comments (5 replies)