I mean, that’s basically the option. Set up a domain, set up dynamic DNS, and safely do the right port forwarding and IP reservations in your router.
Unfortunately this is not easy for a lot of people, and the overall picture of home automation requires a combination of skills that not everyone has. Then they basically get two choices: pay for a company to maintain the system, or use someone else’s cloud. A lot of people will pick option 2.
Unlike a lot of DIY tasks, it’s not even one that I would suggest to someone who is hesitant. It’s not a “oh just try planting tomatoes this year, see how it turns out.” Someone who messes up their port forwarding rules could potentially open their home network to a lot of trouble.
If the method does a long thing, the keep it long. I do a lot of data analysis and simulation, and so often people who came before had this urge to shorten methods, so we get:
def do_calculation(N, X, y, z, a, b, c): # Setup stuff for i in range(N): calclation(X[i], y, z, a, b, c)`
Sometimes there’s a place for that, like if
calculation
could be swapped for a different function, or ifcalculation
is used all over the program. It’s a pretty good clue that something is up though when the signatures are almost identical. Of course, that has just led to people writing:def do_calculation(big_struct): read_data(big_struct) calculate(big_struct) write_data(big_struct)