« first day (4267 days earlier)      last day (665 days later) » 

12:00 AM
Real wealth can only increase. -- R. Buckminster Fuller (source)
 
 
2 hours later…
1:50 AM
uses java.io.File
 
2:05 AM
@OakBot Slaps @OakBot around with a shiny java.nio.file.Files API.
 
@JohannesKuhn Type /help to see all my commands.
 
/help
 
> My commands are also listed here: github.com/JavaChat/OakBot/wiki/Commands
 
/reflection
 
Are you seriously considering to use reflection for your code? Just don't..
 
2:07 AM
/ej !list
 
ej:
Displays items from the book "Effective Java, Third Edition" by Joshua Bloch.

Examples:
/ej !list : Lists all items.
/ej !random : Displays a random item.
/ej 5 : Displays item #5.
/ej string : Displays all items that contain the keyword "string".

Alias: bloch
Item 1: Consider static factory methods instead of constructors
Item 2: Consider a builder when faced with many constructor parameters
Item 3: Enforce the singleton property with a private constructor or an enum type
Item 4: Enforce noninstantiability with a private constructor
Item 5: Prefer dependency injection to hardwiring resources
Item 6: Avoid creating unnecessary objects
Item 7: Eliminate obsolete object references
Item 8: Avoid finalizers and cleaners
Item 9: Prefer try-with-resources to try-finally
 
/ej 16
 
Item 22: Use interfaces only to define types
Interfaces should be used only to define types. They should not be used merely to export constants.
(source: Effective Java, Third Edition by Joshua Bloch, p.107)
Item 16: In public classes, use accessor methods, not public fields
Public classes should never expose mutable fields. It is less harmful, though still questionable, for public classes to expose immutable fields. It is, however, sometimes desirable for a package-private or private nested classes to expose fields, whether mutable or immutable.
(source: Effective Java, Third Edition by Joshua Bloch, p.78)
 
/ej 7
 
Item 7: Eliminate obsolete object references
Memory leaks in garbage collected languages (more properly known as (unintentional object retentions) are insidious. If an object reference is unintentionally retained, not only is that object excluded from garbage collection, but so too are any objects referenced by that object, and so on. Even if only a few object references are unintentionally retained, many, many objects may be prevented from being garbage collected, with potentially large effects on performance.
 
2:10 AM
/ej 17
 
Item 17: Minimize mutability
Immutable classes are easier to design, implement, and use than mutable classes. They are less prone to error and are more secure.
(source: Effective Java, Third Edition by Joshua Bloch, p.80)
 
/ej 18
 
Item 18: Favor composition over inheritance
Inheritance is powerful, but it is problematic because it violates in encapsulation. It is appropriate only when a genuine subtype relationship exists between the subclass and the superclass. Even then, inheritance made lead to fragility if the subclass is in a different package from the superclass and the superclass is not designed for inheritance. To avoid this fragility, use composition and forwarding instead of inheritance, especially if an appropriate interface to implement a wrapper class exists. Not only are wrapper classes more robust than
 
/ej 65
 
Item 65: Prefer interfaces to reflection
Reflection is a powerful facility that is required for certain sophisticated system programming tasks, but it has many disadvantages. If you are writing a program that has to work with classes unknown at compile time, you should, if at all possible, use reflection only to instantiate objects, and access the objects using some interface or superclass that is known at compile time.
(source: Effective Java, Third Edition by Joshua Bloch, p.282)
 
2:15 AM
/ej 84
 
Item 84: Don't depend on the thread scheduler
Do not depend on the thread scheduler for the correctness of your program. The resulting program will be neither robust nor portable. As a corollary, do not rely on Thread.yield or thread priorities. These facilities are merely hints to the scheduler. Thread priorities may be used sparingly to improve the quality of service of an already working program, but they should never be used to "fix" a program that barely works.
(source: Effective Java, Third Edition by Joshua Bloch, p.336)
 
 
10 hours later…
12:20 PM
posted on June 29, 2022

archive - contact - sexy exciting merchandise - search - about ← previousJune 29th, 2022nextJune 29th, 2022: Hey, I'm writing a Star Trek: Lower Decks comic! I sent in a statement for the announcement but they didn't use any of it, for some reason??– Ryan

 
 
2 hours later…
1:54 PM
/ej 15
 
Item 15: Minimize the accessibility of classes and members
You should reduce accessibility of program elements as much as possible (within reason). After carefully designing a minimal public API, you should prevent any stray classes, interfaces, or members from becoming part of the API. With the exception of public static final fields, which service constants, public classes should have no public fields. Ensure that objects referenced by public static final fields are immutable.
(source: Effective Java, Third Edition by Joshua Bloch, p.73)
 
 
8 hours later…
9:32 PM
 

« first day (4267 days earlier)      last day (665 days later) »