No, it's not about rewritting the code 3 times, but there are a lot of stuff you have to add or substract (not only from the code, a lot of resources too). A simple thing like the way the PS4 controller works changes a lot of stuff, and that's only a small example.
I feel you about rewriting the codes 3 times. My nephew who studied game programming told me about all this. It's the same with the graphic design work in the web design full of HTML and CSS codes.
@shura30 , bro, it's not easy to just port it. Back then it had different codes for each console. If you just port it this way, you risk it being full of glitches and bugs (see Watch_Dogs). They NEED to rewrite this code and review it to get rid of the bugs and the glitches. Now they started having a mutual code (see Unity). Those graphic machines are independent, because they were created by these very creators (CDP, Kojima Productions, etc).
The same is applied everywhere. In my case as a music producer, if I wanted to make an old track very good and hearable, then I have to remaster it by going to the mastering procedure. Creating a track is a hassle, but mixing and mastering it is WAY more of a hassle.
The same goes for the graphic designer to make perfect business cards, flyers, big flyers, books, etc.
Everything is a procedure before being perfect. We all learned the basics, but we lacked the experience from the start. So, please, give it a rest, if you understand how things process.