4 ms·
When I first read the K&R book, that syntax made perfectly sense. They are building up to it through a few chapters, if I remember correctly. What has changed
by layer8 2y ago
When I first read the K&R book, that syntax made perfectly sense. They are building up to it through a few chapters, if I remember correctly.
What has changed is that nowadays most developers aren't doing low-level programming anymore, where the building blocks of that expression (or the expression itself) would be common idioms.
- card_zero 2y agoYes, I really like it, it's like a neat little pump that moves the string from the right side to the left. But I keep seeing people saying it's needlessly hard to read and should be split over several lines and use += 1 so everyone can understand it. (And they take issue with the assignment's value being used as the value in the while loop and treated as true or false. Though apparently this sort of thing is fine when Python does it with its walrus operator.)
- dmoy 2y agoThat's a very good point I'm now wondering what the Rust lang equivalent of K&R is, so I can go do that in a more modern context.