March 2021

Writing better conditional expressions in JavaScript

Writing better conditional expressions in JavaScript

  • March 30, 2021

Writing conditional expressions is pretty easy to do. But there is room for improvement in the way we have been doing it. And with the flexibility that JavaScript provides, we can replace conditionals with clean code by using some good practices. And it can lead to more maintainable code. Let...

My career decision: choosing passion over money

My career decision: choosing passion over money

  • March 25, 2021

As you might know, I recently switched jobs. In my long journey of finding a new one, there was a moment where I was offered way more money than I had anticipated for a role that I was not as passionate about. I wish I could say that it was...

Parsing and validating data in Python using Pydantic

Parsing and validating data in Python using Pydantic

  • March 23, 2021

The introduction of type hinting opened the gates for many great new features in Python. And data validation and parsing became easier to do with the use of type hints. Pydantic is one such package that enforces type hints at runtime. It throws errors, allowing developers to catch invalid data....

Using the optional chaining operator in JavaScript

Using the optional chaining operator in JavaScript

  • March 18, 2021

Every now and then, you come across a JavaScript feature that vastly changes the way you write it. Destructuring, arrow functions, modules have been some of those features for me. Optional chaining is going to be the next one on that list for me. Optional Chaining is in stage 4...

Statically type checking Python code using Pyright

Statically type checking Python code using Pyright

  • March 16, 2021

With the introduction of type hinting in Python 3.5, static typing and checking Python codes has started to gain popularity. While MyPy was the first tool to do static type checking of Python code, many other frameworks have been built after it. Pyright is one such tool built by Microsoft...

Adding fixtures and parameterized functions to PyTest

Adding fixtures and parameterized functions to PyTest

  • March 11, 2021

As we discussed in our post on getting started with Pytest, the framework allows us to reuse tests by using test fixtures and parameterized functions. In this post, we will learn how to do so. We will build on the simple calculator example that we discussed in the previous post...

Testing Python applications using Pytest

Testing Python applications using Pytest

  • March 9, 2021

Testing our code brings in a variety of benefits, including building confidence in the code’s functioning and having lesser regressions. Writing and maintaining tests requires some additional work, and that is why we want to leverage tools as much as we can. Python does provide inbuilt tools such as unittest...

How to format a Number as Currency using ES2015

How to format a Number as Currency using ES2015

  • March 4, 2021

The process to format a number as currency can be a tedious task. It feels like a small task, but the number of lines and the edge cases can keep on increasing when considering factors such as internationalization and different formatting standards. Luckily, ES2015 introduced an internationalization API which can...