Code

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

Giving praise

Just some thoughts on giving praise. One of the biggest mistakes that you can make as a manager/team-lead/head-of-whatever is to give praise only to a few of the people who worked on a project...

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