this post was submitted on 28 Jul 2023
37 points (97.4% liked)

Rust

5777 readers
46 users here now

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

Wormhole

[email protected]

Credits

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

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 11 points 1 year ago (14 children)

I can’t tell if your comment is intentionally sarcastic but it sure sounds like you’re saying “just don’t write buggy code in the first place!”

[–] [email protected] -3 points 1 year ago (13 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.

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

Honestly url.join looks like a cluster-fuck of landmines to me: https://github.com/servo/rust-url/issues/333

I’d probably have just stuck with strings as well.

[–] [email protected] 1 points 1 year ago

I’d probably have just stuck with strings as well.

And this argument works as long as nothing wrong happens. Well, something wrong happened ;)

Smashing strings together is how this bug happened.

Constructing URLs reliably should have been the obvious first takeaway, was my point, instead of pretending the issue is not there. If Url::join() is somehow too confusing for some, then there are other ways to do it with simpler API, no problem.

load more comments (11 replies)
load more comments (11 replies)