Arduino Mega or DUE?

This post is quite old but i wanted some help understanding one difference in Due and Mega.

Is the code written for Mega compatible with Due or will i have to make some changes?