In practice, the application program code written for MongoDB does not need to change when performing reads and writes to a replica set. If your application code works well for a single mongod instance, it works well when accessing a replica set. In other words, just because you move your working application code over to a replica set does not mean it suddenly stops working!
There are some considerations, however, that might improve application performance by taking advantage of potential performance enhancements made possible by the replica set. There is also the question of which server to connect: should your application connect to the primary, or is it OK to connect to a secondary? Let's start with a basic replica set connection.