Timeline for Should I make a variable readonly when I modify it, but I don't actually set it outside of the constructor?
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 9, 2013 at 18:44 | comment | added | It'sNotALie. | It's similar, but doesn't answer my question as it's talking about parameters and locals. | |
Aug 9, 2013 at 18:29 | comment | added | Cameron | If you don't plan on adding a method that allows callers to set the list itself, then yes. It doesn't hurt anything and will cause an error if you do reassign it. You might want to read through the reasoning in http://programmers.stackexchange.com/questions/48413/ for a similar question in Java. | |
Aug 9, 2013 at 18:24 | comment | added | It'sNotALie. | I know. However, should I do it is the main point of my question. | |
Aug 9, 2013 at 18:22 | history | answered | Cameron | CC BY-SA 3.0 |