Death of Trip in Enterprise

Just finished the fourth season of Enterprise. Realised that there is something wrong about the death of Trip. He's not stupid, indeed he's always a smart guy. How come the script writer wrote him carrying out such a stupid plan to beat those alien intruders. What a poor ending for Trip, who is the most passionate character in the story!