NaCl (Sodium chloride)
NaCl is a ionic compound in which the ions form ionic bond, ionic bond is a chemical bond in which one atom loses one electron to form positive ion and that electron is accepted by other atom to form negative ion.
This depends upon the electronegativity, if the electronegative difference between the two atoms are more then they form ionic bond. [Electronegativity = ability of the atom to pull electron more towards itself]. In NaCl, Cl has more electronegativity than Na thus forming negative ion and since Na loses one electron it form positive ion. Ionic compounds brittle and hard in nature with high melting and boilling points and are highly soluble in water.
CH4 is covalent compound, a covalent compound is formed by covalent bond which is formed by Sharing of pair of electrons between the atoms in a molecule. In covalent bond one attains partial negative charge and another atom attains partial positive charge. Covalent compounds are non electrolyte and poor conductors of heat and electricity, covalent crystals are hard in nature
Ionic bonds are a result of electrostatic attraction between two oppositely charged ions. Ionic bonds exist because some elements like Na and Cl have a tendency to capture or to lose one or more electrons. As a result of this there is a net positive or negative charge and the atoms are now called ions. Ions with opposite charges attract each other. For example, NaCl is formed as Na+ and Cl− combine. For a solid that has ionic bonds to melt, some of the bonds, though not all, must be broken. As a result, ionic bonds produce moderate to high melting and boiling points.
Methane or CH4 though has a different type of chemical bonding. Here the hydrogen atoms are each one electron short of a full outer shell. The carbon atoms need to gain four extra electrons to complete their outer shell which can hold eight electrons. Transferring electrons would require too much energy. Instead the electrons are shared. Each of the hydrogen atoms shares one of its electrons with the carbon atom. As a result hydrogen has 2 electrons in its outer shell and carbon has eight electrons in its outer shell. The result of covalent bonds is molecules that have a discrete entity but strong bonds between the atoms. These molecules only stick loosely to themselves. As a result these compounds have low melting and boiling points and are usually found as gases, as in the case of CH4.