Whenever you work on a software, which is not trivial or small, than you have to work with legacy code. I talk about old codes. Either one wants to re-use them or one does not. Regardless, however, you always have to marry the new codes with the old ones, and that is never easy. I gets especially hard when have interfaces to the outside world, i.e. other software using at least parts of the software one is working on. Facing such tasks separates the men from the boys. :-P I am not talking about programming. Programming is easily learned and teached. I talk about software development, design, and architecture.
Current, I work with friends on the creation of the THElib, as successor and replacement of the infamous VISlib. The VISlib has several design errors which we cannot fix due to strong dependancies with other software projects. Of course, we are not rewriting THElib from scratch. She is based on large portions of the VISlib, streamlined and corrected. But here we face a huge foundation of legacy code we need to cope with. It is simply not simple.