Recently I started my first job as a junior developer and I have a more senior developer in charge of mentoring me in this small company. However, there are several times when he would give me advice on things that I just couldn't agree with (it goes against what I learned in several good books on the topic written by the experts, questions I asked on some Q&A sites also agree with me) and given our busy schedule, we probably have no time for long debates.
So far I have been trying to avoid the issue by listening to him, raising a counter point based on what I've learn as current good practices. He raises his original point again (most of the time he will say best practice, more maintainable but just didn't go further), I take a note (since he didn't raise a new point to counter my counter-point), think about it and researched at home, but didn't make any changes (I'm still not convinced). But recently he approached me yet again, saw my code and asked me why haven't I changed it to his suggestion. This is the 3rd time in 2--3 weeks.
As a junior developer, I know that I should respect him, but at the same time I just can't agree with some of his advice (I don't like his programming style too but that another issue). Yet being pressured to make changes that I think will make the project worse. Of course as an inexperienced developer, I could be wrong and his way might be better, it may be 1 of those exception cases
My question is: what can I do to better judge if a senior developer's advice is good, bad or maybe it's (good but outdated in today context)? And if it is bad/outdated, what tactics can I do to not implement it his way despite his 'pressures' while maintaining the fact that I respect him as a senior.
Update
Went to office today, apologised and begin rolling out the changes I prepared before hand as today is a very free day. Later on in the day a twist happened though, a even more senior developer who came back recently approached me to introduce himself and also to look at my current work to see if I have any problems. 1 of the 1st thing he starts nicpicking on alot however, are the changes I have made as per the mentor request.
At this moment, I paused for a while on should I raise my own version up and get to know his opinion (but doing so may also risk offending my mentor depending on what type of person it is). In the end, I decide to raise my own version up as I feel a need to take this oppunitity to learn, he takes a look at it and eventually decided it's way much better and overrulled my mentor decision and so I reverted it back to my original while my mentor didn't say anything.
While I won the battle to keep my code, I do not call it a victory as it probably also comes at the expense of hurting my working relationships with a colleague. I do still have doubts however on did I handle things well enough this time.
The many answers and comments here have made me realise my naive ways of doing things, I have pretty much didn't take the human factor into account, always believing that a better shipped product is more important than pleasing colleagues/client. I also shouldn't be so persistent and take a more pragmatic view on issues. I got to improve. Thanks a lot on the many suggestions and views on this issue.