`scala-cli`: A Breeze

When I first read about scala-cli, I wasn't quite sure of the motivation while you have the Scala REPL itself, sbt console, ammonite etc. I took scala-cli for a ride. My first impressions, if I have to put it one line: One thing that stood out to me is the…

My Everyday IntelliJ Plugins

If IntelliJ is the perfect main course, its plugins are the seasoning to spice it up. There are hundreds of popular plugins that rank in probably every post on IntelliJ plugins. However, the ones listed here are those that I use almost everyday. Besides, I like using these plugins, and…

Rebooting on Ghost Land

The last time this blog got a facelift was, phew, was about five years ago. I had moved from the infamous Blogger to the famous WordPress. It was a relief moving away from Blogger. Despite the move to WordPress, I was also interested in Ghost. I have been in love…

Know Thy Option

Avoid `.get` at all costs. Forget there is even an `Option.get`. There is always a way out - better one. Same applies to `.head`. Likewise, consider extending your test classes from `OptionValues`.…

Patterns for Saner Mocking

It is common to see mocks being setup this way in unit tests. scenario("Test Case 1") { ... when(addressResolutionService.resolve(...)).thenReturn(...) when(vendorInventoryService.checkInventory(...)).thenReturn(...) ... .... another bunch of when and then returns when(shipmentService.schedule(...)).thenReturn(...) ...thisIsTheActualCalltoTest(...) verify(vendorInventoryService, 1).checkInventory(...) ... other such verifications } scenario("Test Case…

Cyrilex - Online Regex Tester

A while ago, I wrote the online regex tools. Cyril (@CyrilBois) came across that post and mentioned about his regex tester tool. I think every tool should have a name; not one that just goes by its function but a nickname, if you will. So, I am going to name…

Non-FP to FP Conversion Caveat

Sometimes you learn the best from others; by watching. This post is based on such an instance. A fellow engineer on my team was investigating a nagging issue - partially-successful operations or rather operations that left data in an inconsistent state. It goes without saying that I take no credit…