惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Stack Overflow Blog
Stack Overflow Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
L
LINUX DO - 最新话题
T
Troy Hunt's Blog
博客园_首页
量子位
Jina AI
Jina AI
S
SegmentFault 最新的问题
IT之家
IT之家
Hacker News - Newest:
Hacker News - Newest: "LLM"
大猫的无限游戏
大猫的无限游戏
N
News | PayPal Newsroom
P
Proofpoint News Feed
Cyberwarzone
Cyberwarzone
S
Securelist
Google Online Security Blog
Google Online Security Blog
P
Privacy International News Feed
博客园 - Franky
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
NISL@THU
NISL@THU
C
Cisco Blogs
V
Vulnerabilities – Threatpost
腾讯CDC
The Hacker News
The Hacker News
K
Kaspersky official blog
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Security Archives - TechRepublic
Security Archives - TechRepublic
A
About on SuperTechFans
Webroot Blog
Webroot Blog
The Register - Security
The Register - Security
Scott Helme
Scott Helme
B
Blog
Security Latest
Security Latest
Last Week in AI
Last Week in AI
Google DeepMind News
Google DeepMind News
W
WeLiveSecurity
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Road to Senior #2: How Computers Think in Numbers
Daniel Ledvi · 2026-05-25 · via DEV Community

⏱️ Reading time: 7-9 minutes
🎯 Difficulty: Beginner - Intermediate
📂 Themes: Computer Science, Binary, Memory, Performance


What's inside?


🔍 The Problem

After publishing my first post about Stack and Heap, I felt like the foundation was solid.

I understood where data lives in memory. I understood why [] === [] returns false. References, garbage collection — the mental model clicked.

Then I opened DevTools. I was debugging a color issue and I saw this in the CSS:

background-color: #FF5733;

Enter fullscreen mode Exit fullscreen mode

And I froze.

I type hex colors every day. I know #FF0000 is red. I know #FFFFFF is white. But why? What does FF actually mean? Why two characters? Why letters at all?

I realized I was using a notation I didn't understand, built on a number system I'd never properly learned, representing data stored in a format I'd never thought about.

So I went to the bottom. This is what I found.


⚡ Bits & Bytes

The smallest unit of information in a computer is a bit. Not a concept — a physical thing. An electrical signal on a wire. Either current flows (1) or it doesn't (0).

0 = off / false / no current
1 = on  / true  / current flows

Enter fullscreen mode Exit fullscreen mode

Why only two states? An electrical signal has exactly two stable states — saturation (current flows = 1) and cutoff (no current = 0). Three states would be unreliable and hard to distinguish. Everything in computing is built on this constraint.

A single bit isn't useful on its own. So computers group them into bytes.

8 bits = 1 byte. Eight bits gives you 2⁸ = 256 different combinations — values from 0 to 255.

Why 255 and not 256? Because you count from zero:

2⁸ = 256 possibilities
0, 1, 2 ... 255 = 256 numbers total
maximum = 255 = 256 - 1

Enter fullscreen mode Exit fullscreen mode

Why 8 bits? Three reasons that compounded into a standard:

  1. 256 values covers the entire ASCII table — English alphabet, digits, special characters
  2. 8 is a power of 2 (2³) — it divides cleanly into everything, and 8 bits = exactly 2 hex digits, no remainder
  3. It became the hardware standard in the 1970s, and hardware standards are almost impossible to undo

💡 RAM doesn't address individual bits — it addresses bytes. Every memory address (0x4A2F) points to exactly one byte.

This connects directly to the previous post. A memory address on the Stack takes exactly 8 bytes — because 8 bytes matches the width of the 64-bit data bus. One transfer, one value. If a number were 9 bytes, you'd need two transfers. The whole system is designed to fit into one.

💡 Stack must know sizes in advance — that's why objects of unknown size go to the Heap. And now you know why the sizes are what they are.


🔣 Hex & RGB

Now we can actually answer the CSS question.

Binary is how computers store everything. But binary is terrible for humans to read:

The number 255 in binary:  11111111

Enter fullscreen mode Exit fullscreen mode

Eight characters for a number most developers recognize instantly. Imagine reading memory addresses in binary — every address would be dozens of characters. Nobody could work like that.

So we use hexadecimal — base 16.

In our normal decimal system, each digit has 10 possible values (0–9). In hex, each digit has 16: the numbers 0–9, then the letters A–F (where A=10, B=11, up to F=15).

The reason hex exists is a single elegant fact: 4 bits = 2⁴ = exactly 16 combinations. One hex digit represents exactly 4 bits. Two hex digits represent exactly one byte. The math is perfect:

255 in binary: 11111111  ← 8 characters
255 in hex:    FF        ← 2 characters

Enter fullscreen mode Exit fullscreen mode

Half the characters, same information, perfect alignment with the underlying bit structure. This is why you see hex everywhere data needs to be written compactly:

Memory address:  0x4A2F3C
Git commit hash: a3f4b2c
CSS color:       #FF5733

Enter fullscreen mode Exit fullscreen mode


What #FF5733 actually means

CSS colors use the format #RRGGBB. Red, Green, Blue — each represented by two hex characters, which means each is one byte, which means each can range from 0 to 255.

This is the RGB color model. Screens don't mix pigments — they mix light. Three channels of colored light: red, green, blue. Each channel says how bright that component shines, from 0 (completely off) to 255 (full intensity). Combine them in different proportions and you get any color.

#FF5733

FF = Red   → 255 (full intensity)
57 = Green → 87
33 = Blue  → 51

Enter fullscreen mode Exit fullscreen mode

A warm orange-red. Full red, some green, a little blue.

#FF0000 → red 255, green 0,   blue 0   → pure red
#00FF00 → red 0,   green 255, blue 0   → pure green
#FFFFFF → all channels 255             → white
#000000 → all channels 0               → black

Enter fullscreen mode Exit fullscreen mode

RGB is an additive model — more light means brighter, and all three at maximum is white. This is the opposite of paint or print (CMYK), where mixing colors gets darker.

Three channels × 1 byte each = 3 bytes = 24 bits. That's "24-bit color" — 2²⁴ = over 16 million possible colors, all encoded in a 6-character string.


🔤 ASCII & UTF-8

Hex explains colors. The same question applies to text.

A computer stores numbers. It has no concept of the letter A. So how does A appear on your screen?

The answer is a table everyone agreed to use.

ASCII (American Standard Code for Information Interchange) is a standard from 1963 that says: the number 65 means the letter A. Every OS, browser, and text editor implements this agreement. One byte per character, 128 characters total.

A = 65 = 0x41
a = 97 = 0x61

Enter fullscreen mode Exit fullscreen mode

It worked perfectly — for English. Then the internet connected the rest of the world.

Unicode is the modern successor. It assigns a unique number to every character in every writing system humans have ever used — Latin, Arabic, Chinese, emoji. Over 1.1 million characters total.

UTF-8 (Unicode Transformation Format, 8-bit) is how Unicode numbers get stored as bytes. Its key feature is variable length — common characters take fewer bytes, rare ones take more:

Bytes Examples
1 A, B, 0–9 (identical to ASCII)
2 á, é, č, ř
3 中, 日
4 😀, 🔥

UTF-16 (Unicode Transformation Format, 16-bit) uses 16-bit units instead of 8-bit. Characters above 65,535 — including most emoji — need two units back to back, called a surrogate pair.

💡 UTF-8 encodes characters 0–127 identically to ASCII — an old ASCII file is valid UTF-8 with no changes. UTF-16 doesn't have this compatibility. That's why UTF-8 took over the web.


🏗️ RAM, Cache & the Bus

We've covered how data is represented. Now let's look at where it lives and how it moves — because this is where the physical limits of performance come from.

My previous post talked about Stack and Heap as regions of RAM. But RAM itself sits inside a bigger picture.


The memory hierarchy

Not all memory is equal. The closer to the CPU, the faster — and the smaller:

L1 Cache  — ~64 KB    — ~4 nanoseconds   — inside each CPU core
L2 Cache  — ~1 MB     — ~12 nanoseconds  — inside CPU, per core
L3 Cache  — ~8–32 MB  — ~40 nanoseconds  — inside CPU, shared
RAM       — ~8–64 GB  — ~100 nanoseconds — outside CPU, on the motherboard

Enter fullscreen mode Exit fullscreen mode

The CPU always searches L1 → L2 → L3 → RAM automatically. When it doesn't find data in cache, it fetches a block of ~64 bytes from RAM at once — not just the one byte it needs. If your data is sequential (like an array), the next elements are already loaded. If it's scattered (like a linked list), every step is a cache miss and a ~100 nanosecond penalty.

💡 Data travels between RAM and the CPU over the data bus — 64 bits (8 bytes) per cycle on a 64-bit system. One value, one transfer. The whole memory system is built around this boundary.


⚡ Interrupts & DMA

This last part took me by surprise. I expected it to be low-level hardware trivia. Instead it turned out to be the physical foundation of something every developer uses every day.


The clock

Every CPU has a crystal oscillator — a literal piece of quartz that vibrates at a precise frequency. Think of it as a metronome. Each beat is one clock cycle, and the CPU does exactly one thing per beat.

A 3 GHz processor runs 3 billion cycles per second. On every cycle, it executes one instruction — and checks a set of physical pins on the chip: the IRQ (Interrupt Request) pins.


How hardware gets the CPU's attention

Each IRQ pin is assigned to a device:

IRQ 0  → system timer
IRQ 1  → keyboard
IRQ 11 → network card
IRQ 14 → disk (SSD/HDD)

Enter fullscreen mode Exit fullscreen mode

Normally, the pins carry 0V — silence. When a device needs attention, it raises its pin to 3.3V. The CPU finishes its current instruction, detects the signal, saves its state, looks up the correct handler in the Interrupt Vector Table, runs it, then resumes exactly where it left off.

Think of it like a doorbell. Without interrupts, you'd have to walk to the door every few seconds to check if anyone's there — that's polling, and it wastes enormous compute time on nothing. With interrupts, you just work until the bell rings.

💡 The CPU never stops mid-instruction. It always finishes what it's doing first — that's why interrupts aren't truly "instant."


DMA: moving data without the CPU

Think of it like a kitchen. The CPU is the head chef — it cooks. DMA is the assistant who runs to the warehouse, grabs the ingredients, and brings them to the counter. The chef doesn't stop cooking to fetch things. He just gets a tap on the shoulder when everything is ready.

Without DMA, the CPU would have to move every byte of data itself — and check constantly whether it's arrived yet:

// Without DMA — polling:
CPU: "Is the data ready?"  No
CPU: "Is the data ready?"  No
CPU: "Is the data ready?"  Yes  process it
// CPU is busy the entire time. Nothing else can run.

// With DMA:
CPU: "Here's the job, let me know when done"  continues working
DMA:  *transfers data independently*
DMA: "Done"  fires interrupt
CPU:  *handles result*
// CPU is free the entire time.

Enter fullscreen mode Exit fullscreen mode

DMA is a dedicated chip on the motherboard. It moves data between RAM and devices over its own bus, independently. The CPU never touched the data — it just gets notified when it's ready.


Putting it all together

Hardware is not magic. The clock ticks, the pin changes voltage, the chip moves data, the CPU gets notified. That's it. Every abstraction we work with every day — languages, runtimes, frameworks — is built on top of these simple physical mechanisms.

Understanding this doesn't make you write better code overnight. But it changes how you think about it. When something feels like "just how it works," there's always a reason underneath. And the reason is usually simpler than you'd expect.


What I Know Now

I started with a hex color I didn't understand.

I ended up at the physics of how computers talk to their own hardware.

The chain is cleaner than I expected:

  • Everything is numbers — letters, colors, addresses, network data, all of it
  • Numbers are bytes — groups of 8 bits, the atomic unit of memory
  • Hex is shorthand — 2 characters = 1 byte, perfectly aligned with the bit structure
  • RGB is 3 bytes — one per color channel, 16 million colors from 24 bits
  • Text is a table — ASCII and UTF-8 map byte values to characters by agreement
  • Memory has layers — cache exists because the CPU is faster than the wires to RAM
  • Async is hardware — DMA + interrupts, not just a runtime feature

Next up: the Event Loop, Call Stack, and Task Queue — the full picture of how software is scheduled on top of everything above.


Part 2 of the Road to Senior series — documenting everything I'm learning on the way to becoming a senior developer.

← Part 1: Where Your Data Lives