Well, I'm going to join Derakon (as someone currently more involved with software than plugs). I indeed set myself an achievable goal (say, implementing a feature or fix, even little, that I can see the effect of), I read all the documentation needed to do it (if necessary), I plan everything necessary to do so in my head (not necessarily when I'm in front of my computer, sometimes I think about programming when I'm cooking) in advance, and then when I can find a moment with enough consecutive hours of free time, I write everything for the feature in one fell swoop. I think it's important to get it in a working state (even barely working) so that you don't have to come back to it later and wonder where you left things. Planning is important, so that the actual time spent writing code (for the purpose of an individual feature/improvement) is short so that you don't spend too much time writing code for no visible result.
For instance, I recently implemented the possibility to stop and resume the rotation by clicking in RLEPlugin, but I couldn't use the same method I use in ViewRLE, so I made sure I read all the pertinent docs (namely, HIView and friends) and made sure I had a good idea of what I was actually going to do, before I wrote the actual code. It didn't work the first time, but after a bit of debugging, it worked. Now I can worry about colored background. Next I'll worry about allowing the color to be chosen by the user (and of course, I made sure I left the possibility for this to happen in the previous step, without actually implementing it, for instance by not hardcoding the color, but instead putting it as a global var that could change, only it never does and the default value keeps being used as long as the UI to change it isn't implemented).
Now, with actual programs there are some points you need to write a big bunch of code before seeing anything, in this case write a few of the little details of the big thing and look what they do, to have a feeling for it, only as tests, then implement the whole thing. Well, perhaps not in a single session if it's big, but in a few close enough consecutive sessions. Think of a visible goal as a save point in a game (say SketchFighter), if you don't reach it and quit the game, you'll pretty much have to do it all over again (as you will spend as much time reunderstanding what you wrote as you spent writing it in the first place). But if you can reach the point you have a visible result, first you'll know you've done something, second you can start from what you're seeing (if there are bugs in it, if it isn't complete, etc ). I'm blessed with the ability to write a big bunch of code for some time without even making any of it run, while still being able to keep focus and not being discouraged as I'm not even building anything, and have it work right the first time, but not everyone can do that.
On important thing is, once you have something that's visible, check that it works as intended, make a few general checks that there is no problem with it (write it down if there is any), and now you can go to bed at 2 AM with a feeling of accomplishment: you've validated this, it's one less thing to worry about. It's important to do this just after you've wrote it, otherwise it's just an invitation to have it explode in your face later when you least expect it.
In fact, most of this advice has been influenced by this piece (though it is more meant to encourage to write clean code than prevent being discouraged, which is not really our point here since in plugs there is pretty much one way to do something and it's not going to be more or less of a maintenance mess, though sometimes I guess people can paint themselves in corners with NCBs; also, I'm not that much of a "hammer down everything to make it to break, and only stop when you can't" philosophy), though some of it I observed already before reading that.
Some of that can be applied to plug deving as well, though it's still not at all like programming from a technical standpoint.
Now, all of that begs the following question: when to work on something? It's important since none of us, I think, is independantly wealthy, we all have works or school or university to worry about, and of course none of us is actually living off doing plug-ins (or even software, AFAIK, at least the software we're talking about; jeff is no longer here to contradict me ;)). I've observed that it's no use to try and work on something serious if you only have, say, half an hour, by the time you're actually doing something it's already over. Use these short pieces of available time to write out ideas you may have though about that day, do some light stuff, or even do stuff unrelated to your project like doing your homework in advance or things like that. The objective is to set aside clumps of time (say, a few hours, like an afternoon or an entire evening if you can go to bed late) and do what you planned at that moment. And don't worry that the time you've set aside could be too long for what you've planned, if you complete the planned task in the timeframe you can then start the following task you've planned, it's even better as you're already hot.
This post has been edited by Zacha Pedro : 19 March 2007 - 04:33 PM