Posts

Article hero image

The Interview Bluff

Recently, I had a lunch meeting with an acquaintance who shared their interview experience, particularly behavioral questions. One of the questions asked was, “Works and on time or Perfect and late?” This question sparked a debate, as the interviewer was firmly in the former camp.

Article hero image

How I SBT - IV

Previously, we discussed Plugin s. Today, let us see how to better organize build code.

Build Code Organization

Build code involves everything SBT will consume for the build

Yep, you can have SBT consume Scala files with regular Scala code. But the Scala files must be in the project/ folder.

More ...

Article hero image

How I SBT - III

Previously, we discussed how to quickly write a simple build.sbt without fuss. We briefly understood how it is processed by SBT along with Settings and Tasks. We did that without having to know about the build folder structure1 et al.; until now.

Build Folder Structure

Below is the project and build folder structure. There are two things that SBT is interested in your project - build.sbt and project/ 2.

More ...

Article hero image

How I SBT - II

Previously, I showed you how to write a SBT build definition without knowing much at all. Neither did I talk about simple things like directory structure nor about advanced things like scope or axis, yet you could pretty easily write a SBT build definition for a library and setup publishing. All by writing Scala code (DSL for SBT).

Today, we are going to talk about Settings and Tasks.

More ...

Article hero image

How I SBT - I

Contrary to the unpopular opinions that it is hard and clumsy, SBT, the de facto build tool for Scala, is one of the best. Ease comes with familiarity. Unfortunately, there aren’t many beginner-friendly guides for specific scenarios. A lot of troubleshooting information is hidden in the forests of issues and public forums. This is despite the fact that SBT has excellent support for inspecting your project definition. The official documentation is like the encyclopedia that is too much to digest.

Article hero image

Tagged Types & Implicit Resolution

Last time, I wrote about different ways of declaring implicits, which is a prelude to this post. Knowledge of different ways of declaring implicits is good for general understanding on the subject, and also for this post.

This post discusses an intriguing case - a gotcha, with implicit resolution of instances related to tagged types. Interestingly, newtypes are safer in that regard.

Cross-JDK Compilation in SBT

Recently, I had to cross-compile a bunch of Scala library repositories for JDK 11 and JDK 17. I was hoping SBT would natively support specifying the related configuration in build.sbt similar to crossScalaVersions. I came across some references to plugins that seemed to do the job. But I couldn’t find anything in their documentation that proved they supported compiling for different JDK versions. They only seemed1 to provide better management and configuration options for cross compiling different Scala versions. More ...

Article hero image

Declaring Implicits

While implicits are easy to use, declaring them properly requires careful consideration. Because there are a few different ways you can declare implicits viz. extension methods, parameter values, type converters and dynamic instances. Each one has a specific purpose. For instance, dynamic instances enable recursive implicit resolution. Understanding the different ways of declaring implicits is critical in choosing the right one for the given scenario. It is also invaluable in troubleshooting subtle bugs and unexpected behavior related to implicit resolution.

Article hero image

My Scala Story

I have been reading the My Scala Story series by Software Mill - a short interview of renowned experts about their Scala journey. I have not done anything substantial in the OSS space to be on Software Mill’s radar. But their series inspired me to share mine. So, here it goes …

Matter Feature Request - Series

Matter is a fantastic app for reading; articles, blog posts etc. There is one feature I love to have in Matter. Let us find out what that is.