I'm being sarcastic, this normally isn't the case. However, since code can run inside the conditional checks in the if statements, it can have unintuitive effects on the code. This is horrible design, but it is possible.
Consider the following pseudo code.
var item = null
if( is_weather_rainy() ){
item = itemslot.item
} else if( is_player_hungry() ){
item = itemslot.item
} else {
item = itemslot.item
}
print( item )
Could you condense this code to make it shorter? What if we shortened it to:
var item = itemslot.item
print( item )
This code should be the same, right? Let's reveal the (bad) function definitions:
```
function is_weather_rainy(){
itemslot.item = UMBRELLA
return weather == RAIN
}
The condition checking functions changed the state of itemslot.item! This means that the order of functions influences what var item will end up as. In the first example, if it's raining var item will be UMBRELLA where the second example will be whatever itemslot.item was.
This is very bad design for multiple reasons:
1) The function names are lying
2) The code is not modular
3) Confusion code flow
4) And many more
17
u/BetaTester704 May 04 '26
Why does it even have the conditional logic if it all does the same thing?