I will slightly simplify this question before answering it.
My main developer (a nice guy) asks me to write in a coding style that I do not agree with. What should I do?
The developers do not agree. Stick two in one room and you will get three opinions …
Is it really important? In this case, I would say that is the case:
- The big functions make it difficult to follow the principles of DRY
- The big features are harder to test
However, this main developer (and this is where the job title varies) probably has something in his job description regarding the maintenance of coding standards and technical quality. It's his responsibility, not yours. The company pays you to follow the rules established in your team.
You have to weigh this carefully because it seems that following his advice will make it difficult to write a good code. My suggestion would be to write the code as you would (unless you have given it a hard time for a while, in which case it may seem antagonistic). When you peer review, explain that you did it in an X way so that you could write this test or that someone else could reuse Y. Do not write that would mean that you would not can get that a Z% code coverage.
You say that he's a nice guy and, hopefully, that he'll listen and be open to the conversation. It may be that he is aware of something that you (and we are not). But I repeat … his job is to set the standards and it is not easy.
If after a few attempts (you will have to judge), you are still at a dead end, you must either do what you are asked for or look somewhere for the codes you want (index, no business is perfect). I hope this will not happen at this point, IMHO coding in a bad style for a good boss is always better than the alternative.