Code

Blue-Green Deployment in K8s

Blue/Green deployment is an application rollout model that progressively directs user traffic from the previous version of an application or service to a new version of it, while...

Read

The story of reducing a Github Actions workflow by ~7 minutes

I was working in a nasty flacky test, the test was passing locally but was failing on Github Actions CI, but there was a deeper problem...

Read

DRY in test suites is an antipattern

One of the first things that new software engineers learn is the DRY princliple (Don't repeat yourself), the principle states that in software engineering we should try to reduce repetition by extracting common...

Read

Against closure consts

Imagine that your a developing a library that you want to open-source or you created a helper that will be used all over the codebase in a mid-to-large project. Your little library exposes a function that does what is intented but relies on some (sensible in your eyes) const values.

Read

How to create a CI/CD pipeline for a React app (2nd part)

In the 1st part of the tutorial for creating a CI/CD pipeline for a React app, we saw how to create docker containers for dev, testing and production enviroments. In this 2nd part we will see how to integrate a CI service like Travis CI and deploy our app to AWS.

Read

How to create a CI/CD pipeline for a React app (1st part)

I wanted to write a tutorial on how to dockerize an application, make it production ready, setup CI/CD workflow and eventually deploy it to AWS. So here in that first part we will see how to dockerize a react app for development, testing and...

Read

Code Smell: Too much indirection

Indirection is the ability to reference something using a name, reference, or container instead of the value itself. When it is overused though, it can make the really difficult to follow the flow of the code. Imagine the following...

Read

Code Smell: Divergent Change

Continuing the series of blog posts about code smells, let's talk about `Divergent Change`. Divergent change occurs when you have to do too many changes in a class/module to...

Read

Code Smell: Feature Envy (or Data Envy)

Feature Envy and Data Envy are two similar and typical code smells. One class/component is more...

Read

Materialized Views to Improve Aggregations Performance

Materialized View is a pre-computed query that is stored for later use with the goal to not re-peat the query again, the drawback of-course is that the data that you are getting may not be fresh enough...

Read

Frontend Architecture in the hooks era

Hooks have released a few months ago and the community is still playing around with them and tries to find the best patterns. At this point it doesn't seem to be one single best solution on how to completely replace state management libs, both in terms of code but also in terms of folder/file structure in the project, so here I am mostly document my journey into that process, and what works best for me.

Read

Performance is a requirement

Most of the times as software engineers we are getting requirements that describe the functional scope of a feature. The tickets that we are working on usually look something like: _As user I want to be able to create an account by entering a name and an optional address so that I can start playing the game_. The ticket do not describe the non-functional requirements of the feature. For example, it is a completely different experience if the user is able to type her name quickly versus facing some short of lag:

Read

Faster sampling in PostgreSQL

Many times we want to display some random data to the user, for example if you have an e-commerce website apart from the top products or some list of products that a fancy recommendation system generates, we want to display to the user a list of...

Read

It's all Greek to me: Thoughts on code readability and aesthetics

Do you remember the first time you wrote something in a new programming language and you run it, and it worked? Didn't you had this 'OwO, I am a Perl developer now, let's put it on the CV' feeling? Until, someone else come to you and say, 'No, no, no, you can squeeze these 10 lines, into this one-liner'...

Read

Lazy and infinite data structures

Many times we encounter situations where our code depends on a complicated data structure or a data structure that has implicit semantics. For example...

Read

Ruby: Provide ways to iterate over collections

Sometimes we have classes that represent collections, for example a class `Group` can...

Read

Pseudomandatory parameters in es6 functions

In many programming languages, the parameters of a function are by default mandatory and the developer has to explicitly define that a parameter is optional. In Javascript, every parameter is...

Read

Backpressure for smoother user experience in low-end devices

If you are building applications that consume real-time data you may have faced a situation where the component or service that consumes the data cannot keep up with the volume or speed of the produced data. The **producer** module of the system is emitting data faster than...

Read

Hide depedency to a data structure

Many times we encounter situations where our code depends on a complicated data structure or a data structure that has implicit semantics. For example...

Read

Remove argument-order dependency and provide defaults

Argument order in function signature is a common source of bugs and frustration. Imagine you have the following Vehicle class, its constructor accepts values to instantiate an object...

Read

Null object pattern

Many times functions accept object references that can be null, and we tend to add if statements to treat the special case where null is passed to a function, and either provide a default response or...

Read