Timeline for Is it OK for a function to modify a parameter
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 13, 2012 at 14:26 | comment | added | Random42 | @Telastyn I was speaking in the general case; good practices cannot be respected 100%. In his particular case no one can infer what is the best way from 5 lines of code... | |
Aug 13, 2012 at 14:25 | comment | added | Random42 | @StephenC I was saying that you should call that method on the report object; in this case there is no meaning in passing the same object as a parameter. | |
Aug 13, 2012 at 12:26 | comment | added | Telastyn | It's okay... it should be avoided, but in this case LINQ to SQL is doing the parameter modification so it's not like the OP could avoid that without the hoop jumping clone effect (which is its own violation of SRP). | |
Aug 13, 2012 at 9:39 | comment | added | Stephen C |
Ermm ... what if db.Reports.InsertOnSubmit(report) calls the change method on the object?
|
|
Aug 13, 2012 at 9:30 | history | answered | Random42 | CC BY-SA 3.0 |