24mm is a better focal length, as it is less subject to distortion and is generally cheaper. 20mm lenses can be very useful for astrophotography or landscape photography though, due to their surprisingly much wider field of view which can help to capture the foreground. Take a look at the example photos to see this in action.