You can use code whatever you want, whenever you want. Programmers often joke that they’ll take 20 hours to code something that would have taken them only 20 minutes to do. Imagine the person who programmed the robot vacuum.
Does it make sense, timewise?
Personally, I’d count how often I do it, estimate how long it would take to automate or code the thing, then see if the hours programming is going to be worth the effort. For example, if it takes 10 minutes to do dishes and you have to do it every day that would be 3650 hours per year. Would 100s of hours of programming be worth coaxing a computer to do dishes for you?
Xkcd.com made this chart to show how much time is saved by automating something. Let’s look at making an automatic cat snack dispenser. Let’s say it takes 5 seconds to open a bag of treats and give them to the cat. We’ll also say you give the cat some snacks 1 time per week. The snack dispenser would cut 5 seconds from your snack process because you don’t have to do it anymore. This chart shows that over 5 years, our cat snack dispenser would only save 2 hours. Is it worth it? That’s up to you. It probably depends on how long it would take to code the snack dispenser and how demanding your cat is.
Going back to the dishes example, after programming a computer to do dishes, it now only takes 5 minutes. So, 5 minutes have been shaved off of the time it takes to do the daily task. This would save 6 days over 5 years. Is it worth it? That’s up to you. Though, it may depend on how long it takes to code this automatic dish washing machine.
Typically, when the gain from your code is more than your loss, get to coding.
An exception to the rule
When we are learning, this may be a little different. You’re also gaining a better understanding of code every time you use code to do something. In this case, you would gain the benefit of the code and the knowledge on how to do the things you learned to build that code. So, it may very well be worth building that automatic cat snack dispenser even if it doesn’t fit my gain > loss
rule. The cat would really appreciate it.
Wait! I just want to make pretty things
That's cool too. Please ignore the above rule and have fun! Art can be made with lots of mediums (eg paint, metal, pencil) and that definitely includes code. Head over to your favorite search engine and look up generative art
. There are lots of cool things you can make.
Top comments (2)
Programs also don't have to solve problems, or automate anything. Use code because you want to. Make art with it. Make pointless toys. Just enjoy it
Very very good point! You can definitely code for fun. Not everything needs to be productive and make sense. I'm gonna fix this post to include that. Thanks!