Recently I stumbled across an article that presented the alphabet for my hometown. It compelled me to write one for TypeScript! To provide some educational value, I decided to enhance each letter’s section to contain a question.
These questions usually require some research on your part, and I believe they can be a great way to prepare for an interview, either as an interviewee or as an interviewer!
any type is the fastest way to silence most type-related problems in TypeScript. I would give the second place to the
ts-ignore comment. …
The most conservative definition of immutability boils down to having objects which respective states cannot change after the initial assignment. Investing into applying this software pattern to all objects in a project can provide returns in better readability, improved understanding of code and advanced thread safety (in systems which support threads). The following article provides all information I find relevant for TypeScript developers, so they can reason about the need for ubiquitous immutability in their projects, based on the underlying functional-programming theory, the native support of the aforementioned concept in the language, and the best available practices.
In the traditional…
symbol in ECMAScript 2015, TypeScript supports it natively as well. The privilege of coding in this static-typed language gives developers the possibility to use types to enforce certain boundaries, and thus, speeds up the very development process. Today I will go through the most popular usages of the
symbol type that could enhance the reader's workflows.
typeof operator. Projects that rely on serialization done properly, usually use a well-tested…
As a software developer, I have observed various methodologies for choosing the primary key of a table. Some programmers exhibit proclivity for purposefully creating new columns to serve as the aforementioned key, while the others usually look for a solution that involves the already-existing columns. I would like to approach the said problem from an engineering perspective, taking into account available theories and common experiences, especially in the distributed-systems department.
When designing a table, database designers should ask themselves the following question — how to identity a particular row inside? The process of finding an answer might in turn reveal…
Even though the notion of intrinsic types might baffle the reader, I will not define them right away, as I want to introduce the concept using a practical example. I would love to start the article with the following question, something I have asked myself in various forms over the years:
In an ideal, statically-typed language, how could one define the string capitalisation type, using the properties of its type system?
I could substitute string capitalisation with string permutation and the issue still remains valid, as long as it touches not the abstraction of types, but their intrinsic properties.
As a software developer, I have always ensured the maintenance of the test architecture at all times. As a principle, I believe tests should exhibit quality on par with the production code. Now, how do we achieve that with TypeScript?
In my opinion, we need to choose a proper test framework first. I found great results with Mocha — it is flexible enough to help us leverage other libraries with it. Despite its simplicity, it supports building a respectable test architecture that fits TypeScript projects well — all by using hooks.
Mocha provides 4 types of hooks:
beforeEach (before every…
This article serves as my opinion on the steps anyone can take to improve their TypeScript skills and write more robust code.
Even today, I remember my first job interview for a junior software developer position. Even though I knew the basics of computer science, the interviewer rightfully pointed out that I had many knowledge gaps. …
Over the past few years, I took a deep dive into functional programming. Even though I came unscathed from this journey, I learned a lot along the way, especially when I applied it to my TypeScript projects. Today, I share my knowledge with you; I hope you can learn from my successes and failures.
The paradigm of functional programming has been gaining a lot of traction in the mainstream, while, arguably…
I don’t usually play computer games because of my tight schedule, but when I do, I play strategies. I used my Easter break to try a quite popular city planning game. I immediately recognized a lot of tactics and ways of thinking I could move into my software development experience.
Can playing city-planning games enhance your software developer career?
I will try to answer that question in this article.
The main objective of a city-planning game is to establish a city and expand it to its reasonable limits. The more districts the city has, the harder it gets to develop…
Distributed systems might use message queues or message streams for asynchronous communication between services. System designers can choose from many products, taking into account specific features, like message prioritization. In this article, I will focus on how to design said prioritization in virtually all message systems.
Simply put, message systems allow producers to send messages to consumers using brokers. Messages usually contain:
Systems that support topics (channels, buckets) require producers to declare the intended destination in message metadata.
A broker receives a message and then makes…