Timeline for Which language features are considered harmful?
Current License: CC BY-SA 2.5
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 21, 2012 at 7:51 | history | made wiki | Post Made Community Wiki by ThiefMaster | ||
Nov 27, 2010 at 1:09 | comment | added | Orbling | Fallthrough is an excellent feature; having it as a default rather than requiring it to be told to do it isn't. However... so many heavily used C-derivative languages do it that programmers are used to it and should be especially aware of the risk. I'm not a fan of the compiler hand-holding and nannying the coder. | |
Sep 24, 2010 at 18:05 | comment | added | Tim | I use it a lot - but always comment fallthroughs. I don't see the harm. | |
Sep 24, 2010 at 14:20 | comment | added | Matt Olenik | Does no one read? He said fallthrough BY DEFAULT | |
Sep 24, 2010 at 0:21 | comment | added | Christian Mann | Without fallthrough, things like daysInMonth() would take waaaay more code. | |
Sep 18, 2010 at 5:45 | comment | added | user2528 | i agree. By default is not a good feature. | |
Sep 14, 2010 at 22:20 | comment | added | Jesse C. Slicer | Duff's Device scoffs at your impunity! | |
Sep 14, 2010 at 15:57 | comment | added | Tim Goodman |
@greyfade: It's helpful until you forget the break statement, or someone adds a case between two cases (or re-orders them), not noticing there was fall-through between them. I don't see any way that fallthrough is better than the C# way of requiring either a break or goto case, etc.
|
|
Sep 13, 2010 at 19:00 | comment | added | Shog9 |
This has gotta be one of my favorite parts of switch ... Without fallthrough, there are far more flexible ways of accomplishing the same thing.
|
|
Sep 10, 2010 at 14:24 | comment | added | greyfade | This is always a helpful feature in all of the code I've written. How is this a misfeature? | |
Sep 10, 2010 at 2:03 | history | answered | Niall C. | CC BY-SA 2.5 |