6 ms·
I think what he has in mind are small programs that do some kind of nontrivial computation without much in the way of IO or UI. For example, [1] is a program fr
by nickdrozd 7y ago
I think what he has in mind are small programs that do some kind of nontrivial computation without much in the way of IO or UI. For example, [1] is a program from December 2019 that "finds n-bit binary squares that are palindromic".
A great way to get into this kind of thing if you're stuck for ideas is to go through the Online Encyclopedia of Integer Sequences [2] and just write little programs to print out the first n entries or whatever for a particular sequence. As other comments have suggested, don't worry about making them perfect, just get the numbers right and then move on to the next one.
[1] https://www-cs-faculty.stanford.edu/~knuth/programs/squarepal.w https://www-cs-faculty.stanford.edu/~knuth/programs/squarepa...
[2] https://oeis.org/ https://oeis.org/
- Ragib_Zaman 7y agoAlong these lines, Project Euler is great.
- tgvaughan 7y agoSo is the blog "Programming Praxis". Its author has been posting short and interesting programming exercises at least once a week, but often more, for years.
- paganel 7y ago> is a program from December 2019 that "finds n-bit binary squares that are palindromic". No dis-respect for Donald Knuth (who of course I found orders and orders of magnitude above programmers such as myself) and no dis-respect to people that found those types of programs interesting, but there are also programmers (like me) for whom those programs are just simple riddles, with almost no interest whatsoever. They're like sudoku or crossroads, interesting and somehow intellectually stimulating but they don't help shape/change/modify the world around us. And I got hooked on programming when I realised how it could help me change the world around me and most of all how it could help me (and others) in trying to make sense on said world that surrounds us.
- samatman 7y agoWell, yes, of course. The question was about the sort of little programs someone could write daily, and the answer resembles crosswords or sudoku, which many people are in the habit of completing once a day. Would completing one integer sequence algorithm (brilliant suggestion btw!) change the world around you? No, of course not. Would it make you a better programmer, though? Certainly it would. Which would mean, when you settle down, crack your knuckles, and start changing the world, you'd do a better job of it. Your objection strikes me as that of a hunter who won't go to the range, because when he fires his rifle, he wants to put meat on the table!
- saagarjha 7y ago> Would completing one integer sequence algorithm (brilliant suggestion btw!) change the world around you? No, of course not. Depends on the sequence, of course. I hear a lot of people would be interested in a fast algorithm for computing membership in OEIS A000040.
- remcob 7y ago> They're like sudoku or crossroads, interesting and somehow intellectually stimulating but they don't help shape/change/modify the world around us. I don't think this is accurate: sudoku and crossroads have deterministic known solutions. Solving them is a mostly mechanical feat and indeed somewhat useless beyond the joy of solving. In contrast, the challenge of creating these sorts of programs is creative and open ended. It is very well possible that someone will come up with an even more efficient algorithm. Or a much simpler one. Or just a completely new strategy. As to the usefulness, these little toy programs are a constant source of inspiration for solving actual real world problems. A perfect example of this is Algorithm X. One of Knuth's toys that solves Sudoku puzzles. The same algorithm is easily adapted to solve scheduling problems and actually is a major innovation.
- fooker 7y agoWell you can write an interpreter or a compiler for a simple language you design. You can try to make text-based games. You can make a bare-bones browser. You can write a simulator for ..say.. classical mechanics. Are none of these interesting for you?
- hackermailman 7y agoOf course the answer for OP is reading and working through taocp, that practice makes you better which is why Knuth spent his life writing these books even if technically, they are as the Knuth states just a study of 'alg a compared to alg b' the byproduct is more practice that OP is looking for.
- winter_blue 7y agoI feel like solving leetcoe problems would fall somewhere in the category of programs you're describing. (They seem like small problem solving programs.)