CodeFaster

CodeFaster

Share this post

CodeFaster
CodeFaster
Define lazily

Define lazily

Tyler Adams's avatar
Tyler Adams
Nov 13, 2022
∙ Paid

Share this post

CodeFaster
CodeFaster
Define lazily
Share

Defining eagerly:

a = 1
dddd = a*2
bb = 1
ccc = bb + a

return bb + dddd

Defining lazily:

Thanks for reading CodeFaster! Subscribe for free to receive new posts and support my work.

a = 1
bb = 1
ccc = bb + a

dddd = a*2
return bb + dddd

Reason: Defining lazily minimizes the number of definitions at each line of code.

The fewer definitions

The fewer variables in a programmer’s head

The faster the programmer can reason about the code

Note: a, bb, ccc, and dddd are bad variable names for real code, but they give order and shape to the point we’re making in this article.

Thanks for reading CodeFaster! Subscribe for free to receive new posts and support my work.

This post is for paid subscribers

Already a paid subscriber? Sign in
© 2025 Tyler Adams
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share