the case for preserving case

a short story of going against your elders, while being accepting of their ways

a screenshot of dropping a file 'draft.docx' into a directory already containing the file 'DRAFT.docx' what happens when you try to drag-n-drop the draft.docx into a directory containing a DRAFT.docx file in macOs?

macOs alert saying: An item named "DRAFT.docx" already exists in this location. Do you want to replace it with the one you're moving?

you get an alert!

this is because macOs is case-insensitive, it considers draft.docx and DRAFT.docx to be the same filename. it's all lowercase in the eyes of my macbook. also in the eyes of most humans, it's easy to follow why you don't want to allow draft.docx and DRAFT.docx to be in the same directory.

treating everything as lowercase is efficient because it simplifies many, many, computer operations 1. however, case contains information, and we don't want to lose that information, we all know the difference between draft_final.docx and FINAL_draft_final.docx. the good news here is that macOs is also case-preserving, meaning you can have your FINAL cake and eat it too!

because computer programmers are binary thinkers, many systems are not designed this way. most case-insensitive file systems are not case-preserving, and most case-preserving systems are case-sensitive. the legendary UNIX system - the ancestral grandparent of macOs - for example, differentiates between draft.docx and DRAFT.docx, and allows both files to be in the same directory2. macOs inherited the UNIX differentiation between draft.docx and DRAFT.docx in terms of displayed filename, but is wise enough to simplify by treating the names as equal for actual operations. the best behaviour in my eyes.

like in many other design decisions, macOs hits the sweet spot of "intuitive but opinionated", while still being accepting and preserving other kinds of workflows. we should all be more like macOs, opinionated, but preserving original meaning.

☺️

footnotes:

  1. that's one meta-reason i write in all lowercase as well, i differentiate less, leading me to type faster, type more

  2. see wikipedia