My question is why need to mend the copper wire into coiling certain formed in order to produce electricity or magnetic effect? Why can‘t we just put it in straight line? why?
A straight line does produce some electricity and magnetic effect. We use a coil to concentrate the effect into a smaller volume.
To produce magnetic field, we have to run electricity over a wire, the magnetic field is circularly formed around the wire. (labman.phys.utk.edu/phys136/modul. ) So we have to make wire circular to make the magnetic field to match more like a bar magnet. hyperphysics.phy-astr.gsu.edu/hba. When we produce electricity, electrons move only if the coil is moved or the magnetic field is changing. Under a straight uniform magnetic field, electrons tend to move in circles, so we tend to use multiple circles to make current stronger. I had over simplified my answer. So I would strongly suggest you to read about some book on electromagnetism. To summarize, if we put it in a straight line, it just won't behave properly for that particular application. And also remember that we can ask the same question for a lot of things around us. If you apply the similar question of why is something not designed in a certain way, you will be able to generate better ways of doing things. Keep up the curiosity! It is all about knowing how things work and designing the best shape that fits our needs.