A non lazy programmer shouldn't subtract two timestamps from each other to get a duration but uses a (self written) function that can handle overflows.
I am not sure who you are even talking to. My response was in response to a smart ass comment made by a user named fisted, where he basically said that someone was a moron for suggesting counters that will run for orders of magnitude longer (ie. tens of thousands of millennia) are a pretty OK idea.
Nobody mentioned calculating duration besides you (in a perfectly sensible way, I might add). This is a smart answer to the question that it is an answer to, but a really kind of silly answer to a question that it is not an answer to.
And you have to adjust a lot of variables to become long. All temp vars that hold a timestamp. If you miss a single one, your screwed.
Yes, the program would have to be implemented without error, to not have an error... that is a tautology. Pragmatically, use a statically typed language, and do not change anything, use the correct type while implementing the program the first time.
What would a non-lazy programmer use instead? An arbitrary precision int or something? Can you think of any downsides to that approach?
63 bits for a nanosecond counter gives 292 years.
My post was not about nanoseconds, it was about milliseconds.
If you did the math, you don't need excess space. If you need excess space, you're just shifting the day of failure into the future. Yes, perhaps far enough, but still.
What math would you do to determine exactly how high a counter should count?
Would using a 64-bit long on a millisecond counter be lazy programming?
the 0.0001% of Nerd Customers ought not to stand for inability to run servers.
FTFY. For those 0.0001%, there is AWS.
Wah wah, for some reason it needs to run on under powered hardware in an uncontrolled environment over an asymmetrical residential connection, because, for reasons!
Water ain't free, and Cali farmers think it should be.
There's your problem.
There is something that we agree upon vigorously. Not letting all users of water bid on available water is a subsidy.
I was reading interesting stuff about using forward osmosis to recover energy from desalination effluent, or even as a pre-treatment step before final desalination.
Yes, but there are different types of desalination plants. Modern tech has hybrid micropore with solar/wind assist for pumping, and uses the old technique of glass windows to collect clean water. Do a search for solar desalination in any reputable energy journal.
Note that I said energy, to which you responded with several sources of alternative energy that might be employed. At the end of the day, the hypothetical pipeline might be driven by wind or solar energy as well. The wind or solar energy generated at the desalination plant could alternatively be sold, and so has monetary value that must be used to desalinate water.
An authority is a person who can tell you more about something than you really care to know.