3 ms·
> Non-optimal solutions usually are visible/more cumbersome to write How's that? The difference between a suboptimal and an optimal solution can be perfectly v
by moffkalast 4y ago
> Non-optimal solutions usually are visible/more cumbersome to write
How's that? The difference between a suboptimal and an optimal solution can be perfectly valid normal code for lots of procedures. It's not something that's knowable without semantic meaning of what the code's trying to do.
- davidkunz 4y agoA few examples: - Rust forces you to deal with errors and "null" values (Option). If you just unwrap them, it's visible. - Rust requires systems with clear ownership. You can opt out with various smart pointers, it's visible. - Rust requires you to use Box for heap allocations, it's visible. Note: I'm not talking about optimal solutions in the sense of "best algorithm", more in the sense of "well thought out and without lazy shortcuts".
- moffkalast 4y agoYeah I think that's just called enforcing best practices, not optimal solutions.
- davidkunz 4y agoOne cannot enforce optimal solutions but one can prevent sub-optimal ones through proper checks.
- moffkalast 4y agoYou keep using that word, I don't think it means what you think it means.