9 ms·
Log driven programming (2013)
- barrkel 8y agoThis is my workflow and has been for the past 10 years or so. Whenever you think of something else that needs doing, write it down so you stop feeling the need to keep it in mind.
- keyle 8y agoExcellent; but does it ever get done?
- TeMPOraL 8y agoYes. In particular, if you use the same place to note down things you want to do in the first place. Then it boils down to continuously reviewing the list and picking the next thing to work on.
- mercer 8y agoThis is a reason why I generally avoid using TODO/FIXME type comments in my code. I'm much more likely to forget about them, whereas I always need to look at my org-mode project file to see what I need to do. So that's where I put them.
- Fellshard 8y agoOstensibly, this is what TODO comments have always been for. Realistically, I guess it's probably better that these types of comments remain out of the code itself unless you and your team can practice proper rigor around them, e.g. using prehooks to enforce that no TODOs are left around before committing or merging.
- coldtea 8y ago>I guess it's probably better that these types of comments remain out of the code itself unless you and your team can practice proper rigor around them, e.g. using prehooks to enforce that no TODOs are left around before committing or merging. Why? If they're "out of the code" they still can be ignored before committing or merging just as well...
- mercer 8y agoThat's a silly statement. Yes, they can be ignored, but perhaps for many people they're less likely to be. That's my experience, anyways. I could train myself to regularly grep for TODO comments, and perhaps I will, but so far adding them to my actual 'todo app' is much more effective.
- Fellshard 8y agoI'm more likely to write a stub implementation around more complex behaviour that still functions in a minor way first, especially if I want to observe that some component functions even in absence of a complete implementation of another component.
- chucksmash 8y agoMy personal layers of organization: Stubs with TODOs for staking out an interface to be implemented later and the like. Almost always doing "git add -p" is a good way to jog your memory about these. They can be committed but probably shouldn't survive until a merge into master. A todo file entry for items which are heftier and/or not likely to be returned to today. My todo files are date-based so I try not to add todos for items with a time horizon beyond about three days in the future. I also try to keep these files small enough to actually get through in a day. A single wish list/ideas file. Keep it in approximately priority order and pull items from the top when you finish your daily todos. This is also often feature-based so a single line might generate a bunch of tasks. Biased towards a personal backlog instead of "just add to JIRA/Trello/whatever" to avoid eternal agile deprioritization hell. Works fine for me, though of course I'm not out here writing Redis either.
- thecatspaw 8y agopersonally I just write the function call, wait for my IDE to complain that the function doesnt exist, press command enter to have it generated with a throw new NotImplementedException(). works well for me, gives me the illusion of a working api, and I get autocompletion. This requires you to give your functions well thought out names though
- DanielBMarkham 8y agoI use postits for this. I used to use TODOs, but then if I wasn't looking at the code I forgot about it, and a lot of the stuff didn't have a spot it needed to go. It was just stuff I thought about while I was doing something else. Daily (or twice daily) I reorder and prioritize. Every week or two there's a postit cleanup party where old postits get trashed or logged. A lot of the stuff that I trash isn't bad....it's just not in scope for the stuff I'm currently doing. ADD: One of the beauties of postits on my monitors is that when my mind wanders -- as it tends to do -- I'm naturally looking at other stuff I should be thinking about. So when I postit stuff and put it somewhere in my field of vision, I'm telling my subconscious to start working on what I want to do with this stuff.
- aeosynth 8y agohttps://orgmode.org/manual/Capture-_002d-Refile-_002d-Archive.html#Capture-_002d-Refile-_002d-Archive https://orgmode.org/manual/Capture-_002d-Refile-_002d-Archiv... > An important part of any organization system is the ability to quickly capture new ideas and tasks, and to associate reference material with them. Org does this using a process called capture.
- bpizzi 8y agoThis, and it's something baked into Spacemacs (easy to replicate with a vanilla Emacs, thought): working within a projectile-initialized folder, hitting <leader>po will open a TODO.org at the root folder of your project, where you can write anything you want (including inserting an Org-mode link to the file/line you were editing), and save/switch back to your file in a handful of keystrokes. Downside: you end up with too much notes.
- mosselman 8y agoHow is something as frivolous as taking notes while programming, which many people do, worth a blog post and a mention here on HN? Let alone turning it into some dogmatic principle to work by, by calling it 'log driven' programming. What is next? Keyboard driven programming? 3-monitor-driven programming? I do this: While programming it pays off to stop and think about the code. I call this, thought driven programming.
- jacobush 8y ago"Common sense is not so common." - Voltaire
- DanielBMarkham 8y agoYep. One of the (painful) things I learned and continue to learn once I got into tech coaching is how much stuff we do without thinking about it. It gets into muscle memory and it's gone, as it should be. This is one of the reasons mobbing is so successful -- and why it doesn't make a lick of sense to anybody who codes for a living. So no, there's no level of detail here that I think would be too much. (It may or may not belong on HN, and there's a question around how to organize this detail so that it's useful for folks, but those are different questions from whether or not it has value)
- swah 8y agoYep. I like books like this https://www.amazon.com/Effective-Engineer-Engineering-Disproportionate-Meaningful/dp/B01N4HXVWH https://www.amazon.com/Effective-Engineer-Engineering-Dispro... for this reason. 1-star commenters will say they learned nothing new, while 5-star commenters will be happy they found knowledge from experience enginners in (kinda compact) book form...
- DanielBMarkham 8y ago(I swear I'm not trying to plug anything) It's weird. I did a blog series "Program F# like a stupid person". My point was 1) everybody makes mistakes, and 2) with the right attitude, you can plow through and make really cool complex solutions for folks. You just have to stick with it. I don't think it was very popular. For the internet crowd, who only only have ten seconds to skim the material, "Program F# like a stupid person" became "Stupid person programming F#". It was just far, far too easy not to grok it. There are those 1-star folks. A few did. Maybe 10%? Out of maybe 300 readers I got 6 or 7 people who absolutely loved it. 50 or 60 got it but didn't need it, and the vast majority didn't like it. They thought it was a Bad. Thing. They wanted tech porn. "New cloud-based logging app processes 14 Trillion records per nanosecond! Now with graphs!". That's their kind of story, whether or not they're processing one record per hour or not. It just feels cool. I get it. I would love to find a way to cut through that noise and help people. I've thought about twitch, but that almost seems too unstructured. There's a way of organizing and presenting this material that I haven't mastered yet. It'll be fun to figure out.
- deleted 8y ago[deleted]
- keyle 8y agoYep, a notepad with a direct step by step 1 liners is very effective to get a ton done in one day. Have it between you and the keyboard so it can't be ignored, presumably not ruining your typing experience. Straight up notepad or sublime works too.
- cyborgx7 8y agoHad the same idea as I noticed that working in a nested way slowed me down a lot. Been trying to do this but I often lack the discipline to actually work this way and not dive into the local improvement I just thought of.
- keithnoizu 8y agoI usually just make the additional changes but I'm pretty good at keeping pretty massive mental models in place while I do so with out interrupting my work flow. If it's something truly massive i add a @TODO ... @PRI-N line in the comments.
- skohan 8y agoI wrote a simple app for myself for this: it's basically a text editor with included checklist UI, optimized for a keyboard based workflow. I find it very useful to have a "conversation" with my notes while I'm developing to avoid going down too many rabbit-holes, and to keep focus on the primary task.
- raytracer 8y agoA couple of years ago I started using TODO:HIGH, TODO:MED and TODO:LOW. TODO:HIGH is for things that need to be completed for the current feature or bug fix. TODO:MED is for things that should be completed before the next public build. TODO:LOW is for stuff that would be good to get done eventually. (A function is complete but doesn't read well so I'll add a note to refactor it at later date.) When writing new code I try to get something up and running ASAP by filling in functionality with broad strokes. I'll go back and fill in the details once the larger picture is in place. With less code written, it's easier to refactor (or restart), if the design is not quite right. Writing lots of TODOs helps ensure nothing gets forgotten about. Picking an easy TODO from the backlog can be good way to warm up when starting the day too. I'm used to working solo however. Not sure how this approach would go down on a team.
- suprfnk 8y agoExactly. I don't see why you would do this in another application. Doing it in another application means you also have to take note of _where_ the piece of your TODO is. That means filename and line number? While I don't use priorities, I do liberally use "// TODO: <problem statement>" if it's something I need to do that takes me out of the current problem. Then when I'm finishing up a feature or bug fix, I just walk past the list of TODO's. A recent example would be: On this new project I was on, while implementing a feature, I didn't know how resource files were handled yet -- so I hardcoded some strings with a "// TODO: Put these strings in resource files". Researching the way resource files are handled will pull you out of the current problem, while it's something that can easily be solved later.
- qubax 8y agoThat's what I do as well. Also, in OO languages like Java or C#, you can throw "NotImplemented" style exceptions. So that if you mistakenly wrote "TO DO" instead of "TODO" and can't find it statically, the runtime will let you know.
- flukus 8y agoI create stories in JIRA. It's a lot more effort but the defects are at least visible to management and actually stand a chance of getting scheduled. You can also include a lot more context than you can in a comment.
- hyperman1 8y agoI use TODO and FIXME for this. This way, it's directly anchored to the relevant code. Both the IDE and the build server produce a list when asked. Every project has a readme attached for bigger notes
- Dowwie 8y agoFor those unaware, the author of this article (Salvatore Sanfilippo) is a prolific programmer and leader in open source. He's been very productive in this role, authoring systems that many use today, such as Redis. Obviously, Salvatore didn't invent a new creative workflow that he's branded "log driven programming". His intent with this article more likely was to share with others how he works productively. I can imagine that people asked him how he gets so much work done, considering how complex programming is, especially low level systems programming in C. While the article was written in 2013, it shares timeless advice.
- basicplus2 8y agoSliderule
- bzalasky 8y agoThis is essentially the process that Things 3 (I’m not affiliated in any way) for MacOS/iOS uses. It separates adding new tasks (for your inbox) from the step of organizing and scheduling them. So if you think of something you need to do, you can use a keyboard shortcut to pull up a prompt quick add it (from whatever app you’re using) and carry on with whatever else you’re working on.
- bvinc 8y agoI find it best to put a TODO file in the project that I'm working on. Sometimes I commit it, sometimes I hide it from git. I think it's a big advantage to have it all in one place, not very far from the code, and it won't get lost. TODOs in comments end up getting forgotten about. Bug ticketing systems are too much work for the kind of notes I write to myself. I've tried using paper, but as I turn pages, notes on previous pages get lost forever. Staying in the text editor helps me not lose my flow.
- jolmg 8y ago> For my log I use Evernote because the log needs to have one characteristic: No save, No filenames, Nothing more than typing something. I got emacs configured with a keybinding to open org files by date name (e.g. 2018-10-08.org), with the current date selected by default, creating them if they don't exist. I use `(org-read-date)` so I can, for example, get yesterday's notes with syntax like "-1d" or select it from a 3 month calendar. It frees me from having to think of a name for the notes I want to take and simply make a log of notes. It also autosaves. (defun find-diary-file () (interactive) (find-file (concat "~/org/diary/" (org-read-date) ".org"))) (global-set-key (kbd "C-c d") 'find-diary-file)