eating late at night is not harmful to you, the only thing is you dont have time to burn off the calories you just consumed, and on top of that its easy to get heartburn.
Eating late is a bad idea if your don't want to gain weight. When you sleep your body takes any additional energy from the food you just ate and stores it either as fat or new muscle.
Eating before bed is typically not recommended because as you sleep, food will tend to digest slower while you are idle, making burning calories impossible as your metabolism is slow.
It's not good for you health or weight. If you go to bed with a full stomach, you cannot exercise it off and you'll put on weight. You will also have bad dreams and not get a good nights sleep. You should eat 5 hrs before you go to bed.