Are you guys in a team environment? Is teamwork something that is important to your bosses? If so, I would approach your colleague and let them know that while you appreciate their advice, you feel that on occasion they are not reciprocating the same respect for your skillset that you do for them. Let them know you guys are teammates and it should be a joint goal to work together and enhance each other’s skills through sharing your experiences. If he still acts like an ass, and it’s counterproductive to YOUR workflow, then go to your boss about it. Many people think they are helping others out when in reality they are coming off as arrogant.
Note that this assumes you guys are at the same level in the company.
SOURCE: worked in software development teams with socially awkward pricks that thought they knew it all.