Timeline for Different way of writing multiple click functions
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 7, 2012 at 1:24 | comment | added | Corbin | @JamesKhoury Have updated it to be more specific :). | |
Nov 7, 2012 at 1:23 | history | edited | Corbin | CC BY-SA 3.0 |
added 1482 characters in body
|
Nov 5, 2012 at 4:02 | comment | added | Corbin | @JamesKhoury I should have been a lot more specific in my answer, I suppose. A switch that controls the functionality of a function is typically a bad sign (or a switch-fallthrough type construct like his example uses -- not sure now why I read that as a switch). It means that potentially disjoint functionalities are being crammed into the same place for convenience. (Or, in some situations, because responsibilities are not placed in the right segments.) I don't have time now, but I will update my answer later. | |
Nov 5, 2012 at 3:52 | comment | added | James Khoury | I agree with the TL;DR part. Separate handlers for separate ideas but the rest of this is not really an answer. Why are switch statements typically a bad sign? How can this be improved using this idea that the handlers can stay separate? | |
Nov 4, 2012 at 6:30 | history | answered | Corbin | CC BY-SA 3.0 |