6 ms·
Regulations are like lines of code in a software project. They're good if well written, bad if not, and what matters more is how well they fit into the entire s
by idrios 11mo ago
Regulations are like lines of code in a software project. They're good if well written, bad if not, and what matters more is how well they fit into the entire solution
- lucketone 11mo agoAnd lines of code is like the mass of an airplane.
- aallaall 11mo agoJust put all code on one line then. Statements (or tokens) is what matters.
- samdoesnothing 11mo agoIn general you want as few as possible of both.
- econ 11mo agoYou could also optimize everything for future updates that optimize things even further for even more updates... Humm.. that was supposed to be a joke but our law making dev team isn't all that productive to put it mildly. Perhaps some of that bloat would be a good thing until we are brave enough to do the full rewrite.
- AceJohnny2 11mo agothat's right. This is the reason all my code looks like an entry to PerlGolf. /s The world's complicated. "Every complex problem has a solution which is simple, direct, and wrong" Simplicity is a laudable goal, but it's not always the one thing to optimize for.
- lo_zamoyski 11mo agoAh, but "simplicity" is not necessarily "fewest lines of code". Code is first and foremost for human consumption. The compiler's job is to worry about appeasing the machine. (Of course, that's the normative ideal. In practice, the limits of compilers sometimes requires us to appease the architectural peculiarities of the machine, but this should be seen as an unfortunate deviation and should be documented for human readers when it occurs.)
- AceJohnny2 11mo ago> Code is first and foremost for human consumption. The compiler's job is to worry about appeasing the machine. Tangentially, it continues to frustrate me that C code organization directly impacts performance. Want to factorize that code? Pay the cost of a new stack frame and potentially non-local jump (bye, ICache!). Want it to not do that? Add more keywords ('inline') and hope the compiler applies them. (I kind of understand the reason for this. Code Bloat is a thing, and if everything was inlined the resulting binary would be 100x bigger)
- int_19h 11mo ago`inline` in C has very little to do with inlining these days. You most certainly don't need to actually use it to have functions in the same translation units inlined, and LTO will inline across units as well. The heuristics for either generally don't care if the function is marked as `inline` or not, only how complex it is. If you actually want to reliably control inlining, you use stuff like `__forceinline` or `[[gnu:always_inline]]`. Regarding code size, it's not just that binary becomes larger, it's that overly aggressive inlining can actually have a detrimental effect on performance for a number of reasons.
- aallaall 11mo agoModern cpus are optimized for calling functions. Spaghetti code with gotos is actually slower.
- array_key_first 11mo ago
- banana_sandwich 11mo agothis is wrong for the same reason using single letter variable names to keep things concise is usually wrong. i’d rather something a bit more verbose and clear than cryptic and confusing. there are many actors in the world with different brains.
- gessha 11mo agoA major difference with regulations is there’s no guaranteed executor of those metaphorical lines of code. If the law gets enforced, then yes, but if nobody enforces it, it loses meaning.
- estimator7292 11mo agoIf the law is code, then law enforcement is a JITter (joke)
- dijit 11mo agoOptimised compiler makes sense though. Unenforceable laws go unenforced, undefined behaviour is undefined and varies based on compiler (law enforcement agency or officer).
- mr_toad 11mo agoA jitter is like a lawyer on retainer. Law enforcement is more like the OS that segfaults you when you fail to follow the lawyers advice.
- KPGv2 11mo agoLaw enforcement is more like a toddler holding a glass of water over your CPU and saying "stop transistoring!"
- Kostchei 11mo agoThe problem with laws that both the enforcer and the subject (enforcee?) agree are bad, is that enforcement is variable. And that leads to corruption. Every damn time.
- KPGv2 11mo agoThe fix for corruption is vote the bums out of office. It is not to go whole hog into blind application of the law. Think about how hard it is to write code that has no bugs. Now imagine you're using English and working with a system with so many parameters and side effects that you can't possibly anticipate all eventualities. And now you want to rigidly apply your operators to this parameter space? Selective enforcement is necessary for justice, because no law is perfectly just, and selective enforcement helps move toward justice. It unfortunately also means there is the eventuality of corruption. So you just have to keep vigilant. Because a rigid system with no selective enforcement has no fix for injustice other than "live with it."