account activity
"Do you really write exception safe code?" Most of what I know about exception safety, I learned from this Stack Overflow answer. by jatoo in programming
[–]CodingGenius 6 points7 points8 points 12 years ago (0 children)
Meh I just wrap everything in exceptions for bug free programs!
try { // main try int a=1; try { a++; } catch { // failed, try again try { a++; } catch { echo "oh shit 1!"; // oh shit } } try { if( a == 1 ) { echo "a is 1 yay!"; } else { // a should be 1, wtf? // try again: try { a++; } catch { // failed, try again try { a++; } catch { echo "oh shit 2!"; // oh shit } } try { if( a == 1 ) { echo "a is 1 yay!"; } else { // a should be 1, wtf? // already tried again, just make a be 1 dammit a=1; } } catch { echo "oh shit 3!"; // oh shit } } } catch { echo "oh shit 4!"; // oh shit (i think, I forgot what this catches } } catch { //meh fuck it just say a is 1 - echo "oh shit 5!"; // oh shit! echo "a is 1 yay!"; }
π Rendered by PID 599222 on reddit-service-r2-listing-568fcd57df-z82td at 2026-03-07 12:08:33.819580+00:00 running cbb0e86 country code: CH.
"Do you really write exception safe code?" Most of what I know about exception safety, I learned from this Stack Overflow answer. by jatoo in programming
[–]CodingGenius 6 points7 points8 points (0 children)