This is the real answer. Stop being so attached to your code. You're getting paid a good wage to write stupid code that doesn't need to exist? Just voice your concerns, and then, if those who "know better" (tech leads, VPs, directors, founders) make you write it anyway? Laugh and enjoy!