Proleps
Joined 17 years ago
Joined 17 years ago
Although it is something I think about from time to time, I am sticking to the job I have for a while. I learn a lot on the job and it's a nice place to work.
True. It would be nice if Java had some immutable collection classes that don't have mutable methods. A method that gets a List<String> made with Collections.unmodifiableList(tags), doesn't know that it is actually immutable.
Then it wouldn't be immutable, if I can change the implementation I can also create a mutable version.
Edit example
public class Article {
private final String title;
private final String author;
private final List<String> tags;
private Article(String title, String author, List<String> tags) {
this.title = title;
this.author = author;
this.tags = tags;
}
public String getTitle() {
return title;
}
public String getAuthor() {
return author;
}
public List<String> getTags() {
return tags;
}
}
public class MutableArticle extends Article {
private String title;
private String author;
private List<String> tags;
public MutableArticle() {
super(null, null, null);
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
} public final class Article{
public final String title;
public final String author;
public final List<String> tags;
public Article(String title, String author, List<String> tags) {
this.title = title;
this.author = author;
this.tags = tags;
}
}
Getters don't seem very useful on an immutable object.[Edit] Changed negative reinforcement to punishment, rbehrends was correct when he pointed out that negative reinforcement is something different.
I don't really know what these numbers are supposed to show. I've shared content that I've later regretted sharing, but it wasn't a lot of regret. If someone had asked me that question in a survey I would have probably answered yes, but it wouldn't really mean anything.
I've also deleted people from my network, but that was because I didn't really care about them. I can't really find any important information in these numbers