javascript | java | best practices