Member-only story
Copy, Cut, and Insert
Choosing Operations by Their Safety Properties
A column-reordering macro sounds simple: take a set of columns, find them by their headers, and put them in a particular order.
The business requirement is simple: Move these columns from wherever they are to these positions.
💥 Master AI & Tech Skills
💥 Crack Every Tech Interview with Confidence
🔥 Up to 70% OFF — Limited-Time Offer
👉 Enroll Now & Start Learning
But there is an important engineering question hiding underneath that requirement: What does “move” actually mean to the program?
There are 2 ways to implement it.
- One approach is to copy each source column into its destination.
- Another is to cut the source column and insert it into the new position.
They may appear to produce the same result, but they do not necessarily have the same safety properties.
The first implementation: copy into the destination
Consider a simplified version of the first approach:









