Timeline for Are "in" parameter modifiers considered a code smell?
Current License: CC BY-SA 4.0
14 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 5, 2020 at 20:46 | history | edited | Glorfindel | CC BY-SA 4.0 | broken link fixed |
| Dec 23, 2019 at 6:00 | history | tweeted | twitter.com/StackSoftEng/status/1208990749863424000 | ||
| Dec 17, 2019 at 15:20 | vote | accept | Reap | ||
| Dec 15, 2019 at 20:38 | answer | added | Sebastian Redl | timeline score: 18 | |
| Dec 14, 2019 at 10:56 | comment | added | Christophe | Note that SOLID are principles for class design and do not address parameter passing | |
| Dec 14, 2019 at 10:56 | answer | added | Ewan | timeline score: -5 | |
| Dec 14, 2019 at 10:55 | history | edited | Christophe | edited tags | |
| Dec 14, 2019 at 10:40 | comment | added | Theraot | Now, that I am talking about it, out is also a parameter passed by reference. And also allows the modification just like ref. Except it guarantees that the value will be initialized by the method, and the compiler checks that. | |
| Dec 14, 2019 at 10:35 | comment | added | Theraot | Let us be clear... an in parameter is passed by reference. Usually C# prevents the modification of parameters passed into the method by making a copy, which is the default. Thus, the purpose of in is not to prevent the modification of parameters. If you want to allow the modification of the parameters, you opt out with ref (do not confuse with reference types). The purpose of in is to avoid the copy. Since no copy is done when using in, the constraint of not modifying the parameter has to be enforced by your code, the compiler checks that. Again, if you want to modify it, use ref. | |
| Dec 14, 2019 at 10:27 | answer | added | Rik D | timeline score: 4 | |
| Dec 14, 2019 at 8:30 | review | Close votes | |||
| Dec 23, 2019 at 3:05 | |||||
| Dec 14, 2019 at 5:06 | answer | added | Jakob Busk Sørensen | timeline score: 1 | |
| Dec 14, 2019 at 0:45 | review | First posts | |||
| Dec 16, 2019 at 19:32 | |||||
| Dec 14, 2019 at 0:41 | history | asked | Reap | CC BY-SA 4.0 |