How do people that have been programming for some time ensure that they keep all the data & sketches etc where they can be found easily & nothing gets lost.
It may seem a silly question but I wish to get organised so I don't lose any more notes, data & programming.
I wasn't sure where to ask it.
If you feel this question should be addressed elsewhere than please tell me where I should post it.
I just want to get organised & not waste time & effort.
I haven't done anything much for a long time & I am going to do a concerted push this year so I will be spending quite a lot of time on this.
I am basically starting over from scratch & I realised that I will be repeating mistakes that I should have avoided.
Losing important "bits" can cost a lot of wasted time & if you don't save the workflow so that you can see what you did before then you can add up doing the same sort of troubleshooting over again - especially if you did it a long time ago.
I hoped that some experienced users may be able to give hints about how they save everything so that the material is easy to find & so that nothing is missed.
How do you save code that you have made incremental changes to, so that it remains in a single entity if you need to revise what you did later
where do you put all the support documentation that you make,
any naming convention system that you find helpful
... and what NOT to do.
A while ago I did up a major database for myself & later found my naming convention caused all sorts of problems & it all had to be scrapped. It was obvious in hind sight but really hurt to find it out the hard way.
That sort of practical info is often missing & if you watch experts in any field then often the casual way they work without wasting effort shows the major difference between the experienced long time user & the newbie.
Arduino programs are generally pretty small, so what I usually do is start with MyProg001 and increment the number as I go. I serial print the filename in Setup so I know what's loaded and "Save As" from the IDE means that the old versions live on in their own directory.
The number indicates a somewhat major revision, there may be an alphabetical suffix for minor changes, usually when debugging. The latest version of a long running project that's posted ad nauseum in a humungous thread here is apparently cnclathe012e. There are comments at the top detailing the revision history.
What I probably should do is use git or some other version control software and I certainly would if I were doing serious paid work rather than hobby projects. Also, that repository should be on another machine and backed up. Any support documentation (if I had any) would live in the same place.
Naming conventions are a personal preference - it doesn't much matter as long as it's consistent. Camel case seems popular here.
I keep 2 copies, a PDF in sketch folder so Zipped folders have docs
and a native word processing copy somewhere in \Documents\Arduino\WordProcessing
For archives, YYYYMMDD.zip
DO NOT FORGET THOSE DARN LIBRARIES THAT ADAFRUIT CHANGES NEARLY DAILY. Even if you do not subscribe to embedding your libraries into your sketch folder, make a snapshot of all used libraries at the time of your Zip archive!
As for what not to do, the most important thing I can think of is don't try to write the whole thing in one go.
You may even need some throwaway predecessor programs to prove that you can use a new piece of hardware or to test an algorithm. If you're careful, there may be code from these sketches that can be pasted into the final product. Make sure that they make it into git too.
The 001 version should do almost nothing. Test it and be sure that that "almost nothing" is what you expected. When it is, add a little functionality and save as 002. Test again. This process will save you pain and suffering and plaintive posts for help in the forums when you have a five hundred line program that "doesn't work".
Use Git. It doesn't matter whether you are doing paid work or hobby work. Just do it.
Although I don't recommend it to beginners since they have enough on their plates without learning Git as well, for anyone past the beginner stage who is doing anything more than the most basic of software development, it is very much worthwhile and you won't regret the time spent to learn it.
Put it in the repository along with the code. This way the documentation will always be in sync with the code.
You don't need to do any of that silly primitive version control through file names if you use Git.
Just make sure you are compliant with the Arduino sketch or library specification in your file names.
Thanks for the Tips.
Thanks for the extra warning about the libraries, I had thought of them but may have overlooked them later.
Feel free to offer any other wisdom later.
Thanks for the Tips.
I didn't know about Git but will look into that.
Feel free to offer any other wisdom later.
It is so often the case that someone later will say "you should have done XXX from the start."
I think that is especially pertinent when you are doing online DIY education.
It is likely that you may miss bits that are important.
I am doing some more formal training just for the important lecturer contact for that type of thing.
It is also so easy to get caught bashing your head at an issue that a more experienced person can see in one second flat but you were looking in all the wrong directions.