In void serialEvent() {} I put the code that listens for packet messages from serial port and would digitalWrite or analogWrite according.
In void loop() {} I want to put code that would listen (analogRead) to 6 analog inputs and send packet message to serial port. But the thing is there is constantly some voltage on each of 6 analog inputs pins even if nothing is connected to them. I would not like the code to send meaningful packets. What code would help code to "understand" that this is not just meaningful voltage flowing around 6 pins and send meaningful packet.
If you use a pull-up or pull-down resistor on the analog inputs at least the voltage won't be changing when the pin is otherwise disconnected. Something like a 10K pull-down should get the pin to read 0 when not otherwise connected and not burden your voltage sources much when connected.
Unconnected input pin are called 'floating input', no matter if digital or analog pins, and will exibit this behaviour, it's an electrical property that you must be aware of and deal with. Either electrically (using internal or external resistors) or intellegence in the software program. Reading pins that have nothing wired to them is not a logical thing to do. Which pins you read and when you read them is totally under your program statements. I don't go check the mailbox when I know it's a postal holiday.