Remix.run Logo
9rx 5 days ago

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.