Category: TypeScript (2)

Performance comparison in Node.js for reading large files: indexOf vs. byte-by-byte checking

In software development, choosing the most efficient method to parse large datasets is crucial for performance. I conducted an experiment to compare two different approaches for counting line breaks in a large text file using Node.js: using indexOf and manual byte-by-byte checking.


Read More

Simplifying TypeScript Code with User-Defined Type Guards

Working with TypeScript often involves precise type checking and sometimes necessitates repetitive type assertions to tell the compiler what we "know" about a variable's type. While the language's robust type system enhances code quality, sometimes it can get verbose, especially when dealing with DOM elements. This blog post aims to introduce a feature in TypeScript called User-Defined Type Guards, a way to reduce redundancy and make your TypeScript code more readable and maintainable.


Aug 31, 2023
Read More