News for hackers. Stuff that matters.
Re:Ask HN: How to Think Systematically as a Programmer? by drallison on Saturday October 10, 2020 @12:52AM (#24736766)
It usually helps to have a systematic mathematical model for the problem you are trying to solve, and systematic mathematical models for the sub-problems into which the full problem is decomposed. It is frequently better to conceive of each step in the program as ensuring some property is invariant rather than conceiving each step as performing some action.

It is probably better not to think of yourself as a coder or a programmer; consider yourself a problem solver with mathematical skills and move on to there.

Always convince yourself that the problem you are trying to solve has a solution.

Re:Ask HN: How to Think Systematically as a Programmer? by svrma on Tuesday October 13, 2020 @03:06PM (#24769008)
Thanks for this! This is something I've been practicing of late. I realized that have a lot of problem in arguing the correctness of greedy algorithms. Do you have any recommendation for a collection of proof techniques useful for greedy algorithms?
Re:Ask HN: How to Think Systematically as a Programmer? by drallison on Thursday October 22, 2020 @01:36AM (#24855203)
Kinda depends whether by "correctness" you mean "proof". I always found Social Processes and Proofs of Theorems and Programs by Richard A. De Millo, Richard J. Lipton, and Alan J. Perlis inspirational.

I do not know of any collection of proof techniques that would be uniformly useful for greedy algorithms. If you discover such a collection, please share it with me.