Hacker News new | ask | show | jobs
by imtringued 3064 days ago
I'm not sure what hard problems have to do with code readability.

I've seen hard to read code that solves simple problems and I've seen easy to read code that solves hard problems.

Why are you advocating for the hard to read code?

1 comments

> I'm not sure what hard problems have to do with code readability.

Code can be hard to read because it's badly written, or it can be hard to read and understand because it deals with a hard problem.

> I've seen hard to read code that solves simple problems and I've seen easy to read code that solves hard problems.

I've seen easy to read code that solves simple problems that seem hard because of things like combinatorics (e.g. Sudoku solvers and the like). Actually hard problems don't have simple solutions; there's a complexity that doesn't go away no matter how you express the solution. This is doubly true when there are constraints on the solution in execution time and space, because such constraints limit how much you can break the problem down.

> Why are you advocating for the hard to read code?

Where did I do that?