Does an atom want to give or take electrons when it has a shell half full?
When it comes to elements like carbon and silicon, which have 4 valence shells, the maximum possibility is sharing of electrons to form covalent bonds, like in $\ce{CO2}$ or $\ce{CH4}$. However in carbides, like calcium carbide or tungsten carbide, it may gain electrons.