Favour immutability
Course Content
0 / 34 completedWho should take this course
How to use this course
Choose primitives over boxed primitives
Pick the right data type for ids
Don’t concatenate many strings
Watch out for float and double precision
Understand date and time challenges
Always use @Override
Validate parameters
Pick the scope of method responsibility carefully
Return appropriate results
Design method signatures carefully
Restrict access as much as possible
Consider using static factory methods
Design utility classes correctly
Use dependency injection
Consider using builders
Favour immutability
Throw appropriate exceptions
Throw exceptions in if blocks
Design catch blocks carefully
Use meaningful error messages
Java 7 Use try-with-resources
Java 10 Use var correctly
Java 1421 Prefer switch expressions and pattern matching
Java 14 Use records
Follow popular naming conventions
Use libraries
Program to interfaces where appropriate
Don’t optimise code too early
Congratulations!
Follow unit test best practices
Avoid Java serialisation
Package by feature, not by layer