{"id":629,"date":"2012-07-01T08:25:54","date_gmt":"2012-07-01T15:25:54","guid":{"rendered":"https:\/\/logicalelegance.com\/journey\/?p=629"},"modified":"2012-07-01T08:25:54","modified_gmt":"2012-07-01T15:25:54","slug":"what-is-it-like-to-program","status":"publish","type":"post","link":"https:\/\/logicalelegance.com\/journey\/2012\/07\/what-is-it-like-to-program\/","title":{"rendered":"What is it like to program?"},"content":{"rendered":"<p>I compared <a title=\"Definition of Algorithm\" href=\"https:\/\/logicalelegance.com\/journey\/2012\/05\/words-are-power\/\" target=\"_blank\">algorithms to recipes<\/a> not too long ago. But I wanted to write a post about test driven development (TDD) and how every time I rediscover it, I think that it is great. So I was thinking about how to explain TDD to someone who doesn\u2019t work with computers. And that was when I realized that just explaining how to program is not that easy.<\/p>\n<p><a href=\"https:\/\/logicalelegance.com\/journey\/wp-content\/uploads\/2012\/07\/photo.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-631 alignnone\" title=\"Programming is like poetry\" src=\"https:\/\/logicalelegance.com\/journey\/wp-content\/uploads\/2012\/07\/photo-1024x346.jpg\" alt=\"\" width=\"490\" height=\"165\" srcset=\"https:\/\/logicalelegance.com\/journey\/wp-content\/uploads\/2012\/07\/photo-1024x346.jpg 1024w, https:\/\/logicalelegance.com\/journey\/wp-content\/uploads\/2012\/07\/photo-300x101.jpg 300w, https:\/\/logicalelegance.com\/journey\/wp-content\/uploads\/2012\/07\/photo.jpg 1399w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/a><\/p>\n<p>I think of programming as writing: writing a story that is supposed to evoke a particular response from a given audience. Let\u2019s say you had a young girl and you wanted her to smile, giggle, gasp, cry and then smile (with eye crinkles!). Other than those five actions, you don\u2019t care what she does, but you need all five in, say, 15 minutes.<\/p>\n<blockquote><p>Once upon a time, there was a princess. She looked a lot like you! Her name\u2026 sotto, what is your name? Violet? Oh, that is beautiful! And you know what, her name was Violet too: Princess Violet Purple Lavender!<\/p><\/blockquote>\n<p>Ok, so I bet I\u2019ve knocked off the first two responses there. But I\u2019d have to try it out. I\u2019d have to find a girl (named Violet) and tell her my story-let. And then, if it didn\u2019t work, I\u2019d have to erase her memory and try again.\u00a0 And let\u2019s pretend I could keep erasing and keep trying out stories until I got my five small emotional outbursts, all in order, all in my allotted time.<\/p>\n<p>I may have to learn more about her to accomplish my task? What makes her scared? Is that the best way to elicit a gasp? \u00a0This information may be useful in crafting other stories for other children (or it may not, Violet may be oddly singular). And how I choose to go about this is very personal to me. I\u2019d rather she gasped in surprise than terror. Given the current specification, I have that option.<\/p>\n<p>There are lots of other stories out there, I might crib information from some of them and I might admire the elegant solutions or particularly fine writing. If a story ending isn\u2019t copyrighted and is good for eliciting big smiles, well, I may use it myself, either wholesale or adapting it to the rest of my tale.<\/p>\n<p>When I write programs, I\u2019m telling the computer a story to get it to do what I want. There are lots and lots of ways to do it. Some ways are easier, some ways are considered better (if your Violet is young enough, you might get a gasp by dropping the F-bomb randomly but how are you going to get back to a smile from there?).<\/p>\n<p>Sometimes I do have to figure out how to trick the computer into the action I want, very much like a puzzle. And sometimes I have each action as a preformed Lego block from some other story and I just need to find a good way to hook them together. That can be a puzzle too, especially if they don\u2019t quite fit together (this one has a dragon, that one has a sea monster).<\/p>\n<p>Finally, when I write my story, I\u2019m not only writing for my audience but also for other writers. That story drivel above is clear and understandable but it isn\u2019t great literature. I don\u2019t know that I want to write great literature. But something with a little more craft would please me and any fellow writers who have to read my stories (err\u2026 fellow software engineers who have to read my code). It is kind of like the Anamaniacs cartoon where there were jokes for the kiddies and then there was another level of humor for the adults watching. The programs are for the computers <em>and<\/em> for the other programmers. A lot of programmers forget that.<\/p>\n<p>I could ride this poor metaphor pretty far, but does it make sense to you? I don\u2019t think I\u2019ve represented the square-hole-in-a-round-peg problem-solving and puzzle aspect of it well enough so maybe I need an entirely different metaphor or I need to work in the poetry aspect to it. But then getting a kid to do what you want is often a pretty big puzzle. Anyway, if you program, how would you describe it to someone who didn&#8217;t?<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I compared algorithms to recipes not too long ago. But I wanted to write a post about test driven development (TDD) and how every time I rediscover it, I think that it is great. So I was thinking about how to explain TDD to someone who doesn\u2019t work with computers. And that was when I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[34,15],"class_list":["post-629","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-tech","tag-writing"],"_links":{"self":[{"href":"https:\/\/logicalelegance.com\/journey\/wp-json\/wp\/v2\/posts\/629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/logicalelegance.com\/journey\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/logicalelegance.com\/journey\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/logicalelegance.com\/journey\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/logicalelegance.com\/journey\/wp-json\/wp\/v2\/comments?post=629"}],"version-history":[{"count":4,"href":"https:\/\/logicalelegance.com\/journey\/wp-json\/wp\/v2\/posts\/629\/revisions"}],"predecessor-version":[{"id":634,"href":"https:\/\/logicalelegance.com\/journey\/wp-json\/wp\/v2\/posts\/629\/revisions\/634"}],"wp:attachment":[{"href":"https:\/\/logicalelegance.com\/journey\/wp-json\/wp\/v2\/media?parent=629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/logicalelegance.com\/journey\/wp-json\/wp\/v2\/categories?post=629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/logicalelegance.com\/journey\/wp-json\/wp\/v2\/tags?post=629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}