Simplifying a loop that checks if a pushbutton switch was pressed

Hello!

My first post in the Arduino forum deals with a very banal question: I use this snipped of code near the very beginning of my loop{}:

while (digitalRead(inPin9) == 1) {}

Obviously, the intent is for the program to wait for this pushutton to be pressed before it continues executing. Is there any disadvantage at all in using such a simple command? Previously I used

 swState = 1;
  
  while (swState == 1) {
    swState = digitalRead(inPin9);
  }

but then I remembered some C coding that I did some 15 years ago.

I don't see any real functional difference between the 2 snippets. Both block. Do you really want the program to stop and wait for a button press?

Even shorter

while (digitalRead(inPin9));

Even shorter

But, that is harder to change if you use the internal pullup resistors, so that LOW means pressed.

groundFungus:
I don't see any real functional difference between the 2 snippets. Both block. Do you really want the program to stop and wait for a button press?

Thank you.

Yes, that's exactly what I want to do, before I start the 1 kW motor from spinning :smiley:

Sorry about the noobish question, I just wanted to make sure there is really no difference in function.