Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



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


Yeah I think that's just called enforcing best practices, not optimal solutions.


One cannot enforce optimal solutions but one can prevent sub-optimal ones through proper checks.


You keep using that word, I don't think it means what you think it means.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: