immibis

immibis t1_iyam8iu wrote

It's easier to understand something when all the pieces are next to each other in a straight line. You tell the computer to do this, then this, then all of these, then frobnicate the widgets, then pass the salt. When you see a loop, you know the computer is going to repeat what's in the loop a certain number of times, then do the stuff after the loop.

"goto" lets you tangle up the pieces as much as you like. The problem is not the word "goto" itself, but it is the fact that if you didn't create a tangled mess then you'd be able to write it without the word "goto". An otherwise straightforward program with one or two "goto"s is often still understandable, but when you have many of them, it can be hard to understand exactly what the program is doing, e.g. you might not even be able to work out how many times a certain line of code gets run.

Note that when Edgar Dijkstra wrote his famous letter "Go To Statement Considered Harmful" in 1968, structured programming with instructions like "if" and "while" were somewhat new and people weren't using them as much as they could have.

Ironically, many programmers write the exact same kind of mess with classes and methods, and think it's good because there's not a single "goto".

1

immibis t1_ito2dfn wrote

(I do not work in the power industry but) the lines wouldn't burn up, as they have fuses for the worst-case scenario. In the worst-case scenario, power lines wouldn't burn up but they would still have to drive around and replace all the fuses.

As I understand it, the real problem in a major event is that all the safety systems trip. You get these cascading failures where the computer at each power plant and substation is like "oh fuck, something's really wrong, fuck it, I'm out" and then disconnects whatever section it's responsible for. No actual damage (that's the point of the safety systems), but everything is shut down and disconnected.

E.g. https://en.wikipedia.org/wiki/Northeast_blackout_of_2003#Sequence_of_events - according to this list, you had a few individual things disconnecting themselves and the rest of the grid took up the slack, but then within a few hours it got to a point where there wasn't any slack left and then you get this big cascade where everything that trips due to overloading causes something else to overload, and it just spirals until everything is disconnected. I assume the "heroism" at your company is related to the fact this didn't happen in Texas, so whoever still had power lines could still get power.

And then they have to figure out how to restart the whole grid from zero without tripping all the safety systems again. Did you know that most power plants need electricity to start up, which apparently makes it quite an ordeal? https://en.wikipedia.org/wiki/Black_start

> To provide a black start, some power stations have small on-site diesel generators, ..., which can be used to start larger generators..., which in turn can be used to start the main power station generators

Fun fact: high voltage fuses have explosives in them to make sure they disconnect properly, as high voltage can jump through air if the gap isn't wide enough.

32

immibis t1_ito247y wrote

Both power spikes and brownouts should causes systems to automatically "trip" offline. Power plants and substations have sensors to detect if the voltage, frequency, or current is out of spec - and shut themselves down, or at least disconnect themselves from the grid. Maybe some areas would happen to be in balance with their local power plants for a little while and would stay running.

3