Leon Pahole

All posts - page 2

How I handle frontend errors

13 minProgrammingClean codeFrontend

Written by Leon Pahole

Connect with me:

Programmers disagree on many things, but one thing we can all get behind is that error handling is important. This blog post showcases how I handle frontend errors, associated with API calls, in a way that is readable, maintainable, and easy to use.

Read full blog post >>

How exercising less intensely helped me become healthier

10 minPersonalHealth

Written by Leon Pahole

Connect with me:

Exercise - we all know we have to do it, but the thought of spending hours upon hours in the gym doing painful and intense exercises doesn't exactly sound the most inviting. Still, I kept up with a pretty intense exercise routine for many years - until I decided to bring it down a notch. I made my workouts shorter and less intense, which made me the healthiest I've ever been. But how? It sounds paradoxical - shouldn't exercising less make me less healthy?

Read full blog post >>

Using TypeScript namespaces for better code organization in ES modules

4 minProgrammingClean code

Written by Leon Pahole

Connect with me:

JavaScript's ES modules are a great way to organize code into separate files and keep the code clean. I have noticed however that as projects get larger, it gets harder and harder to keep mental track of the code and assign proper names to identifiers. In this blog post, I present TypeScript namespaces as one of the solutions to this problem.

Read full blog post >>

My take on comments in code

12 minProgrammingClean code

Written by Leon Pahole

Connect with me:

There's a lot of conflicting information about code comments in programming communities. Some people believe in writing comments as much as possible, while others advocate for code that is self-documenting and thus renders comments almost useless. In this blog post I lay out my past experiences with comments and how these experiences shaped my current approach to writing clear and understandable code.

Read full blog post >>

How to manage TypeScript enums to prevent maintainability issues

7 minTypeScriptClean Code

Written by Leon Pahole

Connect with me:

Enums are a great way to restrict values of variables to a limited set of chosen constants. This makes the code more readable and less error-prone, as we no longer need to use magic numbers. However, enums can also cause our code to become hard to read and maintain as our codebase expands. In this blog post I describe how I solve these concerns in TypeScript.

Read full blog post >>