Comment by goodmythical

17 days ago

>That is a decision made by a computer on data it receives at runtime.

I disagree. A light bulb is on if and only if it is supplied electricity. With a switch, I have control over input of electricity. The bulb is on if and only if the switch is toggled on. The bulb isn't deciding whether or not to be on based on the if-statement represented by the switch. It just is on or is off depending on conditions.

To make it more dynamic I can replace the switch with a motion sensor. The light is now on if and only if motion is detected. The light is not deciding to be on but must be on as required by the motion sensor toggling the flow of electricity. The light either is or isn't on depending on the conditions.

If I write an if condition that prints true if there are more than ten files in a folder, and then a second that places a random selection of up to 20 files in the folder before deleting them every second, the if function will be true roughly half of the time. The function either is or isn't true based on conditions.

All of the decisions made for and involving both the lights and the if condition were made before they existed. Once implemented, those decisions will remain true until some force acts upon them (later conditions or decisions). While the initial decisions (to wire the light, to write the if condition) are true, the system itself makes no decisions. Either systems current condition depends entirely upon the decisions made before it existed.

Saying an if-condition makes decisions is like saying a bicycle decides to fall down when running out of momentum or encountering an obstacle.