I see people(mostly western) keep bandwagoning about how Vietnam kicked China's *** and China lost without having a clue of the actual context.
Deng had already informed even president Ford of US,that China would invade Vietnam for a period less than 33 days, to teach Vietnam a lesson for collaborating with Soviets in containing china and trying to subjugate SEA under their control .China withdrew after capturing all 5 provinces of Vietnam just as proclaimed.As Deng envisioned,the punitive strike by China destroyed Vietnam's goal of subjugating Thailand,Laos, Cambodia, all the way to the malacca strait ,China also made it clear to the Soviets that any attempt to encircle china will have to carry a huge cost, thus the soviet stopped their military buildup in Vietnam . China literally achieved all the goals from the war in Vietnam.
But western experts like to portray it as Chinese defeat.
Vietnam was an imposing nation in Indochina with the hegemonic dream of its own,with Soviet weapons supply,their military , in many ways was ahead of China's in having the latest ,yet China tamed the wannabe hegemon,after 1979 Vietnam realized their place and not just stopped antagonizing SEA nations but instead started courting,so Vietnam could be included in ASEAN.