If you're just trying to get it to work, taping off the switches is more sensible than ripping the switches out of the wall, then having to put everything back when you realize the system you chose had basic flaws.
The big problems with wiring a house for remotely-controlled switches are that 1) the wall switches may only have the hot wire go through the box, leaving you without a good way to power your "smart" switches other than ground leakage, and that 2) wires to the lamps and outlets are on the same branch, so you can't put the relays in a box next to the breakers, and the relays basically need to be put at or in the lamp itself, and any on/off smarts (occupancy detection and on/off schedules) need to also be at the relay.
Then you need some way to get a signal from the switch to the relay (assuming you don't do the old X-10 thing with the relay in the switch). Fortunately, wireless technology has significantly improved in the past decade or so.
But indeed, this "isn't for everyone".
This is a problem I see in the entire STEM field. You work on technology X for a while, you learn it inside and out, and you expect everyone else who is "qualified" knows what you know. You want to hire someone with no ramp, who is going to drop in on day 1 and start doing great stuff, just as soon as he sets a password to his laptop.
That's great, until you ask a question about second-year college stuff. Like "show me how to reverse a linked list", which is basic Data Structures class material, not the hard stuff. And then suddenly they get the deer-in-the-headlights look. Back around '04 or so, the group I was in interviewed some people, with the same interview style that I got hired with. All the Java-addled recent CS grads were useless. Only the EE grads actually knew how to program.
There should be only ONE return statement in a function
Um, yeah, I'm gonna have to put up a [CITATION NEEDED] here. Sure, that's a thing, but so is Systems Hungarian Notation.
minor change:
case 2: if (AcquireResource3()) ok = false; else DoStuffWithResources(); break;
int i;
bool ok = true;
for (i = 0; ok && i < 3; i++) {
; switch (i) {
; ; case 0: if (!AcquireResource1()) ok = false; break;
; ; case 1: if (AcquireResource2()) ok = false; break;
; ; case 2: if (AcquireResource3()) ok = false; break;
; }
; if (!ok) break;
}
switch(i) {
; case 3: Cleanup3();
; case 2: Cleanup2();
; case 1: Cleanup1();
}
Why yes, I read thedailywtf.com, why do you ask?
I think part of it was just the era, when FORTRAN still was a significant programming language. Its arithmetic IF was basically a triple GOTO statement, and you could literally go anywhere from it. Only being able to use numbers for labels, with no enforcement of numeric order, made it even worse.
As long as you make the effort to use the standard (and more readable) control structures where they apply, the really weird stuff like error abort stuff then can stand out by its use of goto. I still don't feel that it's significantly more readable to abuse stuff like do { } while(0) (other than in a #define macro to ensure statement atomicity) over a "goto abort".
20 layers of nested ifs is already a disaster.
The real fun comes when every one of those layers has an else block. So you end up with about 300 lines of code, then come up on a dozen else error("some message"); else error("another message"); else error("another twisty message all different"); else etc. To paraphrase the real estate agent's motto: locality, locality, locality!
And of course the legacy code that I had to work on did all of this in main(). He also had a fondness for putting assignments inside the if statements, like: if (retval = longnamefunction(parameter, anotherfunction(parm, pram), paremater, &pretamer) and they would go to about column 120 or so
Nope. 4 and 5 left index finger, 6 and 7 right index finger.
But just because a broken keyboard broke your typing doesn't mean you can't type well. My usage of the right shift key was broken by a few months in college of having to use a 1970's era IBM 327x terminal, where the right-shift location was either the "SEND" key or something else useless. (I really looked hard but could only find pictures of 327x keyboards with a proper right shift key.)
So now I always use the left shift, and to type an uppercase A, my left ring finger goes to the A key.
"The medium is the massage." -- Crazy Nigel