Dom HabersackDom Habersack
HomeProjectsBlogSnippetsVideos
  1. Home
  2. Snippets
  3. All snippets in “General”

All snippets in “General”

These are a collection of tips and tricks you can use to improve the performance and readability of your code.

Filter by category

All90
CSS3
General4
JavaScript78
React4
TypeScript1
GeneralAug 21, 2020

Redundant comparisons to true or false

If an expression returns a Boolean value, we don’t also need to compare that result to true or false.

Read full article
GeneralAug 15, 2020

Extracting complex logic to named functions

Putting complex logic into a function increases code readability. By giving that function a descriptive name, it can explain what is happening in it.

Read full article
GeneralJun 15, 2020

Descriptive variables instead of complex conditions

When chaining conditions together, putting them into named variables makes code more readable.

Read full article
GeneralJun 14, 2020

Using Boolean prefixes for variable names

When naming variables that hold Boolean values, using a prefix that indicates as much helps with readability.

Read full article

Work

About meCurriculum VitaeBlogVideosSnippetsProjectsOpen metrics

Legal

Legal NoticePrivacy PolicyCookie PolicyContact

© 2023 Dominik Habersack. All rights reserved.

Mastodon
Mastodon
Twitter
Twitter
YouTube
YouTube
Twitch
Twitch
GitHub
GitHub
LinkedIn
LinkedIn