We got it shortly after it was released and have been happy with it since whatever Leopard and firmware update it was that made backups work reliably. It probably won’t.Īt home we have a Time Capsule for our laptops (and a mac mini) to automatically backup a few times a day. Take a month away from a bit of code and then come back and see if it still makes sense. At the time I’m sure it seemed cleaner to keep the two data structures separate but now a month later it makes no sense - how can I, easily, know if the data I need is $video_info data or $meta data? In my infinite wisdom I had separated out the data from the “detect video meta data” and “other data we’re calculating in this code”, so the former is stored in $video_info and the latter in $meta. A common mistake then is to do something like for my $loc ($foo->location_widgets), right? In the YellowBot code most of our data revolves around “locations”, so we have a lot of location this and location that. The obvious mistake is to call some important variable x, obj or data. One of the easiest mistakes to make is poor naming of a variable. All you need is a break from the code and then coming back to it a few weeks or months later (or days if your memory is more like mine). Mistakes that makes the code hard to understand on the other hand can show up very quickly. Problems that makes it hard to expand the code can be hidden the same way most expansions are really just a bunch of small changes and until some fundamental change (“now also do it in Chinese”, “do 10 times more requests”, “support multiple currencies”, “now with 2 terabyte data, please”) the technical debt won’t completely stop you. You can always squeeze something in to change “just one more thing”. Mistakes (or bad planning or bad luck) that leads to problems changing the application often take a long time to really show up. The future maintainer (often a slightly older version of yourself) needs to: The other side of it is writing the instructions so future maintainers can work with the code without making too many mistakes. Put simply programming is writing instructions for the computer on what to do. If you can do the ‘is it good or bad’ test automatically, you can run ‘git bisect run command’ (where command is make, prove t/sometest.t or a custom shell script) and git will figure it out automatically while you get coffee or go to lunch! When you know if this revision has the bug or not, you run git bisect bad if it’s bad and git bisect good if things are good and after a little while of that git will tell you which commit introduced the bug! In our web environment that’d often involve restarting the application (just to make sure) and then running the tests. If you are just testing manually, you’ll now manually run your tests and tell git if it’s good or bad. Git will now decide on a commit you should test, check it out and tell you how many are left. Now you need to tell it which commit/version is the latest “good one” - often that’d be the last released tag, so for example git bisect good v25.0.3. Since the current version is bad, you run git bisect bad to let git know. ![]() What to do, what to do? Use git bisect to minimize or completely automate finding the commit that broke it! You use git log -p to thrawl through the recent changes, but nothing stands out. ![]() ![]() Nobody has any idea which change broke it. Something in your application worked a few days ago, and now it doesn’t.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |