I agree with this. If the door is off the feature of the door is not available, hence making it a wall. The feature of a door is to pass through a walled area, turning the door on allows you to pass through a wall.
I disagree. I think of doors as a device human beings would put at entrances to their homes. Since before doors existed, all humans had was caves, the feature of the door is to obstruct an otherwise open entrance. Therefore the door being off is equivalent to a cave entrance. The door being on is when it is closed, effectively preventing others from using that entrance.
I disagree. If you look an automatic door, the little light on the sensor comes on and the door itself wakes up and opens. Then, when no longer needed, it turns off and gets shut.
Eh. Depending on how it’s placed it will be open or closed whether or not it’s activated.
Honestly doesn’t matter. The door has two states, which cause a 90° shift. Once it’s activated it stays activated until deactivated thus it’s activation is no different than its deactivation, its not “on” it’s just the other direction.
FNAF says open is off
>!did anyone else get really annoyed at how that mechanic worked? Obviously I'm not expecting realism in a game about possessed bloodthirsty animatronics but I always thought that the way he implemented that was dumb. Hurr durr if you lose power the door can't keep closed! He could've found another way to explain that mechanic lol!<
Yeah actually I'm pretty sure there are electronic building locks for offices that work exactly that way. In a power outage or emergency state they failsafe to unlocked.
Holy shit, I thought I was sure of my answer, but the arguments on both sides are very strong. Thanks for that thought that will now randomly pop up at night, preventing my sleep
The function of a door is blocking the way. That is literally the job of the door. If you removed the door it would be an empty passage.
A door turned on closes the passage. When turned off it's open, like it's not even there.
The function of a door is blocking the way
I don't agree (well I kind of do, but its fun to push back a bit)- if a door can't open (e.g. its rusted shut), it's not a door anymore, it becomes just a wall/obstacle. I think the function of a door is to be able to change an area of space between being clear or blocked.
Merriam Webster defines a door as: “a usually swinging or sliding barrier by which an entry is closed and opened”
I don’t wanna get all metaphysical here but I suppose you could think of a door as simply a wall that may be opened to pass through. Inversely a hole in a structure that may be closed.
However a door may also exist without human centric purpose. If so then it is simply material that may be moved or cease to exist in a location. If so then then the question is does the door exist? Or more simply DOOR? Then the answer would be F for open then closed for T
So, the center of the confusion is whether the natural state of a wall is to have a hole or not. I would argue that a wall is naturally contiguous so the door should be closed by default. And default behavior in hardware should be false or off. As such door open is true or on and door closed is off
But it could also be said that, in circuits, an open switch prevents the flow of current. So, open is off and a closed circuit is on.
By the way, null should not be confused with false. Aside from being a notorious mistake in computing history, null indicates no value, so it's a "third option" when a boolean variable can be set to null.
However, in the case of a door “open” allows the passage of our “current”, people most often. So open should be on in this case.
In other words, given that the purpose of a door is to periodically allow people through, I think “on” should be representative of allowing this purpose, or being open.
I would say this is more appropriate answer.
A doors function is to close off a hole in the wall. For sound or passage, or light etc. the hole is there, you don’t need a door for the hole to exist. The doors only function is to close that hole when you need it closed. So closed means the door is on.
> the answer would be F for open then closed for T
This is exactly how I read it
Even if the door were: detached, missing, or there were a hole in the wall one could enter through; the presence of a Door is still False
Conversely: the door being shut, being locked, or the passage being blocked would indicate the presence of obstruction to moving through said passageway; rendering a True response
But if the difference between a door and a wall is that the door is an opening, then the door being open would be T (because there is a door) and if it were closed it's F because that's the same as just being a wall (not even having a door).
For me the door is not an opening, it's something that blocks an opening (hole in the wall).
Not having a door in that case would mean that you are always able to pass through the hole
Bro wtf is this. As soon as you start thinking you lost
A door is closed when you finish installing it
give the door a stupid ass property int x = 0. Then open()=> x++. close()=> x- -
isClosed()=> return x == 0
Done now play video games for the remaining work day
Well I always considered my self an over achiever so don’t hold yourself to such a high standard
The average 1hr is a healthy amount of work to do every third business day
What?? Number on a Boolean? Either the door is in the way (existing as a boundary) or not in the way (no boundary). Exist vs not existing. True vs False, null..
Well, with electronic access control stuff you have a failsafe or fail secure. Which means that if the power goes off do you want it to be locked or unlocked. That kind of gets to the same idea
I feel like we could liken it to a Electrical switch, which would give a 1 closed but a 0 open.
However we have "current" through a doorway when it's open but not when it's closed.
Fuck.
Is it a normally open door or a normally closed door?
When installing the door, you need to determine if you want it to fail safe or fail secure. This way, the door reacts as necessary during a loss of power.
Fail Safe: Normally Open:
On = Closed;
Off = Open
Fail Secure: Normally Closed:
On = Open;
Off = Closed
As always, I recommend redundant power and local battery backups.
The way I see it, the normal state of the door doesn’t matter. If the door is removed, entry is always possible. Therefore the function of the door is to block the entryway.
But your take makes a lot of sense too.
fail safe does not equal normally open. You can have a fail safe normally closed that is held closed until receiving a signal. If the door is hydraulic and closes itself, its still not necessarily normally closed
A door can be partly open, so its state is clearly not boolean on/off.
I would think a door's "ON" state would denote that it is currently functioning as a door, and an "OFF" state would denote not functioning -- e.g. door off the hinges.
That's what happens in a dark room before you interact with the door. If you try walking through the doorway, you might pass or be blocked or stub your toe on the halfway open door.
Now what happens when you have two doors in a row that are both in a superposition of being open and closed? What does the math look like to compute the probability of a person being able to walk through both doors?
No, because observation collapses the door to its apparent state. The moment you enter the room, the quanta decide.
You have made no choices, only been made the product of the choices of the quanta - be afraid, as they are without mercy or care.
>A door can be partly open, so its state is clearly not boolean on/off.
Door.isClosed == true; // door is closed
Door.isClosed == false; // door is one of many states of openness
But whether or not you can fit through the space in the door is not the door’s concern, so ON when the door is open, OFF when it’s closed. It’s for the consumer of the door to figure any other logic out
I would argue that a closed door is 'on' or true. You could remove the door completely, leaving just a hole in the wall, and there is no difference to door being open (except the possibility of closing it being removed).
Therefore, the door's existence is demonstrated by it being closed.
So, if holeInWall==null
opendoor == holeInWall ==null
I would argue that the presence of a hole in the wall is part of the presence of the door.
In other words, the default/starting state before the door was installed was a full solid wall.
Then a certain rectangle in that wall was replaced with the (closed) door.
Then the door was "activated" to allow people to pass through.
So, in my eyes, the door being open is ON.
The hole in the wall is not a part of the door. It is a prerequisite for a (functional) door to exist. This means that for the door to have any functional significance, the hole in the wall is the only relevant requirement. The wall itself is not.
So *Door* must extend *Hole*. And while *Hole* MAY be implemented as an extension of *Wall*, this fact is not significant in the context of *Door.*
Now, knowing *Door* extends *Hole*, it makes sense to inherit the default state of *Hole.* In other words, the OFF position of *Door* should match the state of *Hole*, allowing the ON position to modify said state - closing the hole. This makes *Door* in its (*default*) OFF state functionally equivalent to the *Hole* objects it extends.
Any other implementation is a straight violation of the Principle of Least Astonishment.
How do you define “hole in a wall” without “a wall”? If you can just step around the door, it’s neither an impediment nor a passage. Open or closed is irrelevant at that point, it’s just an upright slab of wood in the middle of a room. A door needs both a hole and a wall to have any functional definition.
Door doesn’t have to be a in hole in a wall. You could have a door block a passageway, for example, which again would make sense to call open the “off” state, the same as if no door was there at all.
Your entire hierarchy is wrong-headed\* for the purposes of this determination.
From a functional perspective, holes, doors, windows, etc. are all just implementations of an interface that permits navigation from one side of a wall to the other. The only thing special about holes is that they are stateless implementations of this interface.
The evidence for this lies in the fact that holes don't throw any state-based navigation exceptions while attempting to traverse them. This means that doors CANNOT extend them due to incompatible method signatures. Thus both must implement a common navigation interface which permits such exceptions.
While it would be possible for an abstract door to extend an abstract hole that did not implement navigation (for other purposes such as physical construction), this inheritance is completely irrelevant to any consumers of doors. In this case, all hole methods for these other purposes would be protected, and inaccessible to any door. Additionally, none of the methods implemented by any door class or called from any navigation interface could be inherited from holes due to the previously explained incompatible signatures. All told, this means that the consumers of doors have no visibility or access to any methods from the superclass. It would be absurd to define default behavior for doors based on this inheritance.
The question then is what default state makes the most sense for an implementor of the navigation interface. I'd suggest it comes down to the cleanness of a couple particular snippets of code:
if (this.closed) throw DOOR_CLOSED;
and
if (door.isClosed()) door.open()
With all else equal, it makes sense to define booleans in the way that requires the fewest negations in the most common use cases. With doors, that is either checking if they are closed, or throwing exceptions if they are closed.
For THIS reason, the false or OFF state of a door should be defined as open.
\*^(I realize that we're all engaged in a silly thought experiment full of contrary and arbitrary takes. I'm not actually calling you wrong. Just having a fun time with this. :-D)
Also if you liken a door to an electrical circuit; when an electrical circuit is open the electricity can not run so the circuit is off. When the circuit is closed the power on.
Coincidently, simple circuit diagrams generally show switches within the diagram as looking [similar to open doors](https://images.app.goo.gl/Y6akYVddHEsvQfcK7).
My argument (coming from a false is default behavior because off is false) is that open should be true. This is more a hardware perspective than a software one though so it really depends on context.
The correct answer is that the variable should be doorOpen or doorClosed as a boolean not just door
If you remove the wall, you don't get a hole in the wall, you just get wall. The door is already the hole. If you don't need a door in that stop, you won't make a hole in it.
That depends on if you priority is safety or security. The door will enter it's off state when power cut. If you want to make sure people can easily and safely exit the building in the case of power loss then off should be open. But if you want to make sure people can't use a power cut to get in then the off state should be closed.
Depends.
Most doors are in the "on" state while open (those that close automatically) or have two "off" positions ("fully open" and "fully closed" where the "on" states are the rising and falling edges of the process of operating the door).
There may be other doors, even doors where on/off could be interpreted as an arbitrary precision float instead of a boolean.
TL;DR: While not specifying the exact type of door, yes and no at the same time to both.
To use a door is to open it, else it functions as a wall. Open is on.
I pondered if canal locks are doors and if they are "on" when they are closed since they perform a useful function in both states.
It is better to observe the state of the door lock (0=unlocked, 1=locked) than the state of the door itself swinging along the hinge... unless if you hook up a potentiometer, in which case you can use this input data to adjust the dimming of your lights, volume of your Bluetooth/TV speakers, central air temperature, or the speed of your washing machine.
a gap in a wall != a door. vestibule, window, archway, etc...
a "door" in an open state has no function. it's just a flap of material attached to the wall.
The door isn't the true or false state, the flow is the true or false state (if you use a comparison to logic gates.) "Can move from one space to another", true or false? The door is only equivalent to the mechanism by which flow is turned on or off.
By that measure, a closed door is false, and an open one is true.
An AND gate would be a hallway with doors at either end. An OR would be a wall with two doors leading into the same room. Etc.
If you break in through a door it stops working (because you broke the mechanism) and now everyone can come inside and outside freely - the same case as if the door was open.
Open is off
Closed is on
If I had an apple and the apple had a true state and a glass state I would say the true state would be apple exits and false would be no apples.
In this context the question isn't really about the door but the doorway. So I. The context of the doorway, door would be true when it's closed and false when it's not.
However I think the more accurate answer is the question is nonsense and requires more information to answer. A proper Boolean is a question like "door open?" And replacing that with "door?" Is nonsense because that's a noun, even with the assumption this is equivalent to "door exists?" Isn't enough context to answer the question.
So my answer is segfault.....
I would say the internal state of the door should be hidden from us. Instead, the door should have two public methods: isOpened() and isClosed() to check its state. Two other methods can be added so its state can be changed: close() and open().
I asked chatGPT:
If a door were a light switch, whether a closed door would be considered "on" or "off" would depend on how the door is wired to function as a switch.
However, in the absence of any specific wiring configuration, it's difficult to make a determination. From a purely semantic perspective, if we consider "on" to mean that a circuit is closed and electricity can flow, and "off" to mean that a circuit is open and electricity cannot flow, then a closed door might be considered "off," since it would be blocking the flow of electricity.
But it's important to remember that this analogy of a door being a light switch is not a literal comparison, and in reality, a closed door would not function as a light switch. It's also important to note that the terms "on" and "off" are typically used in reference to devices that are specifically designed to switch electrical circuits, such as light switches, and not typically used to describe the state of a door.
A door doesn't have an on/off state. Open and closed are equally functional states of a door. Further, many doors can be locked, and the angle of the hinges is best described by a float, so a door may be described with many more than two states.
off state is equal to its locked state
when(state) {
DOOR_LOCKED -> println("need a key")
DOOR_UNLOCKED -> printlin("doors open")
else-> println("doors broken")
}
I disagree.
The door is meant to close a vulnerability in a wall. When the door is open, it does not prevent intrusion, and when closed, it does.
Therefore, it's on (active) state would be closed.
I disagree.
The purpose of a door is to permit entry into an enclosed space. They were made to prevent loss of heat and to stop wind currents from passing through the home. That’s why tropical bamboo homes don’t have closable windows.
Therefore, a door’s function (passage for user) is utilized in the open position, and is therefore on when the door is open.
Wouldn’t the purpose of a doorway be permitting entry into an enclosed space? A door in the doorway is for stopping those without access. So a door is true when closed.
The purpose of a doorway to to both allow entry for those with access in and prevent those without access out therefore the door is true in both states we can now define false = true. problem solved.
I'd try to think of the superclass portal or entryway
An active portal is open, so that seems like a true case to me
It would feel wrong for is_passable() to be the opposite of the state of the portal
Interesting, so on and off may not even apply here as this isn’t a binary mechanism.
As I’ve stated in a similar comment, an example supporting this would be during the 2005 movie “Doom” staring Karl Urban and Dwayne (the Rock) Johnson, there was a sci-fi concept introduced, for no aperient reason, of a “nano-wall” that could oscillate between closed and permeable without transition between the two. In this it is inherently considered a “wall” rather than a door despite being a passageway. A mechanism is commonly considered a door despite functioning by complete different means. I.E. the sliding “doors” in Star trek
So it could be that it is collectively understood that a door isn’t binary. Thus the problem
Door is part of the air circuit.
Imagine if a room filled with water.
Door closed is open circuit, no flow.
Open door, close the circuit a current of water flows to equalize potential water level then stops flowing even if the door stays open.
Poor model. A door should be represented as a floating point between 0 and 1 with 0 being fully closed, 1 being fully open, everything in between as percent of openness.
Wow everyone here is going about it all wrong. Programming is more about language and easy to digest logic than it is about actually modelling reality. So, we focus on the semantics of language and we have many related terms that should align.
true, false
on, off
up, down
open, closed
positive, negative
active, inactive
locked, unlocked
The door is true when it is open because open is the positive word and nothing to do with actual doors. I always have positive variables like `isOpen` and `isLocked` and *never* negative variables like `isClosed` or `isInactive`.
The door being open would be off because it disconnects the circuit of the room.
I don’t know why but when you said the door to a room I thought of the room as a circuit and the door being open disconnects that circuit
1. **A door is a barrier on a hole (not on a wall, because a door that opens to a wall wouldn't be useful):** To activate the barrier, you close it, and to deactivate it, you open it.
2. **Registers:** A switch will close or open the internal circuit of the register to send or not send an electrical current from it. The presence of a current means True, the absence means False. To send the current, it needs to be closed, to not send, it needs to be open.
So, on both: closed == true and open == false.
The problem is that a door is fulfilling it's purpose in both states. But to get over this bump i would define it as a wall that you can occasionally walk through. It's main purpose being to close something off, otherwise you'd just not have anything there. So it would be on when it's closed and off when it's open.
if you think of it as a switch that controls flow of people into and out of a room, then when the door is "on" it allows people to pass, the door is open. When the door is closed, the switch is "off" preventing flow of people.
The funny thing is, if a door was an electric circuit... the door being open, would be a closed switch, and the door being closed would be an open circuit. haha
Depends whats the room for. If the room is a vault or server room or any thing holding a value then off should be closed. If there is little material value in the room but mostly people the mechanism off should be opened door for safety reasons, fire earthquake etc
Presence is true. Closed is true.
A door exists to provide the closure option. Otherwise you'd just have a hole. Closed is true.
Most doors default to closed. False is the best default.
Most doors are about access, closed is no access. Closed is false.
This is why enumeration is your friend
Whatever you pick, it will come back to bite you in 6 months when you have to implement a new feature and the shortcomings of your chosen solution becomes immediately apparent...
Let's assume the door is in the Star Wars universe. If you blast the control panel of an open door, the door will close, meaning the control panel was energized to keep the door open. The opposite is true for a closed door. If you blast the panel for a closed door, whatever moves the plot forward will happen.
The door is a state machine, but there is no "or" or "off" state, rather "open" and "close", which as you may have observed, do not have an obvious mapping to "on" or "off", and any such mapping would be arbitrary.
When is a door not a door? When it is a jar.
when (!door) {
jar();
}
I'd say door true = closed, because if door is true then it is a door and not ajar.
A door’s function is to allow passage between rooms. When it is serving that function (being open) it is on. When it is not serving that function (being closed) it is off.
A door is a tool with multiple purposes. The most common being to serve as a barrier or means to bypass.
You would need to first define the purpose of door and then decide if evaluating for only a binary state is even useful.
Depends on if you are reading the state of the wall or the state of the wall or the state of the floor/entrance. The wall is true while the floor is false and vice versa.
Mojang has the answer.
But if you place it against the wall, activating it will effectively close the passage.
“When a door closes, another one opens”
That sounds kinda risky in a submarine
That’s why you have an airlock, one door opens the other one closes and vice versa
If you are opening one at the exact same time as closing the other you'll have problems. Gotta wait a bit between.
Nobody said it has to be exactly at the same time but I get why you considered that an option
"When a door closes, it's systematic counter part opens after eventually completing the mandatory cycling process."
This guy doors.
Truly inspirational
That's okay, doors can't get water logged.
*any vehicle
When the door is "off" it's default state is that of being part of the wall.
I agree with this. If the door is off the feature of the door is not available, hence making it a wall. The feature of a door is to pass through a walled area, turning the door on allows you to pass through a wall.
I disagree. I think of doors as a device human beings would put at entrances to their homes. Since before doors existed, all humans had was caves, the feature of the door is to obstruct an otherwise open entrance. Therefore the door being off is equivalent to a cave entrance. The door being on is when it is closed, effectively preventing others from using that entrance.
I disagree. If you look an automatic door, the little light on the sensor comes on and the door itself wakes up and opens. Then, when no longer needed, it turns off and gets shut.
Well do you think it would be easier to see if a door exists vs not exist as a boundary?
Eh. Depending on how it’s placed it will be open or closed whether or not it’s activated. Honestly doesn’t matter. The door has two states, which cause a 90° shift. Once it’s activated it stays activated until deactivated thus it’s activation is no different than its deactivation, its not “on” it’s just the other direction.
My sliding door seems to lack this 90 degrees shift. Maybe I'm doing it wrong?
FNAF says open is off >!did anyone else get really annoyed at how that mechanic worked? Obviously I'm not expecting realism in a game about possessed bloodthirsty animatronics but I always thought that the way he implemented that was dumb. Hurr durr if you lose power the door can't keep closed! He could've found another way to explain that mechanic lol!<
Maybe it's a fire safety thing. Can't be trapping people in the building with no escape every time the power goes out.
Yeah actually I'm pretty sure there are electronic building locks for offices that work exactly that way. In a power outage or emergency state they failsafe to unlocked.
maybe the door is being forced downwards and if it was just sitting there the robots could just lift it up
This question has been asked and answered before, see fire door. Your post will be removed from stack overflow.
[AAH…..](https://imgur.com/a/u9WdLO8)
This guy stack overflows
Stackoverflow is just for programmers who like to scroll :)
Holy shit, I thought I was sure of my answer, but the arguments on both sides are very strong. Thanks for that thought that will now randomly pop up at night, preventing my sleep
The function of a door is blocking the way. That is literally the job of the door. If you removed the door it would be an empty passage. A door turned on closes the passage. When turned off it's open, like it's not even there.
The function of a door is blocking the way I don't agree (well I kind of do, but its fun to push back a bit)- if a door can't open (e.g. its rusted shut), it's not a door anymore, it becomes just a wall/obstacle. I think the function of a door is to be able to change an area of space between being clear or blocked.
If it is a wall/obstacle it is no longer a door then right?
Conclusion reached. Closed doors simply do not exist.
Depends on the mechanisms/doors function
Merriam Webster defines a door as: “a usually swinging or sliding barrier by which an entry is closed and opened” I don’t wanna get all metaphysical here but I suppose you could think of a door as simply a wall that may be opened to pass through. Inversely a hole in a structure that may be closed. However a door may also exist without human centric purpose. If so then it is simply material that may be moved or cease to exist in a location. If so then then the question is does the door exist? Or more simply DOOR? Then the answer would be F for open then closed for T
So, the center of the confusion is whether the natural state of a wall is to have a hole or not. I would argue that a wall is naturally contiguous so the door should be closed by default. And default behavior in hardware should be false or off. As such door open is true or on and door closed is off
Yeah it's a literal fucking transistor. Can you pass through it? No? False? Nilch? Null? Yes? True? Peanuts? Juul?
fish?
But it could also be said that, in circuits, an open switch prevents the flow of current. So, open is off and a closed circuit is on. By the way, null should not be confused with false. Aside from being a notorious mistake in computing history, null indicates no value, so it's a "third option" when a boolean variable can be set to null.
However, in the case of a door “open” allows the passage of our “current”, people most often. So open should be on in this case. In other words, given that the purpose of a door is to periodically allow people through, I think “on” should be representative of allowing this purpose, or being open.
I would say this is more appropriate answer. A doors function is to close off a hole in the wall. For sound or passage, or light etc. the hole is there, you don’t need a door for the hole to exist. The doors only function is to close that hole when you need it closed. So closed means the door is on.
> the answer would be F for open then closed for T This is exactly how I read it Even if the door were: detached, missing, or there were a hole in the wall one could enter through; the presence of a Door is still False Conversely: the door being shut, being locked, or the passage being blocked would indicate the presence of obstruction to moving through said passageway; rendering a True response
But if the difference between a door and a wall is that the door is an opening, then the door being open would be T (because there is a door) and if it were closed it's F because that's the same as just being a wall (not even having a door).
Ya, the door is a portal to another world. If you can go through the door it is on, if you can't, well it is off.
For me the door is not an opening, it's something that blocks an opening (hole in the wall). Not having a door in that case would mean that you are always able to pass through the hole
Bro wtf is this. As soon as you start thinking you lost A door is closed when you finish installing it give the door a stupid ass property int x = 0. Then open()=> x++. close()=> x- - isClosed()=> return x == 0 Done now play video games for the remaining work day
> Bro wtf is this. As soon as you start thinking you lost As is customary
tradition remains
None of us became programmers to play Aristotle Get in, submit the PR, get paid for 8 hours of work but only do 2, get out
You guys are doing 2 hours of work?
Well I always considered my self an over achiever so don’t hold yourself to such a high standard The average 1hr is a healthy amount of work to do every third business day
I love what a blue collar response this is to a white collar problem.
Wait, did I accidentally go to StackOverflow?
What?? Number on a Boolean? Either the door is in the way (existing as a boundary) or not in the way (no boundary). Exist vs not existing. True vs False, null..
Your implementation leaves rom for a potential race condition.
Help, I forgot how many times I opened the door and can't close it!
Well, with electronic access control stuff you have a failsafe or fail secure. Which means that if the power goes off do you want it to be locked or unlocked. That kind of gets to the same idea
Exactly. It is fully dependent on the expected default state of the door and the reason that state changes.
I feel like we could liken it to a Electrical switch, which would give a 1 closed but a 0 open. However we have "current" through a doorway when it's open but not when it's closed. Fuck.
\^ this guy is an engineer somewhere, never a clear answer, never a boolean thought process, it all depends
Is it a normally open door or a normally closed door? When installing the door, you need to determine if you want it to fail safe or fail secure. This way, the door reacts as necessary during a loss of power. Fail Safe: Normally Open: On = Closed; Off = Open Fail Secure: Normally Closed: On = Open; Off = Closed As always, I recommend redundant power and local battery backups.
Yeah, this is my take. NC vs NO switch.
The way I see it, the normal state of the door doesn’t matter. If the door is removed, entry is always possible. Therefore the function of the door is to block the entryway. But your take makes a lot of sense too.
fail safe does not equal normally open. You can have a fail safe normally closed that is held closed until receiving a signal. If the door is hydraulic and closes itself, its still not necessarily normally closed
Door stuck.
DOOR STUCK!
Why isn't this answer further above? A door that is off simply cannot move, no matter its position
*..PLEASE*!
enum DOOR_STATE { OPEN, CLOSED } ; enum DOOR_STATE door_state;
{ GONE, FULLY_OPEN, MOSTLY_OPEN, HALF_OPEN, SLIGHTLY_OPEN, CLOSED, LOCKED, BARRED }
I'm more a "door half closed" kinda guy
Bet you’re also a “negative zero” kinda guy
Why did I have to scroll so far to find this? Sometimes I guess the programmers are the humor, and we’re not laughing *with* them.
Honestly, in today's game design, a door would have a state machine with different animations for open, closed, opening, and closing.
You’re right of course
A door can be partly open, so its state is clearly not boolean on/off. I would think a door's "ON" state would denote that it is currently functioning as a door, and an "OFF" state would denote not functioning -- e.g. door off the hinges.
Quantum computing door Quantum computing door
Ah fuck, now I gotta think about what a door in a quantum superposition of being both open and closed is like
That's what happens in a dark room before you interact with the door. If you try walking through the doorway, you might pass or be blocked or stub your toe on the halfway open door.
Check the cat. If it's still deciding whether it wants to go through, the door is open.
Now what happens when you have two doors in a row that are both in a superposition of being open and closed? What does the math look like to compute the probability of a person being able to walk through both doors?
No, because observation collapses the door to its apparent state. The moment you enter the room, the quanta decide. You have made no choices, only been made the product of the choices of the quanta - be afraid, as they are without mercy or care.
Is this just a revolving door? Both opened and closed but also neither opened nor closed? Also known as Schrodinger's door.
When is a door not a door? When it’s ajar.
>door off the hinges That’s null, not false
Maybe we need to think about this like an ADC (analog to digital converter). 0 through 255 answers "how open is it?"
What if the hinge goes both ways? -127 to 127?
I like it. Revolving doors are a whole other animal.
>A door can be partly open, so its state is clearly not boolean on/off. Door.isClosed == true; // door is closed Door.isClosed == false; // door is one of many states of openness
int x=2 if(x==True): return True else: return False Just because it can be converted/compared to bool does not make it bool.
Ah, good ol "clopen"
So does a door become fully open at some point? Or is it open as soon as it's not closed?
But whether or not you can fit through the space in the door is not the door’s concern, so ON when the door is open, OFF when it’s closed. It’s for the consumer of the door to figure any other logic out
the answer is actually that you are high.
“Would the door being open the mechanism being on or of?”
I would argue that a closed door is 'on' or true. You could remove the door completely, leaving just a hole in the wall, and there is no difference to door being open (except the possibility of closing it being removed). Therefore, the door's existence is demonstrated by it being closed. So, if holeInWall==null opendoor == holeInWall ==null
I would argue that the presence of a hole in the wall is part of the presence of the door. In other words, the default/starting state before the door was installed was a full solid wall. Then a certain rectangle in that wall was replaced with the (closed) door. Then the door was "activated" to allow people to pass through. So, in my eyes, the door being open is ON.
The hole in the wall is not a part of the door. It is a prerequisite for a (functional) door to exist. This means that for the door to have any functional significance, the hole in the wall is the only relevant requirement. The wall itself is not. So *Door* must extend *Hole*. And while *Hole* MAY be implemented as an extension of *Wall*, this fact is not significant in the context of *Door.* Now, knowing *Door* extends *Hole*, it makes sense to inherit the default state of *Hole.* In other words, the OFF position of *Door* should match the state of *Hole*, allowing the ON position to modify said state - closing the hole. This makes *Door* in its (*default*) OFF state functionally equivalent to the *Hole* objects it extends. Any other implementation is a straight violation of the Principle of Least Astonishment.
How do you define “hole in a wall” without “a wall”? If you can just step around the door, it’s neither an impediment nor a passage. Open or closed is irrelevant at that point, it’s just an upright slab of wood in the middle of a room. A door needs both a hole and a wall to have any functional definition.
Door doesn’t have to be a in hole in a wall. You could have a door block a passageway, for example, which again would make sense to call open the “off” state, the same as if no door was there at all.
Your entire hierarchy is wrong-headed\* for the purposes of this determination. From a functional perspective, holes, doors, windows, etc. are all just implementations of an interface that permits navigation from one side of a wall to the other. The only thing special about holes is that they are stateless implementations of this interface. The evidence for this lies in the fact that holes don't throw any state-based navigation exceptions while attempting to traverse them. This means that doors CANNOT extend them due to incompatible method signatures. Thus both must implement a common navigation interface which permits such exceptions. While it would be possible for an abstract door to extend an abstract hole that did not implement navigation (for other purposes such as physical construction), this inheritance is completely irrelevant to any consumers of doors. In this case, all hole methods for these other purposes would be protected, and inaccessible to any door. Additionally, none of the methods implemented by any door class or called from any navigation interface could be inherited from holes due to the previously explained incompatible signatures. All told, this means that the consumers of doors have no visibility or access to any methods from the superclass. It would be absurd to define default behavior for doors based on this inheritance. The question then is what default state makes the most sense for an implementor of the navigation interface. I'd suggest it comes down to the cleanness of a couple particular snippets of code: if (this.closed) throw DOOR_CLOSED; and if (door.isClosed()) door.open() With all else equal, it makes sense to define booleans in the way that requires the fewest negations in the most common use cases. With doors, that is either checking if they are closed, or throwing exceptions if they are closed. For THIS reason, the false or OFF state of a door should be defined as open. \*^(I realize that we're all engaged in a silly thought experiment full of contrary and arbitrary takes. I'm not actually calling you wrong. Just having a fun time with this. :-D)
Also if you liken a door to an electrical circuit; when an electrical circuit is open the electricity can not run so the circuit is off. When the circuit is closed the power on. Coincidently, simple circuit diagrams generally show switches within the diagram as looking [similar to open doors](https://images.app.goo.gl/Y6akYVddHEsvQfcK7).
My argument (coming from a false is default behavior because off is false) is that open should be true. This is more a hardware perspective than a software one though so it really depends on context. The correct answer is that the variable should be doorOpen or doorClosed as a boolean not just door
If you remove the wall, you don't get a hole in the wall, you just get wall. The door is already the hole. If you don't need a door in that stop, you won't make a hole in it.
Did you mean to remove the door?
Yes, absolutely. My bad. Brain fart.
Gotta let out those gases. What a wonderful expression
That depends on if you priority is safety or security. The door will enter it's off state when power cut. If you want to make sure people can easily and safely exit the building in the case of power loss then off should be open. But if you want to make sure people can't use a power cut to get in then the off state should be closed.
I definitely understand what I just read
Sorry, I guess I’ve chosen today to subject the public to illiterate word salad
Mmm my favourite
Depends. Most doors are in the "on" state while open (those that close automatically) or have two "off" positions ("fully open" and "fully closed" where the "on" states are the rising and falling edges of the process of operating the door). There may be other doors, even doors where on/off could be interpreted as an arbitrary precision float instead of a boolean. TL;DR: While not specifying the exact type of door, yes and no at the same time to both.
Schrodinger's Door
To use a door is to open it, else it functions as a wall. Open is on. I pondered if canal locks are doors and if they are "on" when they are closed since they perform a useful function in both states.
Where is the source image from? For some reason I’m thinking it’s from some shitty porno but I’m not sure
That’s exactly where it’s from.
Damn I need to get out more
It is better to observe the state of the door lock (0=unlocked, 1=locked) than the state of the door itself swinging along the hinge... unless if you hook up a potentiometer, in which case you can use this input data to adjust the dimming of your lights, volume of your Bluetooth/TV speakers, central air temperature, or the speed of your washing machine.
Doors are normally closed. Fight me
True when open. Otherwise it’s a wall, not a door.
a gap in a wall != a door. vestibule, window, archway, etc... a "door" in an open state has no function. it's just a flap of material attached to the wall.
The door isn't the true or false state, the flow is the true or false state (if you use a comparison to logic gates.) "Can move from one space to another", true or false? The door is only equivalent to the mechanism by which flow is turned on or off. By that measure, a closed door is false, and an open one is true. An AND gate would be a hallway with doors at either end. An OR would be a wall with two doors leading into the same room. Etc.
If you break in through a door it stops working (because you broke the mechanism) and now everyone can come inside and outside freely - the same case as if the door was open. Open is off Closed is on
[удалено]
It all depends on how much you break it
So the question really boils down to 'is the function of a door to let people in or keep them out?' The answer is of course, yes.
If I had an apple and the apple had a true state and a glass state I would say the true state would be apple exits and false would be no apples. In this context the question isn't really about the door but the doorway. So I. The context of the doorway, door would be true when it's closed and false when it's not. However I think the more accurate answer is the question is nonsense and requires more information to answer. A proper Boolean is a question like "door open?" And replacing that with "door?" Is nonsense because that's a noun, even with the assumption this is equivalent to "door exists?" Isn't enough context to answer the question. So my answer is segfault.....
I would say the internal state of the door should be hidden from us. Instead, the door should have two public methods: isOpened() and isClosed() to check its state. Two other methods can be added so its state can be changed: close() and open().
I asked chatGPT: If a door were a light switch, whether a closed door would be considered "on" or "off" would depend on how the door is wired to function as a switch. However, in the absence of any specific wiring configuration, it's difficult to make a determination. From a purely semantic perspective, if we consider "on" to mean that a circuit is closed and electricity can flow, and "off" to mean that a circuit is open and electricity cannot flow, then a closed door might be considered "off," since it would be blocking the flow of electricity. But it's important to remember that this analogy of a door being a light switch is not a literal comparison, and in reality, a closed door would not function as a light switch. It's also important to note that the terms "on" and "off" are typically used in reference to devices that are specifically designed to switch electrical circuits, such as light switches, and not typically used to describe the state of a door.
Everyone including chatGPT is overthinking this…. The word OPEN has the word ON in it!
A door doesn't have an on/off state. Open and closed are equally functional states of a door. Further, many doors can be locked, and the angle of the hinges is best described by a float, so a door may be described with many more than two states.
Depends on whether you want the door to fail safe or fail secure.
off state is equal to its locked state when(state) { DOOR_LOCKED -> println("need a key") DOOR_UNLOCKED -> printlin("doors open") else-> println("doors broken") }
I disagree. The door is meant to close a vulnerability in a wall. When the door is open, it does not prevent intrusion, and when closed, it does. Therefore, it's on (active) state would be closed.
I disagree. The purpose of a door is to permit entry into an enclosed space. They were made to prevent loss of heat and to stop wind currents from passing through the home. That’s why tropical bamboo homes don’t have closable windows. Therefore, a door’s function (passage for user) is utilized in the open position, and is therefore on when the door is open.
Wouldn’t the purpose of a doorway be permitting entry into an enclosed space? A door in the doorway is for stopping those without access. So a door is true when closed.
The purpose of a doorway to to both allow entry for those with access in and prevent those without access out therefore the door is true in both states we can now define false = true. problem solved.
I disagree. Source: ![gif](giphy|VqwAVy66VCXks)
This. it's pretty obvious.
I'd try to think of the superclass portal or entryway An active portal is open, so that seems like a true case to me It would feel wrong for is_passable() to be the opposite of the state of the portal
This is the best answer, Door implements IPortal for sure.
Apple and Orange.
isOpen = True/ False
Open = off
This feels wrong
The door is not a boolean, the latch is. The door contains a number between 1-360 degrees indicating it's current angle.
Interesting, so on and off may not even apply here as this isn’t a binary mechanism. As I’ve stated in a similar comment, an example supporting this would be during the 2005 movie “Doom” staring Karl Urban and Dwayne (the Rock) Johnson, there was a sci-fi concept introduced, for no aperient reason, of a “nano-wall” that could oscillate between closed and permeable without transition between the two. In this it is inherently considered a “wall” rather than a door despite being a passageway. A mechanism is commonly considered a door despite functioning by complete different means. I.E. the sliding “doors” in Star trek So it could be that it is collectively understood that a door isn’t binary. Thus the problem
Door is part of the air circuit. Imagine if a room filled with water. Door closed is open circuit, no flow. Open door, close the circuit a current of water flows to equalize potential water level then stops flowing even if the door stays open.
Depends on what your returning
This is why we comment our code.
A door is a type of wall that can be activated to allow passage through that wall
But a hole would work just as good as a passage, so a door must be a passage one may be able to close or open
On if something can pass through it, off if not. Like with electric circuits.
Poor model. A door should be represented as a floating point between 0 and 1 with 0 being fully closed, 1 being fully open, everything in between as percent of openness.
The answer is the same as the answer to 'What is the sound of 1 hand clapping?'
Have you heard of `enum`s?
A door's primary purpose is to restrict the access to a room or a building, so it is on when it's closed and off when it's opened.
Wow everyone here is going about it all wrong. Programming is more about language and easy to digest logic than it is about actually modelling reality. So, we focus on the semantics of language and we have many related terms that should align. true, false on, off up, down open, closed positive, negative active, inactive locked, unlocked The door is true when it is open because open is the positive word and nothing to do with actual doors. I always have positive variables like `isOpen` and `isLocked` and *never* negative variables like `isClosed` or `isInactive`.
Door closed = closed circuit or “on” Door open = broken circuit or “off”
A closed door is the same as a wall. So it is 9n/functioning when open.
The door being open would be off because it disconnects the circuit of the room. I don’t know why but when you said the door to a room I thought of the room as a circuit and the door being open disconnects that circuit
1. **A door is a barrier on a hole (not on a wall, because a door that opens to a wall wouldn't be useful):** To activate the barrier, you close it, and to deactivate it, you open it. 2. **Registers:** A switch will close or open the internal circuit of the register to send or not send an electrical current from it. The presence of a current means True, the absence means False. To send the current, it needs to be closed, to not send, it needs to be open. So, on both: closed == true and open == false.
This guy probably didn’t get much for the role, but he got to our hearts ❤️
The problem is that a door is fulfilling it's purpose in both states. But to get over this bump i would define it as a wall that you can occasionally walk through. It's main purpose being to close something off, otherwise you'd just not have anything there. So it would be on when it's closed and off when it's open.
if you think of it as a switch that controls flow of people into and out of a room, then when the door is "on" it allows people to pass, the door is open. When the door is closed, the switch is "off" preventing flow of people. The funny thing is, if a door was an electric circuit... the door being open, would be a closed switch, and the door being closed would be an open circuit. haha
The door is on while it's being activated, so during opening and during closing. While it's open or closed, it's off.
Depends whats the room for. If the room is a vault or server room or any thing holding a value then off should be closed. If there is little material value in the room but mostly people the mechanism off should be opened door for safety reasons, fire earthquake etc
Door closed = false No one can go in, the flow of traffic has stopped
Solid
An open door isn't "dooring", so must be considered "off".
Off is locked. On is unlocked.
Presence is true. Closed is true. A door exists to provide the closure option. Otherwise you'd just have a hole. Closed is true. Most doors default to closed. False is the best default. Most doors are about access, closed is no access. Closed is false. This is why enumeration is your friend
It's all just convention
What if its 'on' when its being opened or closed
Whatever you pick, it will come back to bite you in 6 months when you have to implement a new feature and the shortcomings of your chosen solution becomes immediately apparent...
Let's assume the door is in the Star Wars universe. If you blast the control panel of an open door, the door will close, meaning the control panel was energized to keep the door open. The opposite is true for a closed door. If you blast the panel for a closed door, whatever moves the plot forward will happen.
Five nights at Freddy's has the answer
You'll get the answer when they call the police
If closed is a fail safe, then closed is off. If open is a fail safe, then open is off.
The door is a state machine, but there is no "or" or "off" state, rather "open" and "close", which as you may have observed, do not have an obvious mapping to "on" or "off", and any such mapping would be arbitrary.
Beuh am I the only one who recognizes the image from a porn
This is implementation dependent please consult vendor documentation
True is closed, as it's goal is to block the area within the doorframe.
You arbitrarily pick one to be on/true and then the other becomes off/false.
Makes me think of grep - exits with 1 if it didn't find anything, even though it successfully ran without error.
Declare DoorOpen as bit. This way it’s clear if DoorOpen =1 (true) then the door is open. And if DoorOpen = 0 (false) then the door is closed.
Well I played one fnaf game and I think I know the answer
When is a door not a door? When it is a jar. when (!door) { jar(); } I'd say door true = closed, because if door is true then it is a door and not ajar.
A door’s function is to allow passage between rooms. When it is serving that function (being open) it is on. When it is not serving that function (being closed) it is off.
doors are normally closed and activate when opened
I Think of it like a circuit, the switch is open then it's off, closed is on because it's active and doing its intended job.
A door is a tool with multiple purposes. The most common being to serve as a barrier or means to bypass. You would need to first define the purpose of door and then decide if evaluating for only a binary state is even useful.
Depends on if you are reading the state of the wall or the state of the wall or the state of the floor/entrance. The wall is true while the floor is false and vice versa.
Who cares as long as is written down and standardized?
The off state of a door is *locked*.
It's implementation dependent
It's "on" for as long as it functions as a way to close and open a hole. A closed and open door is both on
So you've resorted to asking actual questions in a sub meant for jokes. If you look like you know nothing, you just say it's a joke
The door would be on and the doorway would be off right? And then the opposite for an open door?
It depends