This is a weblog about computing, culture et cetera, by Miikka Koskinen. Read more.
It’s time to look back at 2018 and talk about me.
On being a professional
The biggest thing for me personally was finishing my master’s thesis
and graduating as a Master of Science. I’m glad it’s finally done. After
graduating I continued working at Metosin as a
software developer. In autumn, I joined Metosin’s board of directors.
At work, I took more responsibility on project management. It felt meaningful
even if it always wasn’t fun. In general, I feel like I’ve made more mistakes
lately. I reckon this is a good thing: either my job has become more challenging
or I’ve become better at recognizing mistakes. Both mean more learning.
Here are some things I learned from, other than making mistakes:
- Camille Fournier’s book The Manager’s Path helped me to understand how
engineering management works.
- The Lead Developer London conference
was useful as well.
- Zach Tellman’s Elements of Clojure
and John Ousterhout’s A Philosophy of Software Design are good treatises
on software design in the small.
On having a life outside work
These were fun:
- I started playing piano again after a decade-long break.
- I made a backpack.
- A year ago I hoped to hike and sail more and do more yoga.
My hiking plans fell apart, but I did have a great sailing trip in the summer
and practiced yoga almost every week!
Some cool cultural works:
What about my plans for 2019?
- I’m planning to level up my thoughtleader game this year, so expect more
blog posts. I’m back to a situation where it would be sustainable to
- I’m giving a lightning talk at
the :clojureD conference in Berlin in February. If you’re attending, come to
say hi! :)
- I hope to give a full-length talk at some other conference later
this year. Working on it!
While 2018 was a pretty okay year for me, I know it was a hard year for a lot of
people both on the personal and the societal level. Frankly, I’m not feeling optimistic about the politics. It will get worse before it gets better.
Finally, a year ago I wrote this:
I can’t believe it’s 2018 and Juha Sipilä’s cabinet still hasn’t
Unfortunately it’s 2019 and Sipilä’s cabinet still hasn’t fallen apart, but at
least the parliamentary elections are coming up in April.
One of the new features in Clojure 1.10 is tap. The changelog
describes it as follows:
tap is a shared, globally accessible system for distributing a series of
informational or diagnostic values to a set of (presumably effectful) handler
functions. It can be used as a better debug
prn, or for facilities like
tap> sends a value to the set of taps. Taps can be added with
add-tap and will
be called with any value sent to
tap>. The tap function may (briefly) block
(e.g. for streams) and will never impede calls to
tap>, but blocking
indefinitely may cause tap values to be dropped. If no taps are registered,
tap> discards. Remove taps with
I’m already using it as a better debug prn! I’m using Cursive and I
connect to a REPL launched by Boot. With my setup,
value) has two potential downsides.
- The output may go either to the Boot terminal or to the Cursive IDE depending
on the code path.
- The output is not pretty-printed.
Tap allows me to solve both problems. I want my debug prints to always appear
in Cursive’s REPL, so after starting the REPL, I add a tap handler by running
(add-tap (bound-fn* puget.printer/cprint))
Here bound-fn* ensures that
the output goes to Cursive and not to the terminal. Puget is the
pretty-printer I’m used to, but you can replace it with your favorite printer.
If you do not want to add new deps, you can use
clojure.pprint or even plain
(add-tap (bound-fn* clojure.pprint/pprint))
(add-tap (bound-fn* prn))
Now when I want to debug-print something, I do
(tap> "hello world"). Since
add-tap are in
clojure.core, I don’t need to require
anything. I can just
Another debugging trick is to store the tapped value in an atom. I’ve used this
only once so far, but it was pretty handy. Setup:
(def debug-a (atom nil))
(add-tap #(reset! debug-a %))
Now I can
tap> an intermediate value in the middle of some complicated code
and then poke at it in the REPL via
@debug-a. Ideally you’d use
a debugger, but if you are in hurry, maybe tap is enough.
Every now and then I see people asking what Clojure and ClojureScript libraries
they should be using. In this post, I’ll share my list of libraries for building full-stack
Clojure/ClojureScript web applications. I’ve been building this kind of applications for a while now
and I believe you can rely on these
Here’s what I’m looking for:
- Robustness. I don’t want to debug buggy libraries – I write enough bugs of my own.
- Extensiblity. With a long-lived application, you’ll end up wanting all kind
custom things that the library authors didn’t anticipate. Data-driven design
- Implemetation is easy to understand. Eventually I’ll read the source anyway.
Either there is a bug or there is no documentation.
This list is not meant as the final truth: there are plenty of good libraries
out there and you might choose different ones based on your needs and
preferences. There’s an obvious bias, too: many of these libraries were made by
my colleagues at Metosin.
Framework. I appreciate the data-driven nature of
Integrant. Combine it with
Integrant-REPL for reloaded
JDBC database connection pool. I’ve never had any problems with
HikariCP and it’s easy to
configure and instrument. hikari-cp is a
handy Clojure wrapper.
Configuration. I use Maailma and I’ve
written about how to use
cprop is very similar and probably a bit
HTTP routing. I like the data-driven nature of
reitit. It’s fast, too, and has enough
extension points so that anything you want is possible. I would not use
compojure-api because the
implementation is way too hard to understand.
Logging. I use Timbre because it’s
so easy to write custom appenders for it. Admittedly I haven’t checked out the
popular Java options.
Test runner. Eftest is the test
runner of my dreams and you
can’t go wrong by using it. At some point I want to give
Kaocha a go.
Test assertion library. I like testit
and Juxt’s iota. They’re adequate, but I think
there’s room to do better here.
Test data generation. I only just started using
specmonstah for generating graphs
of test data, but I’m excited. It’s so much nicer than writing the equivalent
code by hand. There’s a bit of learning curve, though.
Build tool. Figwheel works very well and its getting
better all the time. I’d either use it with Leiningen or directly with
Front-end framework. re-frame is the way
to go. Check out re-frame-10x for
Translations. Tempura works for
me. I use a small Clojure tool for extracting the translatable strings into a
for editing with Poedit. The tool is proprietary right now
but I hope to open source it.
clojure.spec helpers. Expound makes the
spec error messages human-readable and
Orchestra instruments the function return
Data manipulation utilities. I use the combination of
Specter. Potpuri is an old-fashioned
“missing parts of clojure.core” library and xforms is the same for transducers.
Specter is the closest thing to lenses for Clojure. It’s powerful but takes some
time to learn. I recommend trying it out for some simple tasks – soon you’ll see
opportunities for it everywhere.
What about …?
I haven’t included any SQL libraries, HTTP clients or servers, or async
libraries, because I don’t have a clear recommendation for any of these
For more posts, see archive.