Blog

Writing about text

Ten write-ups on the parts of handling text that quietly go wrong: how a find-and-replace ruins a document, which naming convention belongs where, why two files that look identical are not, what an invisible character does to a paste. The tools do the work; these explain what you are about to break.

Text

What Title Case Actually Is

APA, Chicago and MLA agree on the first and last word and argue about the small ones in between.

Read
Text

Why Text Pasted From Word Goes Wrong

Word swaps plain characters for look-alikes while you type. They read fine and fail the first time something compares them exactly.

Read
Text

How Long Does It Take to Read This

A reading-time badge is a word count divided by a rate nobody measured for your text. Where the number comes from, and how far it can be wrong.

Read
Text

How Many Words Fit on a Page: The Real Numbers

About 500 single-spaced, about 250 double-spaced, plus the arithmetic behind both and why your page count and someone else’s will not match.

Read
Text

What Is Lorem Ipsum, and Why Designers Still Use It

Scrambled Cicero that has outlived the printing presses it started on, and the jobs it is quietly bad at.

Read
Text

What a URL Slug Is, and What Makes a Good One

The readable tail of a URL: what belongs in it, why the obvious way of making one breaks, and what changing it later costs you.

Read
Text

How to Reverse Text: Characters, Words and Lines

Reversing a string looks like one line of code. That line detaches accents, splits emoji and can turn one flag into another country.

Read
Text

Online Notepad With No Signup: Where Your Note Goes

A notepad with no login has nowhere to put your text except your own machine. That is fine for ten minutes and risky for a week.

Read
Text

Invisible Characters in Text: Find and Remove Them

A space that is not a space, a character with no width, a mark at the start of a file. Where they come from and how to get them out.

Read
Text

How to Sort a List Alphabetically and Numerically

Sorting a list is ten seconds of work and a pile of surprises: capitals on top, file10 above file2, accents at the bottom.

Read
Text

How to Remove Duplicate Lines From a List

Three ways to dedupe a list, and what to do about the two lines that look identical and refuse to merge.

Read
Text

How to Compare Two Texts for Differences

Paste both versions, let the tool line them up, and learn to read the places where the alignment is guessing.

Read
Text

Find and Replace Text Safely (and What Goes Wrong)

Read the matches before you commit, and the replace-all stops being the thing that costs you an afternoon.

Read
Text

camelCase vs snake_case vs kebab-case: Which to Use

Three naming conventions and one rule for choosing between them: the context decides.

Read

Where to start

If you work with text in bulk, read the mistakes find-and-replace makes first. It is the one piece here that prevents damage rather than explaining it, and the failure it describes is quiet: a replacement that worked on every line you checked and corrupted three you did not.

After that, invisible characters in text covers the other common source of unexplained behaviour, where a string that looks identical to another one is not, and nothing on screen tells you why.

What these pieces have in common

Text looks simple because reading it is effortless, and that is the trap. What a computer stores is a sequence of codepoints, and nearly every surprise in this category comes from the gap between the two. A space may be one of several different characters. A letter with an accent may be one codepoint or two. Two strings that print identically can fail an equality check.

The writing here is mostly about closing that gap for cases that come up often: what title case actually is and why no two style guides agree, the naming conventions and where each belongs, what sorting really does, and what makes a URL slug readable to a person and durable to a search engine.

Frequently asked questions

What is an invisible character and how does one get into my text?

Zero-width spaces, non-breaking spaces, soft hyphens and direction marks all occupy a position in a string without drawing anything. They arrive through copy and paste from word processors, PDFs and web pages, and they break exact matches, URL parsing and code while looking completely normal on screen.

Is there one correct way to write title case?

No. AP, Chicago and APA each have their own rule about which short words stay lowercase, and they disagree with each other. Every automatic title case converter has silently picked one of them. For anything published, the right answer is whichever style guide the publication already follows.

When should I use camelCase, snake_case or kebab-case?

It is almost entirely convention rather than merit, and the convention belongs to the context. JavaScript and Java use camelCase for variables, Python and SQL use snake_case, and kebab-case belongs in URLs and CSS class names, where an underscore is harder to see in an underlined link.

All categories

PDF 10Images 10Design 11Security 8Calculators 13Developer 20Everyday 4Time 7