Ok, bear with me here, this is going to be a post on a blog.
for (init; condition; increment { statement(s); } while(condition) { statement(s); }
I like it when things fit into boxes. It makes thinking simpler. It is neat when ideas fit together. It is satisfying when a thought can be fitted together and put down, complete. Things make sense.
When writing code I have noticed that I tend toward using for loops over while ones even when a while loop might do the job more ‘intuitively’.
Reality rarely helps, being, as it is, devoid of neat anythings, let alone nice boxes (except literally, lots of those). The world is analogue, seamless, multifaceted (beautiful).
Of course, I disagree with this definition of intuitive – a for loop places its iterative and control statements in a simple block separated from all the code being iterated over. Neat little boxes. Intuitive.
Here I am in 2020, taking a course that has devoted a year to the differing contexts surrounding conflict, in a faculty whose courses are bound together by a collective acceptance of the multiplicity of truth (and falsehood).
I have, of course, loved every moment of it.
(Wait, that’s not right, is it?)
Perhaps my feelings about neat little boxes don’t fit in one
init; while (condition) { statement(s) increment; }
Image Source (without space):
https://www. igreenspot.com/nesting-boxes-made-of-recycled-cardboard-is-sustainable-and-fancy/
Yes, that is a pun made using the definitions of different loop functions in C.
No, I am not sorry.
This was quite poetic, although maybe I’m only saying that because I don’t not understand C.
I like neat boxes. Wouldn’t it be nice if everything fit into them? I have a growing conviction that it’s impossible, however. What I never want to do is ignore or miscategorise what’s left over. They say the exception makes the rule, and things that don’t fit the pattern are always going to be the most important. Often, the most interesting. As a rule, every perspective on reality seems to be flawed. The strange parts, the treasures in the “miscellaneous” pigeonhole, help us find out how.
Anyway, for loops and while loops are both iteration, ergo inferior to recursion.
This was such a creative twist on our usual blog posts, nice 🙂 I agree, it’s always satisfying when things fit into boxes, or are as they appear to be. However the things that tend to interest me the most are often the surprising moments, when things don’t work out as they should have. This was a great read, thanks!