The diffraction grating is used to produce spectra and for measuring wavelength. The spectrum produced in the fine grating is sharp and can be separated easily and more accurately and hence, easily measurable. Further, in a two-slit set up for measuring the wavelength of light that produces interference fringes are modulated by the diffraction produced by individual slits. Thus, the diffraction grating is better than two slits.