Is if (startingSpawn == false) a positive statement? via /r/learnprogramming


Is if (startingSpawn == false) a positive statement?

Is if (startingSpawn == false) a positive statement?

I am not sure if I am asking this right but I remember reading that you should try to use ifs that positive since its easier to reason about but I have always wondered if this counts.

if (!startingSpawn) << I am pretty sure that is what should be avoided but I am often stuck wondering how to make an if statement true.

if(startingSpawn){//do nothing} else {//do what I want to happen} << pretty sure this is even worse so I usually do startingSpawn == false but that seems unnecessarily verbose although it is, at least for me, easier to instantly understand than !startingSpawn.

Submitted July 14, 2017 at 07:08PM by gamemaker22
via reddit http://ift.tt/2t0226v

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s