It all depends on the airplane and the circumstances. In most light airplanes, 10 degrees of flap will help, not hurt. What are you trying to do with the airplane? So often, students are told to plan on achieving "best glide" speed in order to maximize distance. However, in many cases, this isn't what's needed.
Light airplane pilots are constantly told to be looking for an emergency landing site. It's a valueable attribute to hold. Accordingly, one should be close by. It may not be a runway, but a field is as good as a road, which is as good as a taxiway, etc. This in mind, very often the landing site is right beneath you. Gliding the farthest distance isn't really what's needed in such a case.
A more useful speed, but one seldom addressed or taught, is minimum sink speed. This is typically less than best glide speed, and is a speed at which the minimum descent rate will be achieved. The airplane won't glide as far, but it will take longer to get down. The descent provile will be steeper, though it will take longer. As a very basic rule of thumb, best glide is typically close or approximate to best rate of climb. Minimum sink is typically close, or approximate to Vx, or best angle airsped.
In many airplanes, a low flap setting can enhance controllability, and decrease stall speed. Not all, but many. Retracting flaps may increase stall speed. A pilot is typically directed not to remove all flaps, but to retract them to a spedific minimum setting before moving on to gear and other checklist specific items.
Typically with flaps set for takeoff, they should be left alone during an engine-failure. If flaps for some reason have been placed to a greater position than takeoff, they should typically be retracted to the takeoff position.
The type of flap makes a difference. Split flaps do very little good no matter what the setting when contrasted with the need for drag reduction. Retract them. With other flap systems, it may be benificial to leave partial flap down. You may be in a situation wherein failure of other systems or loss with powerplant loss may mean that you can't get gear and flaps later. In such a case, view your situation as a gift, keep what flaps you have applied.
Did you really cheat death? He must be upset.