in my book after giving an introduction to diffraction there was fraunhoffer diffraction explained,but i couldn't understand why a lens was placed before the slit
The lens before the slit (or whatever) helps to get a more plane wavefront, but you can also get a clear diffraction pattern from a small laser beam. A lens after the slit then gives a sharper pattern, but a long distance to the screen achieves about the same. Google
fraunhofer diffraction images and check a few pictures.
In optics, the Fraunhofer diffraction equation is used to model the diffraction of waves when the diffraction pattern is viewed at a long distance from the diffracting object, and also when it is viewed at the focal plane of an imaging lens.[1][2]
Fraunhoffer diffraction deals wit parallel light beams. Plane wavefronts are incident on the slit and all points on a wavefront are in phase.
The lens is to produce a beam of parallel light.
Mathematically this is easier to analyse than the alternative...Fresnel diffraction
The diffraction phenomena are usually divided into two categories: Fresnel diffraction and Fraunhofer diffraction.In the Fresnel class of diffraction the source of light
and the screen are, in general, at a finite distance from the diffracting aperture.In the Fraunhofer class of diffraction, the source and the screen are at infinite distances from the aperture; this is easily achieved by placing the source on the focal plane of a convex lens and placing the screen on the focal plane of another convex lens.The two lenses effectively moved the source and the screen to infinity because the first lens makes the light beam parallel and the second lens effectively makes the screen receive a parallel beam of light.As lychette said Fraunhoffer diffraction is much easier to analyse than frenel and its just due to this we name the diffraction phenomena differently.