A common good practice is to minimize the amount of coding. This is really sensible because it makes code maintenance and testing much easier. DRY (short for Don't Repeat Yourself) is a common principle in software development. The basic idea of DRY is to reduce the amount of code by avoiding repetition in the code. It is always a good practice to split your source code into smaller components because smaller units are always easier to manage. Of course, the optimal structure depends on the programming language you are using. One good statement is also Keep it Simple, Stupid (KISS), which should guide you in the right direction.