Thursday, December 17, 2015

Book Reading: Effective Java

Dec. 17, 2015

Effective Java is such a great book, I had wonderful time to read 1-2 hours while enjoying the travel on train back to my home  town this October, 2015.

But, Julia had to motivate her more to complete reading the book - at least spend over 10 hours this holiday break to catch up some best ideas about programming.

Dec. 17, 2015  (20 minutes reading)
Item 52: Refer to objects by their interfaces (julia's rating 1-10: 10)

Dec. 18, 2015 ( 2 hours reading 8:00pm-10:00pm)
Item 23: Don't use raw types in new code
Item 24: Eliminate unchecked warnings
Item 25: Prefer lists to arrays
Item 40: Design method signatures carefully
Item 45: Minimize the scope of local variables
Item 46: Prefer for-each loops to traditional for loops

Dec. 19, 2015 ( 2 hours reading 8:30am-10:30am)

Item 6: Eliminate obsolete object reference (read the item twice)
Actions: take sample code, and think about similar example, write a one in C#, check in github
Notes:
3 cases for memory leaks:
1. whenever a class manages its own memory,
2. caches  - WeakHashMap
3. listeners and other callbacks
Careful code inspection or with the aid of a debugging tool known as a heap profiler
Action item 2: Try heap profiler in C#

Item 8: Obey the general contract when overriding equals (read again, 30 minutes)

Further reading:
WeakHashMap
http://www.ibm.com/developerworks/library/j-jtp11225/

Read some code, and then, go back to the book.
http://www.codeproject.com/Articles/595160/Understand-Liskov-Substitution-Principle-LSP

http://www.codeproject.com/Articles/648987/Violating-Liskov-Substitution-Principle-LSP

http://www.codeproject.com/Articles/597870/Liskov-Substitution



No comments:

Post a Comment