1. In a saucepan, whisk together sugar, flour, and salt. Gradually whisk in milk.
2. Cook over medium heat, stirring constantly, until the mixture thickens and comes to a boil. Boil for 1 minute, then remove from heat.
3. Gradually whisk about 1 cup of the hot mixture into the beaten egg yolks, then return the egg mixture to the saucepan. Cook for 2 more minutes, stirring constantly. Remove from heat and stir in butter and vanilla.
4. Layer sliced bananas and vanilla wafers in a baking dish. Pour the pudding mixture over the layers.