I hate getters and setters in java. Half of my code is filled with them. They are pointless boilerplate code that says nearly nothing. 99.9% (I made that number up, but it sounds reasonable) percent of the cases they don't have any additional code in them.
And it is really hard to see whether a variable is read-only/read-write/write-only. You have to find the getters/setters to see that.
I have a notation where I put all the modifiers at the end of the class and separate them with a page of whitespace.
I don't like the C# solution - it's not really shorter, only binds the getter and setter together.
I have a proposition: use annotations:
private boolean subscribedForEmailNotification;
And one wants to write extra code, one should be able to use the old notation. The compiler will check for collisions.
I don't see any reason why this cannot become the next syntactic sugar in java where one saves a bunch of useless code-writing.
Suppose you would like to have firefox 3, 4 and now 5 simultaneously. Unfortunately renaming applications is not possible via Finder.
Suppose you have firefox3 installed. Do the following:
$ cd /Applications
$ mv Firefox.app "Firefox 3.app"
Then install firefox4 and do that
$ mv Firefox.app "Firefox 4.app"
Install firefox5 and then:
$ mv Firefox.app "Firefox 5.app"
Now you would have all three versions:
$ ls -a | grep Firefox
The even show up correctly in Applications tab:
(I messed up in renaming and Firefox 4 is actually Firefox4)
Note: unfortunately you cannot launch them simultaneously since Firefox has a mechanism to check if it is already running.
This is a note-to-self. So when I forget the solution I can come back here and find it.
IntelliJ IDEA is one of the best Java IDEs. More here.
I have had the problem of not being able to save the password of a test svn repository. I found the solution:
- vi ~/.subversion_IDEA/servers
- add the following lines:
store-passwords = yes
store-plaintext-passwords = yes
- Save and restart Idea.
- Play around with the changes tab until a popup shows up that asks for credentials.
- Give the credentials and click <Save the credentials> or whatever it says.
- That's it.
This is a presentation I just gave on Bulgarian Java User Group (BGJUG). The topic is Distributed Version Control Systems (DVCS). The main DVCSs mentioned are Mercurial and Git.
Here it is:
Btw, consider it absolutely free. But if you mention my name I'd be grateful.