Re:Software Engineering principles to make teams better
by zomglings on Wednesday June 30, 2021 @03:10PM
(#27692364)
Interestingly, `touch` is not idempotent because it modifies timestamps. Not being pedantic, just an interesting consideration. `mkdir -p` is idempotent, I believe.
Re:Software Engineering principles to make teams better
by mytailorisrich on Wednesday June 30, 2021 @03:20PM
(#27692465)
You're absolutely correct, it's not idempotent for the crucial reason you mention. It's crucial because updating the timestamps is the main purpose of 'touch' in the first place!
Re:Software Engineering principles to make teams better
by omegalulw on Wednesday June 30, 2021 @02:25PM
(#27691898)
Reading a variable isn't side-effect free either :P
Re:Software Engineering principles to make teams better
by rcfox on Wednesday June 30, 2021 @04:01PM
(#27692833)
In the sense that you're moving data in to a register and updating the program counter?
Reading a variable shared between threads without a lock is side-effect free but not idempotent.