unlearning java
TRANSCRIPT
Unlearning JavaOne time ‘best practices’ to avoid; to remain ‘Professional’
Naresha K,@naresha_k
Why Unlearn?
Myth of ‘Best Practices’
Technically Perfect
Completely Useless
The costly mistake !
Time
Domain
#1: Follow the Evolution
#1 - illustration
#1 - illustration
#1 - illustration
#1 - illustration
#1 - illustration
More Examples� isEmpty
� @Override (annotations)
#2: Make ‘em readable
#2 - illustration
Prefer Generics
#2:� Generics◦ Method signature shows the types◦ Less documentation
� Enum◦ Allowed values are clearly shown
#3: Understand the internals
#3: Understand the internalsUse generics right
#4: Prefer concise code
#4 - illustration
#4 - illustration
#4 – Truth revealed
#4 – illustration – the truth
#5: Be precise
#5: Be precise
Reduce Maps
Use Strong Types
#6: Don't over optimize
#6: Don't over optimize
#6: Don't over optimize
#6: Don't over optimize
#7: More the loan term, ...interest
#7: More the loan term, ...interest
Essential Complexity
Accidental Complexity
Software Complexity
#7: More the loan term, ...interest
Technical Debt
•Letting the accidental complexity to grow
#7: More the loan term, ...interest
Refactor Small
Refactor Often
#8: Don’t carry dead bodies
#8: Don’t carry dead bodies
Hungarian Notation
#8: Don’t carry dead bodies
#9: The billion dollar mistake
#9: The billion dollar mistake
Avoid excessive null checks
#10: Put your data structures knowledge into practice
#10: Put your data structures knowledge into practice
#10: Put your data structures knowledge into practice
� Dropdown options◦ Average expense on First Day of the month◦ Average expense on Last Day of the month◦ Percentage of expense on First 3 Days◦ Percentage of expense on Last 4 Days◦ Total expenses on First 5 days in each month◦ Month with max expense
#10: Put your data structures knowledge into practice
ExpenseDayMonth
Map
Map<Date,DailyExpense>
DailyExpense1
DailyExpense2
Map<Date,DailyExpense> DailyExpense3
#11: Develop Abstractions
#11: Develop Abstractions
#11: Develop Abstractions
#12: Don't write novels in plain JS, write poems in Dojo
#13: Automate - analysis, not fix
#13: Automate - analysis, not fix
someCodeValueId.equals(someCodeValue)
someString!= null || !someString.equals(“”)
someLong != null || someLong.equals(“”)