Young Anakin Skywalker may have been reckless, but the older Darth Vader is anything but.

Note that Vader isn't generally on the front lines, with the exception of the first Battle of the Death Star.  He boarded the *Tantive IV* while his troops were mopping up after the vessel was mostly secure.  He did the same on Hoth, and while he entered Cloud City before it was secure, he was entering a civilian environment with an overwhelming military force and no resistance.  This is not out-of-line with the behavior of a General in any army.  Yes, there may be still be fighting occurring when a General enters into a newly-secured area, but he usually enters into it **after** it is mostly secured; unless things go badly awry, he's not on the front line.

When he did enter the battle directly at both First and Second Death Star, as well as in Cloud City, it was because he was uniquely qualified for the task.  In all three situations, his mastery of the Force played a critical role in the reason he entered the fray.  At First Death Star, his piloting skills also made him uniquely qualified to pursue the young hotshot pilot who was attempting to destroy the station with a snub fighter.  In these situations, he was taking a necessary risk.

Additionally, as noted by @jpmc26 in the comments, Vader didn't put himself directly into the fray at First Death Star.  His mission was specific: Destroy units on their final attack run.  The bulk of the enemy force had been destroyed, and there was little chance that the units on the attack run would be able to effectively counterattack.  He was also flying with two wingmen for cover.  The risk to him was minimal.  That a raging lunatic would choose to fly a freighter into the trench to attack from the rear was a possibility so remote that it could not have been foreseen.