Ylan Segal

The REPL: Issue 46 - May 2018

The Economics of Writing a Technical Book

I’ve often wondered what it would be like to be a published author. Writing a book is a time consuming. Is it worth it? In this post, Justin Garrison covers in a lot of detail the economics of writing a book for O'Reilly Media. I found it very valuable, as discussions about how much money some makes are hard to come by. The bottom line: After a few months of the book being on sale, he has made ~$23/hour invested. The number would probably go up, since the number of hours it took is not going to change, but the number of sales keeps increasing. My understanding is that that flatten out rapidly after release, though. Food for thought!

GDPR Hysteria

hysteria | həˈstirēə, həˈsterēə | noun exaggerated or uncontrollable emotion or excitement, especially among a group of people

Last year, while working for my previous employer, I spent about half my time working on GDPR compliance. The work involved adding features for data export, data deletion for former customers, notifications around both, etc. The General Data Protection Regulation is a big deal for any company doing business in Europe, even if not located or incorporated there. As Jacques Mattheij points out – in a lot of detail – in the tech blogosphere there is a lot of hysteria around what it means. The post does a good job of explaining what it means and how it’s often misunderstood. Don’t miss the follow-up, with actionable advise on GDPR.

What is a Blockchain

I am not bullish on crypto-currencies. Actually, if I trusted that there was a reliable way to bet against them, I would. But what is a blockchain anyway? David Bryant Copeland starts from the ledger and builds his way up to explaining how it all ties together and what problem it solves. The article’s subtitle says it all: A novel solution to a problem no one has.

The REPL: Issue 45 - April 2018

the Origins of Opera and the Future of Programming

Jessica Kerr writes eloquently about how some groups of people in music, painting, science, and programming produce extraordinary results, like the invention of a novel genre of music. She goes deep into the theory behind it and introduces the concept of symmathesy:

Nora Bateson points out that there’s more to a living system than parts and interrelations: the parts aren’t constant. We grow and learn within the system, so that the parts don’t stay the same and the interrelationships don’t stay the same. She gave a word to this, something deeper than any mechanical or model-able system, a learning system composed of learning parts: symmathesy.

I am still processing what this all means. My immediate takeaway is that some teams have dynamics in which positive outcomes are amplified to form a virtuous cycle. I believe this is equivalent to what people mean by “synergy”.

How I Write SQL, Part 1: Naming Conventions

This post covers a lot of detail on the naming conventions Sehrope Sarkuni prefers when writing SQL, including the rationale behind for each convention. I agree with most of the conventions. In reality, I am more interested in my team having conventions in the first place.

How To Index Your Database

The slides for Baron Schwartz’s presentation at PostgresConf US 2018 cover a lot of detail on what indexes are, how databases use them and in the uses cases where indexes help: Read less data, read data in bulk, and read data presorted. This is one of those slide decks that contains enough information and context without needing to see the talk – not available on video at the time of writing.

The REPL: Issue 44 - March 2018

Mistakes Rails Developers Make in Elixir Part 1: Background Jobs

Background jobs in Rails are a common patter. In this post Desmond Bowe explores some of the available patterns in Elixir that can be used instead of reaching for a background queue. The information is very good. In my experience, every time I reach for background jobs, I also need to ensure that jobs survive node crashes. For that, the author still advises to use a traditional background queue.

A Career Cold Start Algorithm

Andrew Bosworth (Boz) advocates a simple way to start a new job: Ask everyone what is it that they think that you need to know, what are their challenges and who should you talk to next. This is a great idea, especially in places where a robust knowledge transfer process is not in place.

Elapsed time with Ruby, the right way

Luca Guidi explains why the naive use of Time.now to measure elapsed time between starting and ending an expensive operation is wrong. What to use? Monotonic time.

Remember: wall clock is for telling time, monotonic clock is for measuring time.

The REPL: Issue 43 - February 2018

What Does OO Afford?

Sandi Metz is one of my favorite authors, and for good reason. In this post, she talks about affordances (a made up word!) that programming languages give, in particular Object-Oriented languages:

OO… wants you to replace your procedural monoliths with collections of small, independent, collaborative objects.

The Lost Art of the Makefile

Jesse Hallett walks through the basics of make and Makefiles. He talks about targets, how it excels at managing dependencies and how it can be leveraged for a modern Javascript workflow. I don’t write Javascript, but I have found make to be very useful for Crystal projects. I’ve even seen people use it for ruby development.

Book Review: Functional Web Development With Elixir

Functional Web Development with Elixir, OTP, and Phoenix: Rethink the Modern Web App by Lance Halvorsen covers how to build web application in Elixir leveraging it’s great concurrency properties using OTP. Throughout the book, the author guides the reader through building an application. At first, the focus is only on the business logic, outside from any web-framework. Later, the author covers how to use that code inside a Phoenix application without the tight coupling that often results in other web frameworks. Phoenix web views are largely ignored, focusing instead on it’s finest features: Channels and Presence.

Considerably time is spent discussing OTP and GenServers in particular. I feel I have a relatively good understanding, while at the same time feeling that something hasn’t quite “sunk in” yet. It was also great to learn the basics of supervision trees, ETS (the in-memory storage built-in to the BEAM), and MNESIA (a relational database that is also built-in that doesn’t use SQL).

The app is built chapter by chapter, in a bottom-up approach. While the reader does end up with a functioning application, it is easy to miss the forest for the trees. Especially, since most readers won’t have OTP experience and don’t know how those applications are structured. I would have much rather have seen an outside-in approach, especially one driven by tests.

I was also disappointed that testing was not even mentioned in the book. I consider testing to be an integral part of my day-to-day work and can’t really evaluate a framework or language without knowing what the ergonomics of testing are like. In particular I am left wondering how to test asynchronous code, channels or presence modules, especially when it requires passing Socket structures to functions.

In my other explorations of Elixir, I’ve read about umbrella applications being a great way to keep modules separate. While the author spends considerable time on the same subject, he doesn’t mention umbrella applications (either negatively or positively).

Finally, while I enjoyed the book, I did find that there seems to be some implicit assumption that Elixir scales very well across nodes, but I wish there was more of an explanation of how computation is distributed among Elixir/Erlang nodes and in particular how is state propagated between them when using something like ETS.