this post was submitted on 20 Aug 2023
1210 points (98.9% liked)

Programmer Humor

19488 readers
436 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 10 points 1 year ago

A form of "self documentation" I like to do is create variables for conditions before using it in an if statement. If you break down a funky conditional into easy to read variables it becomes a lot more clear what it's trying to do.

Idk how to write code on sync:

const isHumid = xxxx;
const isHot = yyyy;
const isSunny = zzzzz;

If (isHot && isHumid && isSunny) {
    ...
}