Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 123788

A setter is a method used to control changes to a variable. It's most often used in object-oriented programming, in keeping with the principle of encapsulation.

1
vote
As opposite examples, in Objective-C or Swift you won't see any setThing anymore, and there never was a getThing. In modern use, you have properties in Objective-C and variables in Swift, which are us …
answered Jul 15 '15 by gnasher729
2
votes
You say "The only case I think you have to use getters and setters is if you need to do some operation besides the set or the get. ". You should use getters and setters if at some point in the … future you might need to do some operation besides the set and get and you don't want to change thousands of lines of source code when that happens. You should use getters and setters if you don't want …
answered May 15 '15 by gnasher729
3
votes
Everybody and their dog uses zero based indexes. Using one-based indexes inside your application will cause you maintenance problems forever. Now what you display in a user interface, that is entire …
answered Jul 10 '15 by gnasher729
2
votes
What all these methods have in common is that the update to multiple properties is only atomic if everybody updating the properties uses the same method, but also everybody reading the properties and …
answered Jan 27 '16 by gnasher729