Friday, 5 December 2014

A nerd's java practices, might not be universal though

Here's what a java nerd thinks on practices while coding. 
Purpose could be to 
* make beautiful code,
* improve perf
* improve readability etc

1. class members vs passing args between internal methods

Prefer class members or passing arguments between internal methods?

Do methods in class instances take a place in memory?

2. Temp variable in foreach iteration of a large loop

Temporary variable used for each iteration of a large loop, strings are immutable so what should I use?

3. Immutability habit (an affair with final) 
Immutability are to simplify a program, here's what the veterans have to say;
"Classes should be immutable unless there's a very good reason to make them mutable....If a class cannot be made immutable, limit its mutability as much as possible." - Joshua Bloch
"Immutability Fosters Concurrent Programming." - clojure
If immutable objects are good, why do people keep creating mutable objects?

Excessive use “final” keyword in Java

Wikileaks To Leak 5000 Open Source Java Projects With All That Private/Final Bullshit Removed



No comments:

Post a Comment