How to know if you are working in the right project
As stated in Practical Object-Oriented Design, programmers don't need to choose between pleasure and productivity. "The programming techniques that make code a joy to write overlap with those that most efficiently produce software".
I interpret this as a fundamental principle of my profession, and a corolary to this is: if you're working on a project where writing code is not a joy, there's something wrong in the project and you must do something about it.
Things to consider:
- See if the managers understand and encourage the importance of having high quality code. Do they understand that good code implies productivity?
- See if your team mates care about code quality (it can be overwhelming if you are the only one caring about improving the code quality).
- Observe if code quality is getting better or worse over time.
- finally, ask yourself if you really care about the project. If the pain to work with the messy code is bigger than your will to address the issue alone, maybe you should look for another project.