News for hackers. Stuff that matters.
Re:I couldn't submit a PR, so I got hired and fixed it myself by arguflow on Friday August 01, 2025 @02:09PM (#44760322)
Code is always the best documentation and the best thing about opensource.'
Re:I couldn't submit a PR, so I got hired and fixed it myself by doubled112 on Friday August 01, 2025 @02:46PM (#44760790)
Code will tell you what but not the why. It also doesn’t always tell you the intent.
Re:I couldn't submit a PR, so I got hired and fixed it myself by jmercouris on Friday August 01, 2025 @03:03PM (#44760972)
Good commit logs or comments may tell you why
Re:I couldn't submit a PR, so I got hired and fixed it myself by tobyhinloopen on Friday August 01, 2025 @03:35PM (#44761386)
What about function names, class names and variable names?
Re:I couldn't submit a PR, so I got hired and fixed it myself by kulahan on Friday August 01, 2025 @03:22PM (#44761214)
Helluva wish.
Re:I couldn't submit a PR, so I got hired and fixed it myself by tunesmith on Friday August 01, 2025 @03:14PM (#44761127)
They should invent a programming language that only compiles if the why is still true.
Re:I couldn't submit a PR, so I got hired and fixed it myself by 9rx on Friday August 01, 2025 @04:07PM (#44761823)
They have, but they're beyond grasp of most developers.

Tests were invented to express the "why" for the normal guy. They don't strictly prevent compilation, but a proper workflow will see them halt your process in the same way, offering the same outcome.

Granted, there are a lot of horribly written tests out there that don't tell you "why" — or, well, anything. As always, people will find a way to abuse anything you put in front of them. But when used well...

Re:I couldn't submit a PR, so I got hired and fixed it myself by tunesmith on Friday August 01, 2025 @06:03PM (#44762955)
With a test, it might link up some functionality with "why" and pass, but then what happens if a business requirement just isn't a requirement anymore? The test will still pass. I'm thinking of something sillier, like a language that forces you to justify why for your code, and then regularly quizzes you if the business reasoning is still true. If anything changes, it rips out the code and breaks your site. :) So then you have to go in to fix it.

I'd also love it if this were applied to politics and laws.

Re:I couldn't submit a PR, so I got hired and fixed it myself by 9rx on Saturday August 02, 2025 @12:09PM (#44768769)
It wouldn't be too hard to add such logic to your tests. If it proves useful, someone will no doubt turn it into a language feature.
Re:I couldn't submit a PR, so I got hired and fixed it myself by rjsw on Friday August 01, 2025 @02:45PM (#44760778)
Having the source lets you fix something for yourself, there are an increasing number of barriers being put up to prevent you submitting a fix upstream.

Going through this right now with part of libpng, their mailing list doesn't seem to like my email.

Re:I couldn't submit a PR, so I got hired and fixed it myself by aidenn0 on Friday August 01, 2025 @03:12PM (#44761095)
Using a source-based distro (previously Gentoo, now NixOS) lets me solve the problem for myself, even if my PR never gets accepted. Right now the count is at 4 patches in software I use that I submitted upstream that were (for one reason or another) never accepted.

In at least one case, I later found out that I was not the only person to submit a fix for the problem I was running into, but their discussion on the ML also went without comment 3 years earlier.