http://www.polygon.com/2017/3/2/14792066/nintendo-switch-friend-code-response
Seems that friend codes are temporary and will become optional in the future (probably when the paid online launches).
Here's the full statement from Nintendo -
"Several methods can be used to add friends as quickly and easily as possible: · By linking Nintendo Switch to your Nintendo Account, your friends from Miitomo and Super Mario Run will appear as friend candidates so you can easily send them a friend request. Also, we are planning it so that friends from social networking services will be listed as candidates, too.
In the future, you will be able to send a friend request to friends associated with your NNID (Wii U/Miiverse) and Nintendo 3DS.
In some games you will be able to use an in-game interface to send friend requests.
You can send friend requests to those who have played with you recently.
You can establish a friend through local wireless communication.
You can also send a friend request by using a friend code."








