Answered by Shaykh Faraz Rabbani
Question: Why wasn’t the Qur’an compiled during the time of the Prophet (Allah bless him and give him peace)?
Answer: In the Name of Allah, the Benevolent, the Merciful,
Walaikum assalam wa rahmatullahi wa barakatuh
I pray this finds you in the best of health and spirits.
The Qur’an was ordered and preserved during the life of the Beloved Messenger of Allah (peace & blessings be upon him & his folk), through the memorization of the Companions–which was the primary means of both preservation and transmission of the Qur’an.
The writing was a secondary, confirmatory means of preservation.
The fact the the Companions (Allah be pleased with them) spread out across the lands–and hundreds of thousands entered Islam at their hands–and yet no differences arose regarding the preservation of the Qur’an is a strong proof of its being preserved.
I would recommend the following book:
It is available online in pdf, though I would recommend and encourage actually buying the book: