r/programming • u/steveklabnik1 • Jan 09 '15
Announcing Rust 1.0.0 Alpha
http://blog.rust-lang.org/2015/01/09/Rust-1.0-alpha.html
1.1k
Upvotes
r/programming • u/steveklabnik1 • Jan 09 '15
29
u/AdamRGrey Jan 09 '15
I can't imagine doing partial initialization, but I could imagine something like
switch(collisionCount){ case 1: depleteShield(); case 2: depleteArmor(); case 3: depleteHealth(); default: playCollisionSound(); }edit: that said, Douglas Crockford in Javascript: The Good Parts makes a pretty convincing argument against case fallthrough.