3 ms·
Tried this properly for the first time last year, and very much enjoyed doing each task 'properly' with literate programming, unit tests, benchmarks for differe
by thom 5y ago
Tried this properly for the first time last year, and very much enjoyed doing each task 'properly' with literate programming, unit tests, benchmarks for different implementations etc. It was extremely soothing, much more so than if I'd just tried to solve each problem as quickly as possibly. I'm sure some others would get a lot out of this approach, whether or not you're trying a new language.
- jstx1 5y ago> unit tests Don't you need a way to generate more inputs in addition to the one you have?
- a_humean 5y agoEvery puzzle comes with example inputs and expected outputs. Those inputs are much smaller than the puzzle input, but if you get the example inputs and expected outputs right then you are probably most of the way there. Basically every puzzle comes with unit tests that just need to be translated into code.
- someuname 5y agoThose would be functional tests
- jacobmischka 5y agoSame thing if your whole solution is a single function :)
- NoahTheDuke 5y agoWhich is another name for unit tests.
- thom 5y agoYup, although I do enjoy finding edge cases that aren’t necessarily present in the examples or input. I intend to do a fair bit more property-based testing this year, just for kicks. That’s something I’ve had success with for raw algorithmic code but struggled with in the past for nitty-gritty real-world use cases.