The difference between alternating current (AC) and direct current (DC) is really as simple as their titles suggest. Direct current is steady and flows in one direction (hence, it flows directly) while alternating current rises and falls as it continually changes direction (hence, it alternates). They are both essentially the same thing; a flow of electrons. However there are fundamental differences between them and these differences can be found in two places how the electricity is generated, and how it is used.
Alternating current is the type which flows to your house through the power lines. The reason for this is simple it is the easiest to generate from conventional power plants. Alternating current is produced in generators which involve moving parts, such as coal power stations, wind turbines and hydro power. All of these involve a moving part (the rotating turbine) and that is what makes the power generated become AC. Put simply, as the turbine rotates it creates a moving magnetic field, which pushes and pulls at the electrons in the wire. This causes them to move forward and backwards quite rapidly. This generates a current which is constantly changing direction; hence it is an AC current. The current follows a sine wave pattern.
Direct current is the type which is generated from batteries and solar panels. DC current needs to be generated from a source with no moving parts. The chemical energy provided inside a battery pushes the electrons in one direction. The current produced therefore flows directly around the circuit on one direction. Unlike AC, the current remains at a constant level.
Since AC current is used for power transmission, all devices which plug into the mains supply use AC. However, many of these devices, electronics in particular, actually have a built in AC/DC converter. This is because the electronics require the stable and steady current that DC provides. The constant reversing of AC would cause problems on such devices. On other devices, like light bulbs, it doesn't make much of a difference whether they are powered by AC or DC. When a light bulb is powered by AC, it is actually constantly fading on and off. It does this so fast that it appears to be on constantly. Devices like washing machines can only function on AC, as the motor requires an alternating current to spin. However, in recent times this has became more complicated. Whilst the motor runs on AC, the washing machine's screen and computer are running on a DC converter.
AC and DC cannot be "compared" in such a way as to say outright that one is better than the other. Instead, they each have their separate advantages and disadvantages. They both have their separate uses, and without them much of the devices we rely on so much would simply not function.