Aims. We compare six popularly used evolutionary population synthesis (EPS) models by fitting the full optical spectra of six representative types of galaxies (star-forming and composite galaxies, Seyfert 2s, LINERs, E+A, and early-type galaxies) taken from the Sloan Digital Sky Survey (SDSS). We explore the dependence of stellar population synthesis results on the main ingredients of the EPS models and study whether there is an age sequence among these types of galaxies. Methods. We use the simple stellar populations (SSPs) of each EPS model and the software STARLIGHT to perform our fits. Firstly, we explore the dependence of stellar population synthesis on EPS models by fixing the age, metallicity, and initial mass function (IMF) to construct a standard SSP group. We then use the standard SSP group of each EPS model (BC03, CB07, Ma05, GALEV, GRASIL, and Vazdekis/Miles) to fit the spectra of star-forming and E+A galaxies. Secondly, we fix the IMF and alter the age and metallicity to construct eight additional SSP groups. We then use these SSP groups to fit the spectra of star-forming and E+A galaxies to verify the effects of age and metallicity on stellar populations. Finally, we study the effect of stellar evolution tracks and stellar spectral libraries on our results, and present a possible age sequence among these types of galaxies. Results. Using different EPS models, the numerical values of contributing light fractions obviously change, even though the dominant populations are unaltered. The stellar population synthesis does depend on the selection of age and metallicity, but does not depend significantly on the stellar evolution track. The importance of young populations decreases from star-forming, composite, Seyfert 2, LINER, to early-type galaxies, and the properties of E+A galaxies are between composite galaxies and Seyfert 2s in most cases. Conclusions. Different EPS models infer different stellar population parameters, so that it is not reasonable to directly compare stellar populations estimated from different EPS models. To obtain reliable results, we should use the same EPS model to derive the parameter values that we compare.