{"id":678,"date":"2009-12-18T12:00:01","date_gmt":"2009-12-18T16:00:01","guid":{"rendered":"http:\/\/www.dr-chuck.com\/wordpress\/?p=678"},"modified":"2011-12-17T12:31:40","modified_gmt":"2011-12-17T16:31:40","slug":"why-should-you-learn-to-write-programs","status":"publish","type":"post","link":"https:\/\/www.dr-chuck.com\/csev-blog\/2009\/12\/why-should-you-learn-to-write-programs\/","title":{"rendered":"Why should you learn to write programs?"},"content":{"rendered":"<p>\n<i>This is the first section of the first chapter of a new book project I am playing with called &#8220;Python for Informatics&#8221; which is a remix of the book &#8220;Think Python&#8221; by Allen B. Downey.  Comments welcome.<\/i><\/p>\n<p>\nWriting programs (or programming) is a very creative<br \/>\nand rewarding activity.  You can write programs for<br \/>\nmany reasons ranging from making your living to solving<br \/>\na difficult data analysis problem to having fun to helping<br \/>\nsomeone else solve a problem.  This book assumes that everyone needs to know how to program and that once<br \/>\nyou know how to program, you will figure out what you want<br \/>\nto do with your newfound skills.<\/p>\n<p>\nWe are surrounded in our daily lives with computers ranging<br \/>\nfrom laptops to cell phones.  We can think of these computers<br \/>\nas our &#8220;personal assistants&#8221; who can take care of many things<br \/>\non our behalf.  The hardware in our current-day computers<br \/>\nis essentially built to continuously as us the question,<br \/>\n&#8220;What would you like me to do next?&#8221;.<\/p>\n<p>\nOur computers are fast and have vasts amounts of memory and<br \/>\ncould be very helpful to us if we only knew the language to<br \/>\nspeak to explain to the computer what we would like it to<br \/>\n&#8220;do next&#8221;.  If we knew this language we could tell the<br \/>\ncomputer to do tasks on our behalf that were reptitive.<br \/>\nInterestingly, the kinds of things computers can do best<br \/>\nare often the kinds of things that we humans find boring<br \/>\nand mind-numbing.<\/p>\n<p>\nFor example, look at the first three paragraphs of this<br \/>\nchapter and tell me the most commonly used word and how<br \/>\nmany times the word is used.  While you were able to read<br \/>\nand understand the words in a few seconds, counting them<br \/>\nis almost painful because is is not the kind of problem<br \/>\nthat human minds are designed to solve.  For a computer<br \/>\nthe opposite is true, reading and understanding text<br \/>\nfrom a piece of paper is hard for a computer to do<br \/>\nbut counting the words and telling you how many times<br \/>\nthe most used word was used is very easy for the<br \/>\ncomputer:<\/p>\n<pre>\npython words.py\nEnter file:words.txt\nto 16\n<\/pre>\n<p>\nOur &#8220;personal information analysis assistant&#8221; quickly<br \/>\ntold us that the word &#8220;to&#8221; was used ten times in the<br \/>\nfirst three paragraphs of this chapter.<\/p>\n<p>\nIt is this very fact that computers are good at things<br \/>\nthat humans are not so good at is why you need to become<br \/>\nskilled at talking &#8220;computer language&#8221;.  Once you learn<br \/>\nthis new language, you can delegate mundane tasks<br \/>\nto your partner (the computer), leaving more time<br \/>\nfor you to do the<br \/>\nthings that you are uniquely suited for.  You bring<br \/>\ncreativity, intuition, and inventiveness to this<br \/>\npartnership.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the first section of the first chapter of a new book project I am playing with called &#8220;Python for Informatics&#8221; which is a remix of the book &#8220;Think Python&#8221; by Allen B. Downey. Comments welcome. Writing programs (or programming) is a very creative and rewarding activity. You can write programs for many reasons [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-678","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/comments?post=678"}],"version-history":[{"count":1,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/678\/revisions"}],"predecessor-version":[{"id":2785,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/678\/revisions\/2785"}],"wp:attachment":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/media?parent=678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/categories?post=678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/tags?post=678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}