Silicon Opera

A For Loop Is Not What Your CPU Actually Runs (opens in new tab)

Most programmers think of a for loop as a direct instruction to a computer. Write for i in range(1000), and the machine counts to a thousand. That mental model is wrong, and the wrongness is consequential. The distance between the code you write and the operations your CPU performs is not a detail. It is the entire story of modern computing performance. The Code You Write Is a Polite Suggestion When you write a for loop in Python, C, or Java, you are not writing machine instructions. You are ...

Read the original article
Sign in to keep reading the full article.

Keyboard Shortcuts

Navigation

Next / previous post
j/k
Open post
oorEnter
Preview post
v

Post Actions

Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Save / unsave
s

Recommendations

Add interest / feed
Enter
Not interested
x

Go to

Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Discover
gb
Search
/

General

Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help