Inheritance in Go language

Go language does not have the concept of a class directly. It, however, has a concept of an interface as well as a struct. I’ll illustrate how this can be used to build most of the inheritance constructs that a language like Java or C++ offers.

Read More

Bad and good ways to test code

Writing tests at an early-stage startup is always heatedly debated. If a function has one call, adding a unit test doubles the number of calls, this not only doubles the current work but even slows down future code changes 2X! Further, if the code is not finalized, it is legitimate to ask why even bother writing test code. Here’s a better way to write tests

Read More

GraphQL vs gRPC

RPC calls allow one service to call functions in another service as if it is a part of the same service. And unlike a REST API, one gets strong type checking. The two services can even be in different languages.  gRPC is a great framework for implementing an RPC service.

Another language-agnostic framework for making RPC calls is GraphQL. Many people don’t think of GraphQL that way, however, it can serve the same purpose.

Both GraphQL and gRPC are modeled as server and client-side frameworks. So, which one should you use?

GraphQL is a superior option when one is planning to build an API service that’s exposed to the Internet. Even more so, because multiple queries can be combined into one.

gRPC, however, is better for the use case where the gRPC server is a private service not exposed to the public network.

The different layers of a web applications

There are three mandatory layers of any non-trivial user-facing web application. Storage, compute and view. The view is the front-end website and the mobile app(s). The storage is the database layer like MySQL or Mongo DB. The compute layer is the actual backend service serving the web content and related APIs.

Read More

The biggest impact of ChatGPT

In the decade of the 2010s, after Facebook became mainstream, social became a building block for websites. A lot of websites added a concept of user profiles consisting of a name, a display picture, a profile description, and the ability to see/follow the activity stream of other users. Slowly, this became the standard expectation.

ChatGPT will have a similar impact. More and more users will get used to asking questions in natural language. Eventually, all the FAQ and knowledge-base articles would be replaced with a single box where users will ask a question in their preferred natural language. And then even the idea of actions would switch over to that one box, that users can use to navigate around and perform actions in the web applications.

Why I prefer Obsidian for taking notes

I started using Google Notebook around 2008. Once I received a notice that it will shut down, I switched to Evernote around 2012. Unlike Google, note-taking is the central business of Evernote, I thought I would be fine. I was wrong. Evernote became terrible over time. Then I heard about a service called Notion. I deliberated and decided to wait out. Turns out a new cool kid on the block showed up soon enough. It was called Roam Research. They had such an enthusiastic fan following that they decided not to even have a freemium model. I was tired of moving notes from one proprietary system to another. And decided not to use either Notion or Roam research.

Finally, in 2020, I came across Obsidian and decided to make the move. Obsidian is a simple Markdown-based note-taking application. The best thing is that it does not store your notes. You can store your notes on your favorite cloud provider. And if Obsidian ever shuts down, your notes are not only readable in a plain-text editor, but also can be modified/viewed by a gazillion other Markdown editors. Obsidian isn’t as fancy as Notion with dynamic views or anything like that. But it gets the job done. And I can be certain that my notes will be accessible for decades to come.

Low code

I’m a big of serverless. In fact, in 2021, I believe that it should be the default choice and one should have a strong reason to deploy their own servers.

Read More

React Native

There are tons of hyped-up claims surrounding React Native that are worth addressing.

The reasons why companies run for React Native are usually,

  1. We already use Javascript for the website and now, we can build apps in that as well.
  2. We can use one codebase for Android, iOS, and web apps. Or at least, Android and iOS apps.
  3. Facebook uses it

Read More