r/programminghorror • [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" • Apr 28 '26

c++ Competitive programming is no joke

Post image

especially for easy problems

149 Upvotes

21 comments sorted by

View all comments

Show parent comment

1

u/LivingVeterinarian47 May 01 '26

exceptions being caught in a closed loop is extremely costly speed wise, it can bring GUI to a stutter. In .NET a lot of the OS level stuff they handle with Exceptions. I think IO.File.Open() will throw 9 different exceptions. Exceptions are great for building tools for others to use, such as a framework or library, but we should really be abstracting them away when at all possible with real production code.

1

u/Last-Autumn-Leaf May 01 '26

Thank I did not know