^^^^^ Again, well said.
People should read the environment, the circumstances, the body language and/or if there is one or more present.
When walking past an individual a quick respectful nod of the head is reasonable. Trying to say something funny is probably not a good idea as they could be focused on something. When they are in groups they can be completely unpredictable (just walk past normally and soberly, don't look like a moron). Out of sight, out of mind.
Not really wise to bring any attention to yourself, period. But, there are times where eye contact is made, a repsectful acknowledgement is appropriate.
All of this really comes down to personal awareness, basic respect for others, and COMMON SENSE.