is it ok to change this OPC?(other people's code)

So I'm looking at this

if (WiFi.status() != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
while (WiFi.status() != WL_CONNECTED) {
WiFi.begin(ssid, pass);
delay(5000);
}
Serial.println("\nConnected.");
}

and wondering why it can't be shortened to

while (WiFi.status() != WL_CONNECTED) {
WiFi.begin(ssid, pass);
delay(5000);
}

What happens when you try it?

with the serial.print, it's verbose. without the serial print, it's bare bones. verbose is good for troubleshooting, but it's only useful if you have the source code and the IDE and you know what it means

I use serial print just enough to verify that the code works, then I fling it.

the goal is not to print "Attempting to connect to SSID: " if it is already connected

it works either way.

sevenoutpinball:
it works either way.

so if you remove the print, it will not print if already connected :-). but will not print that if starts to connect either.