Could someone give me an example of why you would use a code file?

Thanks Steve