Timeline for Alternative to nested-if on single return functions
Current License: CC BY-SA 4.0
22 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 22, 2019 at 15:00 | history | tweeted | twitter.com/StackSoftEng/status/1197892650512396289 | ||
| Nov 15, 2019 at 6:20 | answer | added | Greg Nisbet | timeline score: 0 | |
| Nov 14, 2019 at 23:47 | comment | added | ianmandarini | I would add the fact that it is a C Programming Language question in the answer (clearly stated - not only in the tag). For instance, an answer that involves saying that Exceptions should be thrown is not a valid one (I almost did that). | |
| Nov 14, 2019 at 23:06 | review | Suggested edits | |||
| Nov 14, 2019 at 23:44 | |||||
| Nov 14, 2019 at 22:36 | answer | added | ianmandarini | timeline score: 2 | |
| Nov 14, 2019 at 20:03 | comment | added | Arseni Mourzenko | @DocBrown (and @Flater): note that C tag in the question, which means that it is not an arbitrary/outdated rule it would be if we were talking about C# or Python or similar languages. | |
| Nov 14, 2019 at 18:47 | vote | accept | Saxpy | ||
| Nov 14, 2019 at 18:38 | history | edited | Saxpy | CC BY-SA 4.0 | explanation on duplication |
| Nov 14, 2019 at 18:36 | comment | added | Saxpy | @1201ProgramAlarm I think a goto cleanup could potentially be a candidate, but since I am new I've avoided using it since I am not certain about my company's policy on that. | |
| Nov 14, 2019 at 18:35 | comment | added | Saxpy | @Flater To clarify I didn't really mean to ask for suggestions on how to ask my company to break the rule, I meant more of how I could potentially get around the issue in a cleaner way while following company rules. | |
| Nov 14, 2019 at 18:34 | comment | added | Saxpy | @RobertHarvey I am using something similar to malloc unfortunately. | |
| Nov 14, 2019 at 16:01 | comment | added | Flater | @1201ProgramAlarm: I would consider goto a much bigger red flag than the single return principle, even though I don't like either. | |
| Nov 14, 2019 at 16:00 | comment | added | Flater | If your employer enforces an arbitrary rule that is causing an obstacle, then it's up to your employer to decide whether they agree to suspend the arbitrary rule, or accept the obstacle's existence (as a consequence of the arbitrary rule). We can't make or break company policy for you. | |
| Nov 14, 2019 at 6:40 | review | Close votes | |||
| Nov 22, 2019 at 3:05 | |||||
| Nov 14, 2019 at 6:39 | comment | added | Doc Brown | "My workplace requires one return per function" - then your team has either to change that outdated rule or to live with that nonsense. | |
| Nov 14, 2019 at 6:32 | answer | added | user949300 | timeline score: 3 | |
| Nov 14, 2019 at 6:23 | comment | added | gnat | Possible duplicate of Elegant ways to handle if(if else) else | |
| Nov 14, 2019 at 4:23 | comment | added | Robert Harvey | Early returns are fine if you're not using malloc in your functions. | |
| Nov 14, 2019 at 3:50 | answer | added | Kain0_0 | timeline score: 6 | |
| Nov 14, 2019 at 2:00 | comment | added | 1201ProgramAlarm | This is one of the bad things about single return. And I assume using the dreaded goto is completely out of the question? | |
| Nov 14, 2019 at 0:50 | review | First posts | |||
| Nov 15, 2019 at 10:42 | |||||
| Nov 14, 2019 at 0:46 | history | asked | Saxpy | CC BY-SA 4.0 |