Remix.run Logo
arguflow 5 days ago

Code is always the best documentation and the best thing about opensource.'

doubled112 5 days ago | parent | next [-]

Code will tell you what but not the why. It also doesn’t always tell you the intent.

tunesmith 5 days ago | parent | next [-]

They should invent a programming language that only compiles if the why is still true.

9rx 5 days ago | parent [-]

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...

tunesmith 5 days ago | parent [-]

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.

9rx 4 days ago | parent [-]

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.

jmercouris 5 days ago | parent | prev [-]

Good commit logs or comments may tell you why

tobyhinloopen 5 days ago | parent | next [-]

What about function names, class names and variable names?

kulahan 5 days ago | parent | prev [-]

Helluva wish.

rjsw 5 days ago | parent | prev [-]

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.

aidenn0 5 days ago | parent [-]

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.