He will learn from this and know what he lacks.
He could have survived if you or the team leader had given him more time. He is just out of luck.
Nobody is a born programmer. Be considerate, everybody learns from mistakes. Programminng is not the work for gunius, anybody who studys hard and works hard can become good programmers.