Learning, Java 9 API changes, and a Lego Monstrosity
CodeFX Weekly #10 — 17th of March 2017
Hi everyone,
this week’s newsletter is a little unusual because it goes deep into one topic: how I learn. After that there will be some Java 9 and Lego to take the edge off.
I send this newsletter out every Friday. Yes, as an actual email. Subscribe!
How Do You Manage Time For Work And New Learning?
I was asked this via Twitter a couple of weeks ago but it took me some time to find out how I wanted to approach the question. Since I’m really no expert on the field (quite the contrary, actually, as you will see in a moment), I felt I had little to add beyond my personal experience. After some time I realized that the question asked nothing else, so I decided to answer based on that.
I guess all I’m saying is your mileage may vary but probably even more than is the norm with these kinds of posts.
A Lazy Learner
I’m pretty sure I’m not a good guy to learn learning from. In school, learning (or even doing homework for that matter) was not something I did particularly often. In most courses I got the grades I wanted without much effort and in the other ones, particularly foreign languages, sitting down to learn always happened with the utmost reluctance and as little as possible.
University was just more of the same. I did more studying of course, but it was always against my will and I had to fight myself every step of the way. Consequently, writing my thesis was hell. That experience scared me out of academics, something I really thought I wanted to do and based all my course choices on.
After university I knew about complexity and decidability theory, model checking, and other crap that is almost useless in everyday coding. But what else can you do with a CompSci degree and an aversion to thinking? Nothing, so I became a software developer. Little did I know…
A Crack Developer
Little did I know how much writing code was exactly up my ally! I love solving problems and coding provided me with the extremely quick feedback loop I needed to enjoy the process. I was like a crack monkey in an experiment, where I always only had to fix one more small thing to get my fix. It was awesome!
At the time, I was working for a research institute that developed (still does, actually) energy market simulations. I was the only “professional” software developer and was supposed to help the other people solve their problems and write better code. These researchers majored in other fields and were only accidentally writing code (although 20 to 40 hours per week). Being able to only just so code my way out of a paper bag I felt grossly unqualified. But I loved the cause (big fan of renewable energy!) and really wanted to help.
I was very lucky because a couple of things came together that made we walk straight past my whole learning aversion:
- an activity (coding) that I had real interest in
- a baseline of knowledge that I was constantly putting into practice, pointing out what else I needed to learn
- an intrinsic motivation to get better
- the social contract to improve and help others
- a quick feedback loop allowing me to soon benefit from what I learned
Except maybe the first bullet, I never experienced those things before and so I didn’t even notice how I started to learn.
A Crack Learner
Still, I think my aversion to actual studying still shows. While I am always told developers should read this or that book, I read few (Code Complete II, Clean Code, and I think there was a third one) and finished less (as far as I remember only Clean Code). Instead I read blogs. Less so now but when I started coding I must’ve been reading blogs about ten hours a week.
This was a largely chaotic process, somewhat guided by what I felt I lacked in skills at work but mostly just whatever I found interesting. This covered everything from Java to software development, to project planning.
Back then I made it a practice to always read about 3 hours at work on Friday morning (hey, they were getting something out of that, too) and when things were particularly stressful. The latter seems counterintuitive but whenever I had too much to do, I figured I needed to improve so I set an hour or two aside and tried to learn about something I was doing at the moment. (I guess you can tell I had no hard deadlines.)
Learning Habits
These experiences formed how I learn today. I still only consume bite-sized information (blogs, mails, Twitter, …) and it is still a largely chaotic process. But that’s good because it keeps the input funnel wide open and I see all kinds of stuff.
I am aware, though, that I soon forget most of what I read about. To really learn something I have to use it. Not just do it as part of an exploration but use it to solve an actual problem I have. I need that technical context, the pressure to solve a problem, and ideally the exchange with others on that problem or the new thing.
The fact of the matter is that learning takes effort, it involves fighting through confusion. And I don’t do that unless I have to!
I have a mental list of things I want to try and it regularly overflows my memory. But every once in a while there is an opportunity to try something new and I usually jump at it.
ReRe, for example, is a small side project that queries the GitHub API. I decided to take the opportunity to try out Kotlin and RxJava, both of which I never worked with before. When starting JUnit Pioneer, I copied JUnit 5’s infrastructure and a welcome side effect was that it forces me to get to know Gradle and Travis. I even installed Gentoo to get myself to interact more closely with Linux.
I purposely put myself into a position where I have to use the new thing. It’s the only way to make sure that I really internalize the information I consume. It’s nice to read about how Kotlin’s type system works or to look at Git from inside out but if I don’t use that knowledge soon most of it will be gone. So I make sure that I will have to use it.
To drive the wordplay home: My learning habit is to learn habits.
Timing
Ok… the original question was how I manage time for work and learning. After all this the answer is:
- I consume a wild flurry of information, largely by browsing the web and reading stuff I find interesting. This happens throughout the day and without much coordination — I am actually trying to fight it because I feel I waste too much time browsing.
- Given the chance I put myself into a position where what I want to study becomes part of my work, thus making the distinction moot. From there on working on a problem and learning about a technology becomes the same thing.
Step 2 is of course easier when you’re self employed but I also did it when I was not — just less so. In that case side projects are the way to go.
Whether you have time for that, of course depends on a lot of factors that you might have no immediate control over. I was lucky that I started work before I had a kid. Working/learning 60 hours per week as I did for the first couple of years is close to impossible when you also want to spend time with your three-year old.
That One Thing
Another thought regarding learning… Do you know that feeling when something happens (it’s usually something bad) and you suddenly remember that you had a passing thought pertaining to it some time back. “Didn’t I see this bug two weeks ago during code review?” “Oh, I think I read that in the release notes.” “I always wondered why that hack worked…”
A couple of weeks back I had an idea I found fascinating but at the moment I don’t have a time slot to implement it. Maybe you do. If so, I would love to hear back from you if you try! It’s actually pretty simple:
Keep something around to make notes (I use Workflowy) and reserve a time slot (maybe 15 to 30 minutes each evening?). Then, every time you don’t follow an interesting thought because you don’t have the time right now, jot it down. When the allotted time comes, pick one and follow up on it.
Java 9
Collections and Streams
On StackOverflow someone asked about which new features Java 9 would bring to the collection framework and stream API. I liked it, so I answered with an exhaustive list. Turns out that Arrays
got the most new methods.
Reactive/Flow API
Again on StackOverflow somebody experimented with the new reactive Flow API and didn’t know how to get the publisher to start publishing. He ran into backpressure: You need to request items before anything starts happening.
On Twitter there was a short discussion about whether RxJava 2.x would be compatible with the new API. Answer: “No. RxJava 3 maybe.”
Process API
Quick tip: You can’t use the handle you get from the static method ProcessHandle::current
to destroy the current process — use System.exit
instead.
The Book
The Java 9 Module System is slowly progressing towards MEAP. Manning has a policy to keep some finished content in stock, so it will only consist of the first three chapters. As I continue finishing more chapters, more will get unlocked in MEAP. Here’s the brief table of contents:
- First piece of the puzzle (MEAP)
- Anatomy of a modular application (MEAP)
- Defining modules and their properties (MEAP)
- Building modules from source to JAR (done)
- Running modular applications (done)
- Compatibility challenges when moving to Java 9
- Modularizing existing applications
- Services — configuring applications with the module path
- Refining dependencies and APIs (WIP)
- Reflection in a modular world
- Runtime images with jlink
- Troubleshooting
As you can see the chapter I’m currently working on is on refining dependencies (implied readability and optional dependencies) and APIs (qualified exports).
Lego
I couldn’t resist any longer and got that monstrous Lego bucket wheel excavator. I bought that particular set because I wanted to spend as much time as possible on building what I buy and I think that plan worked out. So far I’ve been doing it for 16 hours and I think I have about 10 more to go.
And it is awesome! Here’s what I got so far:
Do you see that small human shape in the shadow of the bucket? That’s a regular Lego figurine! When the thing is done it will be about 70 cm long, which is 1% of the original.
Shots
- Use that fucking oxford comma or it can get really fucking expensive!
- I knew about sleep search in O(n) but did you know about existential search that sorts in O(1)?
- I just saw Merkel’s reaction to Trump stating/joking that they both had in common that they were surveilled by Obama. Priceless.
so long … Nicolai
PS: Don’t forget to subscribe! :)