2 ms·
I did something similar over last year at work. I put a section called "Insight from today" in the default template I use(d) for everyday work notes, in which I
by TeMPOraL 9y ago
I did something similar over last year at work. I put a section called "Insight from today" in the default template I use(d) for everyday work notes, in which I wanted - hoped - to put something new I've learned.
Turned out, I'm not learning new things too much at my $dayjob (or my attitude is wrong). Ultimately, I was disappointed, but it made me reconsider just how much I'm really implicitly learning - turns out that more often than not, those are irrelevant minutiae instead of more fundamental facts. I favor more explicit, focused learning now.
Most notes were obviously about code (Java, JavaFX), some about my mental state while coding. Some more interesting ones:
-
There are some serious reasons[0] for Java not to have Pair<K,V> or Tuple classes in its standard libraries.
They mostly boil down to avoiding people using Pairs as cons cells to avoid creating classes
that would properly name and give meaning to what is being composed and why.
-
TabPane in JavaFX has a division-by-zero exception in the arrow keys handler when you have 0 tabs in the pane. Note, modulo op (%) can cause division by zero too. Obviously.
-
Storing trees (hierarchical data) in a database -- closure tables.
Explanation: [1], HN thread: [2].
-
Thread.setDefaultUncaughtExceptionHandler FTW.
-
Switch-case has lexical scoping on the entire switch block. Example:
switch(something) {
case foo:
String abc = "xyz";
break;
case bar:
//String abc = "uvw"; //wrong - abc already exists; it's scoped for the entire switch
//System.out.println(abc); //wrong - though abc exists, it won't be initialized in this case block
}
For per-case scoping, we need explicit blocks.
Nice trick question for an interview, lol.
-
Stress is bad.
--
[0] - http://stackoverflow.com/questions/24328679/does-java-se-8-have-pairs-or-tuples http://stackoverflow.com/questions/24328679/does-java-se-8-h...
[1] - http://www.slideshare.net/billkarwin/models-for-hierarchical-data http://www.slideshare.net/billkarwin/models-for-hierarchical....
[2] - https://news.ycombinator.com/item?id=13127938 https://news.ycombinator.com/item?id=13127938