13 ms·
What does it mean though? What programs? I can't write new programs at work where I maintain existing applications for the most part. What kind of programs, no
by bbbobbb 6y ago
What does it mean though? What programs? I can't write new programs at work where I maintain existing applications for the most part.
What kind of programs, not for the sake of programs, can you actually write almost daily?
- gowld 6y agoWe're business application/infastructure maintainers, not programmers. It's a different world from Knuth's expressions of mathematical ideas. Outside of work, it's easy to write whole programs. Project Euler, LeetCode, etc. These are the kinds of programs Knuth is talking about -- example programs to illustrate algorithms from TAOCP.
- bbbobbb 6y agoI understand that but those don't fall into the "not for sake of programs" category. Under that category, I imagine something where the resulting program itself is of any, however minuscule, use to me.
- nickdrozd 6y agoI 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 6y agoAlong these lines, Project Euler is great.
- tgvaughan 6y 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 6y 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 6y 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 6y 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 6y 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.
- hackermailman 6y 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 6y agoI feel like solving leetcoe problems would fall somewhere in the category of programs you're describing. (They seem like small problem solving programs.)
- mmcdermott 6y agoI find lots of little utilities fit the bill. They are oftentimes sufficiently narrow in scope to be of little use to anyone but the author, but that shouldn't necessarily eliminate their use. For example, here is a Gist with a shell script I wrote that, given a set of Maven coordinates, works with a few other tools to build out a docset for use in Zeal / Dash. https://gist.github.com/michaeljmcd/5564758537946963e946806e2813dfd1 https://gist.github.com/michaeljmcd/5564758537946963e946806e... I had to dig into some corners of Maven I didn't know well to pull it together and it formalized some random bits of minutae. Nothing elegant or crazy, perhaps, but it is a bit of coding apart from the normal day job that taught me a couple of tricks.
- gen220 6y agoYou can write "meta" programs that help you maintain existing applications. Whenever I start at a new company, before I get thrown into the heart of things and become "too busy" to write these kinds of programs, I like to write things that automate the boring stuff. Some recent examples: - a cli for inspecting, adding comments to, and updating the status of JIRA tickets. because our hosted JIRA instance was god-awful slow and their web interface is a mess. - a tool for monitoring things and pinging me with macos native notifications when things crash or complete. Was my net productivity positive for writing these tools? hard to tell. There are some companies full of engineers whose actual job is to write tools like this; I'm not sure what they would do for fun :P
- 0x445442 6y ago> There are some companies full of engineers whose actual job is to write tools like this; I'm not sure what they would do for fun :P I think there are a lot of organizations that would be better served devoting more resources to the meta work given the labor and infrastructure costs. I would go out on a limb and say the capital expended on the majority of projects I've worked on in my career had a smaller ROI (because it was negative in most cases) than would have been the case had the organization just invested in improving internal tools and processes of their existing systems.
- gen220 6y agoI totally agree with you. I think that most corporations are in a state of suspended myopia. We’d rather direct engineers to improve the effectiveness of a single system by 200% (even though it impacts 1% of revenue), than to impact all (or many) systems by 5%. Yet, most of the impressive software we admire today was built in the environment you prescribe. C and UNIX, famously, but also git, Go, Rust. I imagine many others. How much has C improved productivity, over Assembly and COBOL? How much has Borg or BigTable? The issue, IMO, is that no ambitious manager wants to invest the social capital in defending and advocating for these teams, because they don’t look good until they look exceptionally good.
- mark-r 6y agoStack Overflow is a great place to practice writing short programs or even just code snippets. Just look for interesting problems and solve them.
- tcgv 6y agoI'm a frequent user of SO, but I find leetcode [1] much better when I just want to practice coding / problem solving. Their free account is more than enough to have some fun ;) [1] https://leetcode.com/ https://leetcode.com/
- thewebcount 6y agoI disagree. Leetcode and related sites have problem descriptions that are often vague or nonsensical. Just figuring out what the author is trying to say is more of a challenge than the actual program sometimes.
- RMPR 6y agoI feel exactly the same, I thought that it's because I'm not a native speaker, at least now I know that I'm not alone.
- pletnes 6y agoThere’s a few utility functions that come to mind. Git hooks, for example.
- thewebcount 6y agoI find myself writing debugging tools all the time. For example, our logs are overwhelming because our developers use them for debugging and then never remove their logging statements. So finding anything in them is next to impossible, and it's often interleaved with a bunch of other junk that's meaningless to you. And fixing the logging system we use would to make this work better would also be a huge task. So a little while ago we needed to log some info to figure out where 2 parallel sets of calculations were going wrong. So I wrote some logging that output the info to a file instead of the main log, and then wrote a simple parser to read them in and display them side-by-side in a nice hierarchical tree structure. It made something that normally takes us a week to work out only take a few hours. It's something we'll never ship to customers, but helps us enormously. I'm finding myself writing more and more stuff like that these days.
- stjohnswarts 6y agoYou might also try to get your QA process to require removal of debug print messages or at the very least an "off" flag as an environmental variable or config file element