No matter who they are or what they have done in their lives, they are still human beings that need to be respected and treated as if they are our friends or family. They may act as if they do not recognize the world anymore, but remember they have once built this land before you were born. Do not also forget that one day you will also be needing a helping hand, to guide you with your medicines, help you eat and help you walk.
So please be nice to them, at least. Smile and tell them how glad you are to see them.