{"appState":{"pageLoadApiCallsStatus":true},"categoryState":{"relatedCategories":{"headers":{"timestamp":"2022-05-24T18:31:12+00:00"},"categoryId":33599,"data":{"title":"Coding","slug":"coding","image":{"src":null,"width":0,"height":0},"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"slug":"coding","categoryId":33599}],"parentCategory":{"categoryId":33592,"title":"Programming & Web Design","slug":"programming-web-design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"}},"childCategories":[],"description":"Basic coding terminology, planning your coding career, programming for web, freelancing tips, example coding projects, and more.","relatedArticles":{"self":"https://dummies-api.dummies.com/v2/articles?category=33599&offset=0&size=5"}},"_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"}},"relatedCategoriesLoadedStatus":"success"},"listState":{"list":{"count":10,"total":106,"items":[{"headers":{"creationTime":"2018-06-02T04:51:46+00:00","modifiedTime":"2022-04-27T19:00:34+00:00","timestamp":"2022-04-28T00:01:06+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"slug":"coding","categoryId":33599}],"title":"Helping Kids with Coding For Dummies Cheat Sheet","strippedTitle":"helping kids with coding for dummies cheat sheet","slug":"helping-kids-coding-dummies-cheat-sheet","canonicalUrl":"","seo":{"metaDescription":"This Cheat Sheet offers many ways you can support children's learning of coding, and describes many possible career paths for coders.","noIndex":0,"noFollow":0},"content":"Coding is fast becoming a skill that every child needs to be educated for in the 21st Century. But coding is taught at only a small fraction of schools, and often only at the high school level. Helping kids learn how to code also means you’re assisting them in developing a skill that is highly marketable and sets them apart from peers at school and later, in their careers.\r\n\r\nThe topics in this cheat sheet can assist you on getting started when your kid expresses an interest in learning how to code.","description":"Coding is fast becoming a skill that every child needs to be educated for in the 21st Century. But coding is taught at only a small fraction of schools, and often only at the high school level. Helping kids learn how to code also means you’re assisting them in developing a skill that is highly marketable and sets them apart from peers at school and later, in their careers.\r\n\r\nThe topics in this cheat sheet can assist you on getting started when your kid expresses an interest in learning how to code.","blurb":"","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}},{"authorId":9091,"name":"Sarah Guthals","slug":"sarah-guthals","description":"Sarah Guthals, PhD, is a social software engineer, entrepreneur, and former engineering manager at GitHub. She is coauthor of Helping Kids with Coding For Dummies.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9091"}}],"primaryCategoryTaxonomy":{"categoryId":33599,"title":"Coding","slug":"coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}}],"fromCategory":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281734,"slug":"helping-kids-with-coding-for-dummies","isbn":"9781119380672","categoryList":["technology","programming-web-design","coding"],"amazon":{"default":"https://www.amazon.com/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119380677-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-for-dummies-cover-9781119380672-203x255.jpg","width":203,"height":255},"title":"Helping Kids with Coding For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"\n <p><b data-author-id=\"9324\">Camille McCue, PhD,</b> is Director of Curriculum Innovations at the Adelson Educational Campus in Las Vegas where she leads the Startup Incubator, teaches STEM, and kickstarts K-12 learning initiatives. <b data-author-id=\"9091\">Sarah Guthals, PhD,</b> co-founded an ed-tech company and now continues to build technology for kids to learn, create, and share safely online. She loves to teach teachers how to teach coding in the classroom. </p>","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}},{"authorId":9091,"name":"Sarah Guthals","slug":"sarah-guthals","description":"Sarah Guthals, PhD, is a social software engineer, entrepreneur, and former engineering manager at GitHub. She is coauthor of Helping Kids with Coding For Dummies.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9091"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119380672&quot;]}]\" id=\"du-slot-6269d9428a284\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119380672&quot;]}]\" id=\"du-slot-6269d9428ac2a\"></div></div>"},"articleType":{"articleType":"Cheat Sheet","articleList":[{"articleId":252783,"title":"Programming Languages by Ages","slug":"programming-languages-ages","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/252783"}},{"articleId":252786,"title":"Career Paths for Coders","slug":"career-paths-coders","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/252786"}},{"articleId":252789,"title":"Example Applications for Novice Coders by Language","slug":"example-applications-novice-coders-language","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/252789"}},{"articleId":252825,"title":"10 Ways to Invest in a Kid’s Coding Future","slug":"10-ways-invest-kids-coding-future","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/252825"}}],"content":[{"title":"Programming languages by ages","thumb":null,"image":null,"content":"<p>When we were growing up, there weren’t as many applications and languages targeting novices. Logo and Basic were the main choices! Luckily, in the past decade, programmers and educators from around the world have developed so many languages and environments for coders of all ages and levels of expertise! This is a short list of programming languages, applications, and environments by age.</p>\n<h3><strong>Ages 4 to 7</strong></h3>\n<p>The general goal for coding with children as young as age 4 is to help them develop logical thinking and “computational thinking.” Basically, this is understanding how to break apart problems and formulate a set of clearly defined steps to solve the problem in such a way that a computer could carry out the steps.</p>\n<ul>\n<li><a href=\"https://codespark.com/webglhost/\" target=\"_blank\" rel=\"noopener\">The Foos</a></li>\n<li><a href=\"http://www.daisythedinosaur.com/\" target=\"_blank\" rel=\"noopener\">Daisy the Dinosaur</a></li>\n<li><a href=\"https://www.scratchjr.org/\" target=\"_blank\" rel=\"noopener\">ScratchJr</a></li>\n<li><a href=\"https://www.kodable.com/\" target=\"_blank\" rel=\"noopener\">Kodable</a></li>\n<li><a href=\"http://lightbot.com/index.html\" target=\"_blank\" rel=\"noopener\">Light Bot</a></li>\n<li><a href=\"https://www.makewonder.com/dash\">Dash and Dot</a></li>\n<li><a href=\"http://www.microworlds.com/\" target=\"_blank\" rel=\"noopener\">MicroWorlds JR</a></li>\n</ul>\n<h3><strong>Ages 8 to 12</strong></h3>\n<p>Children in this age range really rev up their coding as they advance their math skills and improve their abilities in creating long and more complex sequences of code.</p>\n<p>At this point your goals in guiding them are helping them expand their understanding of how code is used (apps, electronics, and others), fostering their creativity, and building their persistence in sticking-to-it when they encounter challenges — including debugging. Help them realize that they can build almost anything they can imagine!</p>\n<ul>\n<li><a href=\"https://scratch.mit.edu/\" target=\"_blank\" rel=\"noopener\">Scratch</a></li>\n<li><a href=\"https://code.org/educate/applab\" target=\"_blank\" rel=\"noopener\">App Lab</a></li>\n<li><a href=\"https://www.gethopscotch.com/\" target=\"_blank\" rel=\"noopener\">Hopscotch</a></li>\n<li><a href=\"https://www.kodugamelab.com/\" target=\"_blank\" rel=\"noopener\">Kodu</a></li>\n<li><a href=\"http://microbit.org/\" target=\"_blank\" rel=\"noopener\">micro:bit</a></li>\n<li><a href=\"https://makecode.com/\" target=\"_blank\" rel=\"noopener\">Make Code</a></li>\n<li><a href=\"https://www.arduino.cc/\" target=\"_blank\" rel=\"noopener\">Arduino</a></li>\n<li><a href=\"http://www.microworlds.com/\">MicroWorlds EX</a></li>\n<li><a href=\"https://www.tynker.com/\" target=\"_blank\" rel=\"noopener\">Tynker</a></li>\n</ul>\n<h3><strong>Ages 13+</strong></h3>\n<p>Coding with teens introduces a whole new world of making! This is usually when youth start working in text-based languages and therefore engage in industry-standard languages and high-level concepts.</p>\n<p>At this point, you should be motivating your young coders to think about how they might apply what they are learning to future careers, advising them to really plan their programs, and encouraging them to determine what languages would be best for what they want to build.</p>\n<ul>\n<li><a href=\"https://www.alice.org/\" target=\"_blank\" rel=\"noopener\">Alice</a></li>\n<li><a href=\"http://appinventor.mit.edu/explore/\" target=\"_blank\" rel=\"noopener\">MIT App Inventor</a></li>\n<li><a href=\"https://www.python.org/\" target=\"_blank\" rel=\"noopener\">Python</a></li>\n<li><a href=\"https://www.javascript.com/\" target=\"_blank\" rel=\"noopener\">JavaScript</a></li>\n<li><a href=\"https://java.com/en/\" target=\"_blank\" rel=\"noopener\">Java</a></li>\n<li><a href=\"https://www.makewonder.com/cue_the_cleverbot\" target=\"_blank\" rel=\"noopener\">Cue</a></li>\n<li><a href=\"https://gamesalad.com/\" target=\"_blank\" rel=\"noopener\">Game Salad</a></li>\n</ul>\n<p>(<em>Note:</em> Alice is a teaching language, and Cue is a robot that uses both tile-based code and JavaScript.)</p>\n<p>Coding is a life-long journey. Even adults with extensive experience are surprised by the programs they can write in Scratch. So, if you have an older coder, don’t be afraid to challenge them with applications to build in “younger” languages.</p>\n<p>Scratch is the first language used at Berkeley for students who might be interested in computer science — undergraduate students! Exposure, creativity, and exploration is what matters; don’t feel the need to force kids to move onto “real” languages too quickly — let it be a journey!</p>\n"},{"title":"Career paths for coders","thumb":null,"image":null,"content":"<p>The really neat thing about learning to code is that you can literally apply it to pretty much any other passion in life, and any other field.</p>\n<p>Our biggest piece of advice for coders in high school and college who are considering computer science as their career path is to first choose a passion outside of coding, and then figure out a way to apply coding to that passion. This doesn’t have to be a requirement, but it’s a lot of fun and really inspiring to have older kids discover that they can mix their love of rap music to their new-found excitement of computer science and make a career out of it.</p>\n<h3>Software companies</h3>\n<p>The most commonly talked about career path for someone interested in coding is to work for a software company — such as Google, Microsoft, or Facebook. These companies typically hire folks who have degrees in computer science (bachelor’s through doctorate), although they&#8217;ve been known to hire from boot camps and people who are self-taught.</p>\n<p>For many companies, the degree isn’t what matters, only the skill set coders possess. GitHub, for example, is a company that doesn’t require candidates to even list what school they went to, instead asking for a technical portfolio. These companies typically provide high-paying jobs, good benefits, and flexibility in work schedules. Coders are usually the focus of the company, and employees can work on cutting edge technology.</p>\n<h3>Freelance coding</h3>\n<p>One of the really neat things about the computer science industry is that you do not have to join a large tech company to be a part of the field! People all around the world with varying levels of formal education, from being self-taught to having PhDs in computer science, become freelance coders.</p>\n<p>Sites, such as <a href=\"https://www.upwork.com/\" target=\"_blank\" rel=\"noopener\">Upwork</a>, help coders find people who need code written for them. A lot of freelance coders will work on web development or mobile development, because those projects tend to be more contained and have clearer cut lines regarding ownership. This is a great career, especially for those who want to live in places where fewer technical jobs are available.</p>\n<h3>Entertainment companies</h3>\n<p>Most forms of entertainment these days involve an incredible amount of coding. For example, most movies have huge teams of software engineers for special effects and animation.</p>\n<p>Aside from movies, video games are huge efforts by hundreds and thousands of software engineers over years. For example, World of Warcraft took nearly five years to make. Companies such as Blizzard (creator of World of Warcraft) and Riot Games (creator of League of Legends) employ thousands of artists and engineers to produce games.</p>\n<p>Even the music industry has software engineers, creating soundboards, using algorithms to create new music, and discovering new ways to engage with their audiences.</p>\n<p>Finally, entertainment parks are filled with software engineers; most notably Disney’s <em>imagineers</em> are some of the most innovative when it comes to in-person customer experience.</p>\n<h3>Non-software focused companies</h3>\n<p>In today’s world, pretty much every industry and company has a need for a coder. Smaller companies might use existing software or get freelance coders to help. For example, small companies might use something like Wix or Squarespace to create their websites, both of which provide an easy-to-use interface for high quality websites.</p>\n<p>Larger companies, with more specialized software needs, might hire coders to make software specifically for their needs. For example, companies like Target hire software engineers to build the mobile apps, website, and behind-the-scenes software for sales and inventory.</p>\n<p>Working at non-software focused companies can be fun, because the software can have a direct application other than just “software.”</p>\n<h3>Any other industry</h3>\n<p>The really neat thing about knowing how to code is that it can be useful in pretty much any other industry and context, without it being the main focus of your career.</p>\n<p>Having the ability to code could give you the power to enhance and improve your job in ways you didn’t expect. Furthermore, even if you don’t code within your job, you will most likely interact with some kind of software, and that software will most likely have a problem. At this point, you will most likely have to interact with the IT department, and the more you understand about computers and coding, the more likely you are able to explain and help IT resolve your issue.</p>\n"},{"title":"Example applications for novice coders by language","thumb":null,"image":null,"content":"<p>Following, are some ideas for programs you and your young coder can write, separated by programming language. You can also imagine creating almost any of these in the other languages, too.</p>\n<p>When in doubt, search the internet for examples of programs you want to build in the languages you want to build them in — luckily there is almost always a near-example that can help guide you.</p>\n<h3>Scratch</h3>\n<p><a href=\"https://scratch.mit.edu/projects/203946438/\" target=\"_blank\" rel=\"noopener\">Question and Answer Game</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252790\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0101.jpg\" alt=\"kidscode-question\" width=\"535\" height=\"255\" /></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252791\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0102.jpg\" alt=\"kidscode-answer\" width=\"535\" height=\"212\" /></p>\n<p><a href=\"https://scratch.mit.edu/projects/177641066/\" target=\"_blank\" rel=\"noopener\">Asteroid Game</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252794\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0105.jpg\" alt=\"kidscode-asteroid\" width=\"535\" height=\"334\" /></p>\n<p><a href=\"https://scratch.mit.edu/projects/195801142/\" target=\"_blank\" rel=\"noopener\">Costume Changer with Sounds</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252795\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0106.jpg\" alt=\"kidscode-costume\" width=\"535\" height=\"157\" /></p>\n<p><a href=\"https://scratch.mit.edu/projects/204630366/\" target=\"_blank\" rel=\"noopener\">Helicopter Flying</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252796\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0107.jpg\" alt=\"kidscode-helicopter\" width=\"535\" height=\"334\" /></p>\n<p><a href=\"https://scratch.mit.edu/projects/167906267/\" target=\"_blank\" rel=\"noopener\">Crypto Code Breaker</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252798\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0109.jpg\" alt=\"kidscode-crypto\" width=\"437\" height=\"400\" /></p>\n<p><a href=\"https://scratch.mit.edu/projects/204630588/\" target=\"_blank\" rel=\"noopener\">Rock-Paper-Scissors</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252799\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0110.jpg\" alt=\"kidscode-rock\" width=\"535\" height=\"334\" /></p>\n<p><a href=\"https://scratch.mit.edu/projects/196405818/\" target=\"_blank\" rel=\"noopener\">Random Art Maker 1</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252802\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0113.jpg\" alt=\"kidscode-random-art\" width=\"535\" height=\"172\" /></p>\n<p><a href=\"https://scratch.mit.edu/projects/204631318/\" target=\"_blank\" rel=\"noopener\">Random Art Maker 2</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252803\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0114.jpg\" alt=\"kidscode-randomart2\" width=\"535\" height=\"172\" /></p>\n<p><a href=\"https://scratch.mit.edu/projects/203948999/\" target=\"_blank\" rel=\"noopener\">Race</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252804\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0115.jpg\" alt=\"kidscode-race\" width=\"535\" height=\"218\" /></p>\n<p><a href=\"https://scratch.mit.edu/projects/204631450/\" target=\"_blank\" rel=\"noopener\">Greeter</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252809\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0120.jpg\" alt=\"kidscode-greeter\" width=\"535\" height=\"238\" /></p>\n<h3>Micro:bit</h3>\n<p><a href=\"https://makecode.microbit.org/_ajrTHD67s6Aw\" target=\"_blank\" rel=\"noopener\">Stock Ticker</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252797\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0108.jpg\" alt=\"kidscode-face\" width=\"535\" height=\"334\" /></p>\n<p><a href=\"https://makecode.microbit.org/_MCLDL3MCqERH\" target=\"_blank\" rel=\"noopener\">Face Maker</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252822\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0333.jpg\" alt=\"kidscode-stock\" width=\"535\" height=\"334\" /></p>\n<h3>MIT App Inventor</h3>\n<p>Mobile App Game</p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252820\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0131.jpg\" alt=\"kidscode-app\" width=\"250\" height=\"400\" /></p>\n<p>Greeter</p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252821\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0132.jpg\" alt=\"kidscode-winston\" width=\"250\" height=\"400\" /></p>\n<h3>JavaScript/HTML/CSS</h3>\n<p><a href=\"https://drive.google.com/open?id=1xv55S2Z1vOhtOsMQJYPj-E_EqhWMQz6F\" target=\"_blank\" rel=\"noopener\">Greeter</a></p>\n<p>Note: Be sure you have a file called “puppy.jpg” in the same folder as your HTML file so that the image actually appears.</p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252817\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0128.jpg\" alt=\"kidscode-first\" width=\"535\" height=\"220\" /></p>\n<p><a href=\"https://drive.google.com/open?id=1ESeQvij2lkYDCdfDUPKgs2MvmMx0SPvs\" target=\"_blank\" rel=\"noopener\">Picture Hider</a></p>\n<p>Note: Be sure you have files called “puppy.jpg” and “kitten.jpeg” in the same folder as your HTML file so that the images actually appears.</p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252818\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0129.jpg\" alt=\"kidscode-picture\" width=\"535\" height=\"244\" /></p>\n<p><a href=\"https://drive.google.com/file/d/1sALjJDsENfuBgIleYA1KAuhVzByAqzuO/view?usp=sharing\" target=\"_blank\" rel=\"noopener\">Webpage</a></p>\n<p>Note: Be sure you have files called “winston.jpg,” “princess.jpg,” and “luke.jpg” in the same folder as your HTML file so that the images actually appear!</p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252819\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0130.jpg\" alt=\"kidscode-welcome\" width=\"535\" height=\"187\" /></p>\n<h3>Python</h3>\n<p><a href=\"https://repl.it/@sguthals/GainsboroAthleticCodewarrior\" target=\"_blank\" rel=\"noopener\">Mad Libs Game</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252792\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0103.jpg\" alt=\"kidscode-mad-lib\" width=\"535\" height=\"198\" /></p>\n<p><a href=\"https://repl.it/@sguthals/BuzzingCommonMenu\" target=\"_blank\" rel=\"noopener\">Number Guesser</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252805\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0116.jpg\" alt=\"kidscode-guesser\" width=\"535\" height=\"193\" /></p>\n<p><a href=\"https://repl.it/@sguthals/NecessaryEnchantingProblems\" target=\"_blank\" rel=\"noopener\">Greeter</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252806\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0117.jpg\" alt=\"kidscode-names\" width=\"535\" height=\"102\" /></p>\n<p><a href=\"https://repl.it/@sguthals/NaiveOrderlyFile\" target=\"_blank\" rel=\"noopener\">Art Maker</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252807\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0118.jpg\" alt=\"kidscode-print\" width=\"535\" height=\"246\" /></p>\n<p><a href=\"https://repl.it/@sguthals/WeeklyGaseousTranslation\" target=\"_blank\" rel=\"noopener\">Fibonacci Printer</a></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252808\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0119.jpg\" alt=\"kidscode-fibonacci\" width=\"535\" height=\"153\" /></p>\n<h3>Java</h3>\n<p><a href=\"https://drive.google.com/drive/folders/1UndZGQMZ4ArHZ0VqeLDgUDFrDUxySnL_?usp=sharing\" target=\"_blank\" rel=\"noopener\">Pizza Divider</a></p>\n<p>The Pizza Divider is a BlueJ program that you can download and run inside of the BlueJ code editor.</p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252800\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0111.jpg\" alt=\"kidscode-pizza\" width=\"535\" height=\"396\" /></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252801\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0112.jpg\" alt=\"kidscode-pizza\" width=\"535\" height=\"382\" /></p>\n<p><a href=\"https://drive.google.com/drive/folders/1NGwSIiZWBpl4iVC21hxAeut-AMS2wGNW?usp=sharing\" target=\"_blank\" rel=\"noopener\">Greeter</a></p>\n<p>The Greeter is a BlueJ program that you can download and run inside of the BlueJ code editor.</p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252810\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0121.jpg\" alt=\"kidscode-bluej\" width=\"535\" height=\"380\" /></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252811\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0122.jpg\" alt=\"kidscode-naming\" width=\"535\" height=\"152\" /></p>\n<p><a href=\"https://drive.google.com/drive/folders/1sdjjk0CBUU68E3aQY-gTab6a8Ip9Aq3p?usp=sharing\" target=\"_blank\" rel=\"noopener\">Number Sorter</a></p>\n<p>The Number Sorter is a BlueJ program that you can download and run inside of the BlueJ code editor.</p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252812\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0123.jpg\" alt=\"kidscode-numbering\" width=\"535\" height=\"348\" /></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252813\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0124.jpg\" alt=\"kidscode-numbers\" width=\"535\" height=\"97\" /></p>\n<p><a href=\"https://drive.google.com/drive/folders/1zIWS-qtYQ9ygc23zLizYY8I7-jisIMIm?usp=sharing\" target=\"_blank\" rel=\"noopener\">Phone Number Finder</a></p>\n<p>The Phone Number Finder is a BlueJ program that you can download and run inside of the BlueJ code editor.</p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252814\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0125.jpg\" alt=\"kidscode-phone\" width=\"481\" height=\"400\" /></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252815\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0126.jpg\" alt=\"kidscode-phoning\" width=\"463\" height=\"400\" /></p>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-252816\" src=\"https://www.dummies.com/wp-content/uploads/9781119380672-oa0127.jpg\" alt=\"kidscode-final\" width=\"535\" height=\"121\" /></p>\n"},{"title":"10 ways to invest in a kid's coding future","thumb":null,"image":null,"content":"<p>There are so many ways to invest in your young coders coding future. Though a computer with an internet connection and time and dedication are some of the best ways to invest, this list gives an overview of some of the ways parents we know have dedicated time or money to support their children in their coding adventures.</p>\n<p><strong>Coding workshops: </strong>Coding workshops are often one to two hours long and held at community centers or libraries. They vary in price, but provide novice coders with a sense of community and an easy-to-finish project that they can feel proud of.</p>\n<p><strong>Coding camps: </strong>Camps are typically more expensive but offer full  or half days for at least one week. These are great for school breaks and students often finish the camp, having completed a larger project and having a sense of what to do next, on their own.</p>\n<p><strong>Coding classes (in person):</strong> In person coding classes are typically once per week and can happen during the school year (after school or on weekends). Students are often learning something specific and there is a guided curriculum, but they still gain a sense of community and growth.</p>\n<p><strong>Private tutors: </strong>For your budding coder who really wants to build something specific, a private tutor can help get your young coder ready for a high school or college class, support them outside of a class they are already taking, or help them create a very specific project that they have in mind.</p>\n<p><strong>Coding classes (online):</strong> Online classes are great for asynchronously learning; with the ability to watch videos, pause them, and re-watch them, students are able to learn a variety of things without the hassle of leaving their home. Sometimes you can still get a sense of community, depending on the platform.</p>\n<p><strong><a href=\"https://www.lego.com/en-us/themes/mindstorms\" target=\"_blank\" rel=\"noopener\">Lego Mindstorms</a></strong>: Lego Mindstorms is an entire kit that integrates coding and robot building. A young coder can work on this on their own, or even create a team of people and recruit an adult to help lead them through the curriculum provided by Lego in its Education set.</p>\n<p><strong><a href=\"https://kano.tech/us/original\" target=\"_blank\" rel=\"noopener\">Kano</a>:</strong> Kano is an all-in-one, lightweight, DIY computer. Using a micro-controller as the computer (Raspberry Pi), and simple mouse, keyboard, and speakers, young coders can quickly wire up their computer and play Minecraft, jump on the web, or start coding.</p>\n<p><strong>Codable toys: </strong>A great gift for the young coder is codable toys. With edutainment like <a href=\"http://littlebits.cc/\" target=\"_blank\" rel=\"noopener\">Little Bits</a>, or the <a href=\"https://www.makewonder.com/\" target=\"_blank\" rel=\"noopener\">Dash and Dot Robots</a>, coding can be for an immediate purpose—changing and interacting with the world around you.</p>\n<p><strong>Computers and devices</strong>: A big question is always what kind of device to get for a young coder. Often hand-me-down computers (OSX or Windows) can be useful, as long as they can run the programs your young coder is looking to run. If you’re primarily working on the web, a Chromebook can be a great option (especially for Scratch coders). And every day more apps are coming out, making mobile devices more accessible to young coders too.</p>\n<p><strong>Software: </strong>Most software that a young coder will want to use is free; however, sometimes it can make sense to invest in software to support the entire development process. Software like Photoshop or Illustrator can invite more artistic folks into the coding world, integrating their creations into software like Blender or Maya to create games in game engines like Unity.</p>\n"}],"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Explore","lifeExpectancy":"One year","lifeExpectancySetFrom":"2022-04-27T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":252828},{"headers":{"creationTime":"2017-04-24T18:11:34+00:00","modifiedTime":"2022-02-25T13:46:58+00:00","timestamp":"2022-02-25T18:01:12+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"slug":"coding","categoryId":33599}],"title":"Coding All-in-One For Dummies Cheat Sheet","strippedTitle":"coding all-in-one for dummies cheat sheet","slug":"coding-one-dummies-cheat-sheet","canonicalUrl":"","seo":{"metaDescription":"Learning how to code is a lot like learning a new language. With this guide, the ability to speak, think, and write in code will become second nature.","noIndex":0,"noFollow":0},"content":"Coding is equal parts vocabulary, logic, and syntax. Coding may at first seem intimidating, but with practice, though, it's easy to get comfortable with its terminology, concepts, and structure. Understanding coding is not unlike learning a new language: Use it often enough and you'll find yourself able to speak, think, and write in code. Still, it's natural for beginners to have questions. There are many coding resources available to you, both on- and off-line. Ask around and you'll find you're not alone — many other people are learning. After all, coding is a never-ending education. Master one facet or another and a new one opens in front of you.","description":"Coding is equal parts vocabulary, logic, and syntax. Coding may at first seem intimidating, but with practice, though, it's easy to get comfortable with its terminology, concepts, and structure. Understanding coding is not unlike learning a new language: Use it often enough and you'll find yourself able to speak, think, and write in code. Still, it's natural for beginners to have questions. There are many coding resources available to you, both on- and off-line. Ask around and you'll find you're not alone — many other people are learning. After all, coding is a never-ending education. Master one facet or another and a new one opens in front of you.","blurb":"","authors":[{"authorId":9097,"name":"Nikhil Abraham","slug":"nikhil-abraham","description":"Nikhil Abraham is the CFO of Udacity, an education company that teaches technology skills that help launch or advance a career. Prior to joining Udacity, Abraham worked at Codecademy, where he taught beginning coders across a variety of professions. He is also author of Coding For Dummies and Getting a Coding Job For Dummies. ","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9097"}}],"primaryCategoryTaxonomy":{"categoryId":33599,"title":"Coding","slug":"coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":242447,"title":"The People Who Bring a Web App to Life","slug":"people-bring-web-app-life","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/242447"}},{"articleId":242444,"title":"Research Sources for Coding Your Own App","slug":"research-sources-coding-app","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/242444"}},{"articleId":242436,"title":"Getting Ready to Code? Do These Things First","slug":"getting-ready-code-things-first","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/242436"}},{"articleId":242408,"title":"Dealing with Dates in Your Data","slug":"dealing-dates-data","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/242408"}},{"articleId":242404,"title":"The Limits of Rating Data in Machine Learning","slug":"limits-rating-data-machine-learning","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/242404"}}],"fromCategory":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281666,"slug":"coding-all-in-one-for-dummies","isbn":"9781119363026","categoryList":["technology","programming-web-design","coding"],"amazon":{"default":"https://www.amazon.com/gp/product/1119363020/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119363020/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119363020-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119363020/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119363020/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/coding-all-in-one-for-dummies-cover-9781119363026-203x255.jpg","width":203,"height":255},"title":"Coding All-in-One For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"\n <p><b data-author-id=\"9097\">Nikhil Abraham</b> is the CFO of Udacity, an education company that teaches technology skills that help launch or advance a career. Prior to joining Udacity, Nik worked at Codecademy where he taught beginning coders across a variety of professions. He is also author of <i>Coding For Dummies</i> and <i>Getting a Coding Job For Dummies.</i> </p>","authors":[{"authorId":9097,"name":"Nikhil Abraham","slug":"nikhil-abraham","description":"Nikhil Abraham is the CFO of Udacity, an education company that teaches technology skills that help launch or advance a career. Prior to joining Udacity, Abraham worked at Codecademy, where he taught beginning coders across a variety of professions. He is also author of Coding For Dummies and Getting a Coding Job For Dummies. ","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9097"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119363026&quot;]}]\" id=\"du-slot-6219196827381\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119363026&quot;]}]\" id=\"du-slot-6219196827d43\"></div></div>"},"articleType":{"articleType":"Cheat Sheet","articleList":[{"articleId":238417,"title":"Basic Coding Vocabulary","slug":"coding-vocabulary-2","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/238417"}},{"articleId":238425,"title":"References and Resources for the Beginning Programmer","slug":"coding-references-resources","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/238425"}},{"articleId":238428,"title":"Performing in a Coding Job Interview","slug":"performing-coding-interview","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/238428"}}],"content":[{"title":"Basic coding vocabulary ","thumb":null,"image":null,"content":"<div id=\"article-content-wrapper\" data-v-89b5964a=\"\" data-v-76ccd6ad=\"\">\n<article class=\"article-content\" data-v-89b5964a=\"\" data-testid=\"articleContent\">Coding has an extensive vocabulary that to laymen can seem like impenetrable techno-babble. Whether you&#8217;re reading coding-related article online or speaking to a developer at work, you may hear words that you have not heard before or that have a different meaning in a coding context. Here are some common vocabulary words to know:</p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><strong>General web development terms:</strong>\n<ul>\n<li><em>Server:</em> A computer that hosts website code, and that &#8220;serves&#8221; website code when requested by a &#8220;client&#8221; computer. Servers usually sit in large warehouses with thousands of other servers, and are similar in size and power to your home computer.</li>\n<li><em>Client:</em> A device used to access a website, including desktop or laptop computers, tablets, or mobile phones.</li>\n<li><em>Designer:</em> An artistic professional who decides how a website will look and feel, along with the ways users will interact with the website — such as, for example, clicking, swiping, scrolling, and so on.</li>\n<li><em>Wireframe:</em> An illustration created by designers that show in detail a website&#8217;s layouts, images, and color schemes.</li>\n<li><em>Developer:</em> An engineering professional who writes code to turn wireframes into useable websites. Based on the type of code written, developers are referred to as front-end, back-end, or full stack.</li>\n<li><em>Front-end:</em> Everything you can see and click in a browser. Front-end developers write code in front-end languages like HTML, CSS, and JavaScript to create the website appearance.</li>\n<li><em>Back-end:</em> Everything that happens behind-the-scenes to make the front-end perform as intended. Back-end developers write code in back-end languages like Ruby or Python to create functionality like logging in users, storing user preferences, and retrieving data like comments on a photo.</li>\n</ul>\n</li>\n<li><strong>Terms related to front-end languages:</strong>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li><em>HTML (Hypertext Markup Language): </em>A language used to place text, images, and other content on a webpage.</li>\n<li><em>HTML tag:</em> HTML instructions, usually appearing in pairs. Browsers apply special effects to text between an opening <code>&lt;element&amp;gt&lt; code=\"\"&gt;; and closing &lt;/element&amp;gt&lt;&gt;; HTML tag. For instance, the &lt;h1&amp;gt&lt; code=\"\"&gt;; tag renders in a browser as a large bolded headline and can be used like this:</code><br />\n<h1>Dewey beats Truman</h1>\n<p><code>.&lt;/h1&amp;gt&lt;&gt;</code></li>\n</ul>\n</li>\n</ul>\n<p><code></code></li>\n<li><em>HTML attribute:</em> Attributes or parameters for HTML tags that modify the tag&#8217;s behavior. Attributes are always placed in the opening HTML tag. For example, <code>href</code> is the attribute in the following anchor tag (used to create hyperlinks): <code><a href=\"http://www.google.com/\">Search engine</a></code></li>\n<li><code></code></li>\n<li><em>CSS (</em>Cascading Style Sheets): Code that modifies HTML on webpages and that controls the appearance of content by changing text size, image size, and other attributes.</li>\n<li><code></code></li>\n<li><em>JavaScript:</em> Code that adds interactivity and animation to webpages. JavaScript also detects browser events such as mouse clicks, validates user input such as text entries, and retrieves data from external websites.</li>\n<li><code></code></li>\n<li><em>Variable:</em> A storage location that&#8217;s given a name and that contains numerical data or text (referred to as <em>strings</em>) for later use.</li>\n<li><code></code></li>\n<li><em>If statement (conditional):</em> A code instruction that tests a condition that usually includes variables, such as <code>x &lt; 18</code>, and executes code you write when the condition is true.</li>\n<li><code></code></li>\n<li><em>Function:</em> A name given to a group of programming statements for easy reference and use.</li>\n<li><code></code><code></code></li>\n</ul>\n</li>\n</ul>\n<p><code></code></p>\n<ul>\n<li><strong>Terms related to back-end languages:</strong>\n<ul>\n<li><em>Ruby:</em> An open-source programming language best known for use in web programming.</li>\n<li><em>Rails:</em> A framework designed to make creating webpages with Ruby easy.</li>\n<li><em>Python:</em> An open-source programming language used on the web, in scientific applications, and for data analysis.</li>\n</ul>\n</li>\n</ul>\n<p><code></code></article>\n</div>\n<div class=\"about-article-section\" data-v-2c35db38=\"\" data-v-76ccd6ad=\"\">\n<h2 class=\"h3 section-title\" data-v-2c35db38=\"\" data-testid=\"aboutArticleHead\"></h2>\n</div>\n"},{"title":"References and resources for the beginning programmer ","thumb":null,"image":null,"content":"<p>HTML, CSS, and JavaScript are the most common front-end coding languages. Following is a list of some online resources, references, and tutorials to help you continue practicing all three languages.</p>\n<ul>\n<li><a href=\"http://www.w3schools.com/\">W3Schools</a>: Reference guides for HTML, CSS, and JavaScript</li>\n<li><a href=\"http://overapi.com/html/\">HTML cheat sheet</a>: Most commonly used HTML commands</li>\n<li><a href=\"http://overapi.com/css/\">CSS cheat sheet</a>: Most commonly used CSS commands</li>\n<li><a href=\"http://www.html5rocks.com/en/tutorials/\">HTML tutorials</a>: Tutorials and articles for the web maintained by Google</li>\n<li><a href=\"http://css-tricks.com/\">CSS tutorials</a>: Tutorials and articles for web programming, with a focus on CSS</li>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript\">JavaScript tutorials</a>: Tutorials and reference guides for JavaScript</li>\n</ul>\n"},{"title":"Performing in a coding job interview ","thumb":null,"image":null,"content":"<p>You&#8217;ve filtered coding job postings, networked with dozens of people, created a great portfolio site, and finally landed one or more interviews. Use these tips to maximize the chances of turning the interview into an offer for employment:</p>\n<ul>\n<li><strong>Prepare diligently</strong>: Review the company&#8217;s website, blog posts, news releases, tweets, and any other social media to learn more about the company&#8217;s culture, technologies, and past clients. For public companies, browse annual reports to get a sense for past performance and future strategic goals.</li>\n<li><strong>Advocate for yourself:</strong> You know what you want and why, so make sure you communicate that to your future potential employer. Think about why you want to work at the company, which product you&#8217;d be most excited to work on, and what you want to spend the next few months and years learning technically. If you don&#8217;t have any preferences or thoughts, it can be hard for an employer to believe that you&#8217;re excited about the company and that you&#8217;ll have the motivation to keep learning on the job.</li>\n<li><strong>Sharpen technical skills:</strong> Assessment of technical skills are the big part of any coding interview, so review code for programs you&#8217;ve already built and make sure you understand why you made certain decisions and used certain technologies. A big part of your job will be deciding what tools to use and when, and employers want to see as soon as possible your thought process on how you choose your tools.</li>\n<li><strong>Show your fit:</strong> Many candidates are technically competent but fail the fit interview. Make sure you understand before the interview the company&#8217;s culture and values so you&#8217;ll have time to see whether you&#8217;ll fit in.</li>\n<li><strong>Ask questions:</strong> Demonstrate your passion by asking questions that are not answered on the company website. Your interviewer has likely just spent thirty minutes asking you personal questions, so feel free to ask some personal questions of your own about the role, the work, or the company.</li>\n<li><strong>Follow up:</strong> After the interview is over, your interviewers will categorize you as a definite hire, possible hire, or rejected candidate. Many people fall into the possible hire category, and following up with your interviewers can increase your chances of receiving an offer. After your interview, send a short email thanking your interviewers, reinforcing your key skills, and addressing any weak areas that came up during the interview. Additionally, include a brief reference to any personal interests you shared with your interviewers to help them remember you.</li>\n</ul>\n"}],"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"One year","lifeExpectancySetFrom":"2022-02-25T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":238432},{"headers":{"creationTime":"2016-03-27T16:47:47+00:00","modifiedTime":"2022-02-23T20:17:31+00:00","timestamp":"2022-02-24T17:07:37+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"slug":"coding","categoryId":33599}],"title":"Coding For Kids For Dummies Cheat Sheet","strippedTitle":"coding for kids for dummies cheat sheet","slug":"coding-for-kids-for-dummies-cheat-sheet","canonicalUrl":"","seo":{"metaDescription":"Learn how to create programs in Scratch, code apps in App Lab, and write code in MakeCode to operate the micro:bit electronics board.","noIndex":0,"noFollow":0},"content":"Coding, or computer programming, is your way of communicating with technology. It’s the new literacy you need to master to be successful in the coming decades. Like any form of communication, coding takes place through language. Just as there are many human languages (English, French, Mandarin, Spanish, and so on), there are many coding languages! Two examples of coding languages are Scratch and JavaScript. Scratch is perfect as a coding language for kids because it’s easy and fun to use, Scratch coding for kids allows you to build programs by snapping together commands in the same way you assemble a puzzle.\r\n\r\nJavaScript is a step up in difficulty because it’s an authentic programming language, used by real coders. JavaScript powers many technologies, and you can use it to make both apps for your phone and control code for operating electronics gadgets. You can ease into JavaScript by using blocks to build programs (just like Scratch) and then switching to text-based coding when you’re ready. Here, discover tips for creating programs in Scratch, coding JavaScript apps in App Lab, and writing JavaScript code in MakeCode to operate the micro:bit electronics board.\r\n\r\n[caption id=\"attachment_261750\" align=\"alignnone\" width=\"535\"]<img class=\"size-full wp-image-261750\" src=\"https://www.dummies.com/wp-content/uploads/coding-kids.jpg\" alt=\"Kids coding on laptops\" width=\"535\" height=\"357\" /> ©By Photographee.eu/Shutterstock[/caption]","description":"Coding, or computer programming, is your way of communicating with technology. It’s the new literacy you need to master to be successful in the coming decades. Like any form of communication, coding takes place through language. Just as there are many human languages (English, French, Mandarin, Spanish, and so on), there are many coding languages! Two examples of coding languages are Scratch and JavaScript. Scratch is perfect as a coding language for kids because it’s easy and fun to use, Scratch coding for kids allows you to build programs by snapping together commands in the same way you assemble a puzzle.\r\n\r\nJavaScript is a step up in difficulty because it’s an authentic programming language, used by real coders. JavaScript powers many technologies, and you can use it to make both apps for your phone and control code for operating electronics gadgets. You can ease into JavaScript by using blocks to build programs (just like Scratch) and then switching to text-based coding when you’re ready. Here, discover tips for creating programs in Scratch, coding JavaScript apps in App Lab, and writing JavaScript code in MakeCode to operate the micro:bit electronics board.\r\n\r\n[caption id=\"attachment_261750\" align=\"alignnone\" width=\"535\"]<img class=\"size-full wp-image-261750\" src=\"https://www.dummies.com/wp-content/uploads/coding-kids.jpg\" alt=\"Kids coding on laptops\" width=\"535\" height=\"357\" /> ©By Photographee.eu/Shutterstock[/caption]","blurb":"","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}}],"primaryCategoryTaxonomy":{"categoryId":33599,"title":"Coding","slug":"coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[],"fromCategory":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281668,"slug":"coding-for-kids-for-dummies-2nd-edition","isbn":"9781119555162","categoryList":["technology","programming-web-design","coding"],"amazon":{"default":"https://www.amazon.com/gp/product/1119555167/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119555167/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119555167-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119555167/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119555167/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/coding-for-kids-for-dummies-2nd-edition-cover-9781119555162-203x255.jpg","width":203,"height":255},"title":"Coding For Kids For Dummies, 2nd Edition","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"\n <p><b data-author-id=\"9324\">Camille McCue, PhD</b> is a STEM educator and leader who has worked for IBM, NASA, PBS, and numerous independent schools. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science. Camille is co-author of <i>Helping Kids with Coding For Dummies</i> and author of <i>Getting Started with Coding</i> and <i>Getting Started with Engineering.</i> </p>","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119555162&quot;]}]\" id=\"du-slot-6217bb5996478\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119555162&quot;]}]\" id=\"du-slot-6217bb5996df5\"></div></div>"},"articleType":{"articleType":"Cheat Sheet","articleList":[{"articleId":261740,"title":"How to Create Programs in Scratch","slug":"","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/261740"}},{"articleId":261743,"title":"How to Build Apps in App Lab","slug":"","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/261743"}},{"articleId":261747,"title":"How to Write Control Code for Electronics","slug":"","categoryList":[],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/261747"}}],"content":[{"title":"How to create programs in Scratch","thumb":null,"image":null,"content":"<p>Scratch is a coding language, but it is also an all-in-one integrated development environment (IDE) in which kids can design, code, test, and share their programs. Here are some tips for getting started with Scratch coding:</p>\n<ul>\n<li>Open <a href=\"https://scratch.mit.edu/\" target=\"_blank\" rel=\"noopener\">Scratch</a>. Select Create or File→to start a project.</li>\n<li>For project starter ideas, click the Tutorials button in the menu bar.</li>\n<li>Every new project starts with Backdrop1 — which is blank. You can add a new backdrop by clicking the Choose a Backdrop icon and then selecting a backdrop from the Choose a Backdrop library.</li>\n<li>Every new project starts with Sprite1 — which is Scratch Cat. You can keep Scratch Cat and write code for him to run, or you can cut him by clicking the X in his icon. You can add a new sprite by clicking the Choose a Sprite icon and then selecting a sprite from the Choose a Sprite Library.</li>\n<li>Change sprite attributes by typing new numbers for the x position, y position, size, and direction.</li>\n<li>Start a new program with an event, such as <code>when green flag clicked</code>. At the Code tab, select the Events category and then drag the event to the code workspace. Add one or more commands to the event, attaching each new command to the previous event, to build a code block. Run the code block by clicking the green flag (or whatever event handler you chose). Stop the code block by clicking the stop sign icon.</li>\n<li>Add additional sprites to your project, and build whatever code you want on each sprite.</li>\n<li>You can add new sounds. First, click the Sounds tab and then click the Choose a Sound icon. Click a sound from the Choose a Sound library to add it to your program. Then add the new sound to your code by clicking the Code tab and then clicking the Sound icon to display the sound commands. Drag a sound command such as <code>play sound</code> to the workspace, and attach it to a code block. Press the arrow in the <code>play sound</code> command and select the sound you added. Then test your code block to hear the sound.</li>\n<li>Name your project and, if you want, click the Share button to make it publicly visible.</li>\n</ul>\n"},{"title":"How to build apps in App Lab","thumb":null,"image":null,"content":"<p>App Lab is an IDE for building apps using JavaScript. You can design and code your apps in App Lab. Then you can test them in an online simulator and — when they’re working just the way you want — you can share them, even sending them to your phone. Here are some tips for getting started working in App Lab:</p>\n<ul>\n<li>Open <a href=\"https://code.org/educate/applab\" target=\"_blank\" rel=\"noopener\">App Lab</a>. Set up a new account, or log in to your existing account. Click Try It Out to start a project.</li>\n<li>Click the Design button to switch to Design mode, where you lay out the appearance of your app. The Design toolbox opens, showing elements that you can drag to screen1 of the simulator.</li>\n<li>To add a background to your app, work in Design mode. Click the simulator screen, and then click the Color tab in the Properties area to choose a new background color. Or click the Choose link to upload a background image. The color or image appears as the background in the simulator.</li>\n<li>To create elements on your screen, work in Design mode. Click the icon for an element in the Design toolbox and then drag it to the screen. Commonly used elements are Button, Label, Text Input, Image, and Screen. For example, create a button for a user to click. In Design mode, drag the Button icon to the screen and place it anywhere you want. In the Properties area, change some attributes of the button you want, such as size and color. Note that the button ID is <code>button1</code>. Type <strong>CLICK ME</strong> in the text field of the button properties.</li>\n<li>To code your app, click the Code button to switch your interface to Code mode. In App Lab, you create all code in a single program, which is displayed in the Code workspace. You can work in block mode or text mode, toggling between the two modes by selecting the Show Blocks/Show Text button. Each command is listed on a separate line.</li>\n<li>Commands are displayed in Code mode in the toolbox, grouped by function, such as UI (user interface) controls. To build your program, drag a command from the toolbox to the workspace. Attach new commands to previously added commands, snapping them together.</li>\n<li>Start a new program with an event, such as <code>onEvent</code>. At the Code tab, select the UI category and then drag <code>onEvent</code> to the Code workspace. Continuing with the button example, press the ID tab in the command and select <code>button1</code> from the drop-down list. Leave the other items in the command as-is. Now make something happen when you click the button. From the UI category, drag a <code>setProperty</code> command to the Code workspace, placing it inside <code>onEvent</code>. Set the command to read <code>setProperty(\"screen1\", \"background-color\", \"red\");</code>.</li>\n<li>Test code in the simulator by clicking the Run button. In the button example, clicking the Run button and the clicking the Click Me button triggers the event to turn the screen red.</li>\n<li>Add additional elements to your project, and build whatever code you want on each element.</li>\n<li>Name your app and, if you want, click the Share button, sending it to a phone for mobile operation.</li>\n</ul>\n"},{"title":"How to write control code for electronics","thumb":null,"image":null,"content":"<p>MakeCode is an easy-to-use IDE for writing and testing programs for controlling a kid-friendly electronics board called the <a href=\"https://makecode.microbit.org/\" target=\"_blank\" rel=\"noopener\">micro:bit</a>. You write JavaScript in MakeCode, testing your programs in an online simulator.</p>\n<p>If you want, you can upload a completed program to a micro:bit board to create a real, working gadget! Here are some tips for getting started with MakeCode for micro:bit:</p>\n<ul>\n<li>Open App Lab. Click New Project to start a project.</li>\n<li>In MakeCode, you build code blocks, with each code block associated with an event. All the code blocks are displayed in the code workspace. You can work in Blocks mode or JavaScript (text) mode, and you can move between the two modes by using the toggle button at the top of the workspace. In JavaScript (text) mode, each command is listed on a separate line.</li>\n<li>Commands are grouped by function, such as Basic, Input, Music, LED , Radio, Loops, Logic, Variables, and Math. You can click the Advanced tab for many additional, useful commands, including Pins. To build your program, drag a command from the code categories into the workspace. Attach new commands to previously added commands, snapping them together.</li>\n<li>Commands from the Input category allow you to capture data from micro:bit sensors, including button clicks, accelerometer shakes, compass headings, temperature, light levels, and pin presses.</li>\n<li>Start a new program with an event, such as <code>on button A pressed</code>. Drag this command from the Input category into the workspace. (You can drag the starter commands, <code>on start</code> and <code>forever</code>, which are already in the workspace at the start of a new project, back into the command categories to remove them from your program.) Then drag a command from the Basic category, such as <code>show string “Hello!” </code>to the code workspace, placing it inside the <code>on button A pressed</code> command.</li>\n<li>Test code in the simulator by activating the sensors you have programmed. In the example, when you click button A in the simulator, <em>HELLO!</em> should scroll across the screen of the micro:bit.</li>\n<li>Add additional code blocks to your project, and build whatever code you want on each code block.</li>\n<li>Name your app and, if you want, transfer your code to a real micro:bit. Just attach a micro:bit to your computer using a microUSB-to-USB cable. Click the Download button in the MakeCode IDE to download your code to your computer. Then drag the downloaded file (which is in .hex format) to the icon representing your micro:bit on your computer. The micro:bit blinks orange for a few seconds to tell you that the transfer is taking place.</li>\n<li>Disconnect a micro:bit (with its program onboard) from the computer, and then attach a portable battery pack to the board. You can now run the program on the micro:bit, away from the computer!</li>\n</ul>\n"}],"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Explore","lifeExpectancy":"One year","lifeExpectancySetFrom":"2022-02-23T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":207624},{"headers":{"creationTime":"2016-03-27T16:47:36+00:00","modifiedTime":"2022-01-19T21:36:32+00:00","timestamp":"2022-02-24T17:07:25+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"slug":"coding","categoryId":33599}],"title":"Coding For Dummies Cheat Sheet","strippedTitle":"coding for dummies cheat sheet","slug":"coding-for-dummies-cheat-sheet","canonicalUrl":"","seo":{"metaDescription":"Keep this handy Cheat Sheet nearby as you're learning to code. It includes coding vocabulary, common mistakes, and helpful resources.","noIndex":0,"noFollow":0},"content":"Coding is equal parts vocabulary, logic, and syntax. Coding may at first seem intimidating, but with practice, though, it’s easy to get comfortable with its terminology, concepts, and structure. Understanding coding is not unlike learning a new language: Use it often enough and you’ll find yourself able to speak, think, and write in code. Still, it’s natural for beginners to have questions.\r\n\r\nThere are many coding resources available to you, both on- and off-line. Ask around and you’ll find you’re not alone — many other people are learning. After all, coding is a never-ending education. Master one facet or another and a new one opens in front of you.","description":"Coding is equal parts vocabulary, logic, and syntax. Coding may at first seem intimidating, but with practice, though, it’s easy to get comfortable with its terminology, concepts, and structure. Understanding coding is not unlike learning a new language: Use it often enough and you’ll find yourself able to speak, think, and write in code. Still, it’s natural for beginners to have questions.\r\n\r\nThere are many coding resources available to you, both on- and off-line. Ask around and you’ll find you’re not alone — many other people are learning. After all, coding is a never-ending education. Master one facet or another and a new one opens in front of you.","blurb":"","authors":[{"authorId":9097,"name":"Nikhil Abraham","slug":"nikhil-abraham","description":"Nikhil Abraham is the CFO of Udacity, an education company that teaches technology skills that help launch or advance a career. Prior to joining Udacity, Abraham worked at Codecademy, where he taught beginning coders across a variety of professions. He is also author of Coding For Dummies and Getting a Coding Job For Dummies. ","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9097"}}],"primaryCategoryTaxonomy":{"categoryId":33599,"title":"Coding","slug":"coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":203276,"title":"How to Hack Your Favorite News Website","slug":"how-to-hack-your-favorite-news-website","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/203276"}},{"articleId":145695,"title":"Common Coding Mistakes","slug":"common-coding-mistakes","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/145695"}},{"articleId":145687,"title":"Coding References and Resources","slug":"coding-references-and-resources","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/145687"}},{"articleId":145681,"title":"Coding Vocabulary","slug":"coding-vocabulary","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/145681"}},{"articleId":145680,"title":"Hosting Your Web Application","slug":"hosting-your-web-application","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/145680"}}],"fromCategory":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281667,"slug":"coding-for-dummies","isbn":"9781119293323","categoryList":["technology","programming-web-design","coding"],"amazon":{"default":"https://www.amazon.com/gp/product/1119293324/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119293324/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119293324-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119293324/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119293324/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/coding-for-dummies-cover-9781119293323-205x255.jpg","width":205,"height":255},"title":"Coding For Dummies","testBankPinActivationLink":"","bookOutOfPrint":true,"authorsInfo":"\n <p><b data-author-id=\"9097\">Nikhil Abraham</b> is the CFO of Udacity, an education company that teaches technology skills that help launch or advance a career. Prior to joining Udacity, Abraham worked at Codecademy, where he taught beginning coders across a variety of professions. He is also author of Coding For Dummies and Getting a Coding Job For Dummies.</p>","authors":[{"authorId":9097,"name":"Nikhil Abraham","slug":"nikhil-abraham","description":"Nikhil Abraham is the CFO of Udacity, an education company that teaches technology skills that help launch or advance a career. Prior to joining Udacity, Abraham worked at Codecademy, where he taught beginning coders across a variety of professions. He is also author of Coding For Dummies and Getting a Coding Job For Dummies. ","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9097"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119293323&quot;]}]\" id=\"du-slot-6217bb4d73983\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119293323&quot;]}]\" id=\"du-slot-6217bb4d74368\"></div></div>"},"articleType":{"articleType":"Cheat Sheet","articleList":[{"articleId":145681,"title":"Coding Vocabulary","slug":"coding-vocabulary","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/145681"}},{"articleId":145687,"title":"Coding References and Resources","slug":"coding-references-and-resources","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/145687"}},{"articleId":145695,"title":"Common Coding Mistakes","slug":"common-coding-mistakes","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/145695"}}],"content":[{"title":"Basic coding vocabulary","thumb":null,"image":null,"content":"<p>Coding has an extensive vocabulary that to laymen can seem like impenetrable techno-babble. Whether you&#8217;re reading coding-related article online or speaking to a developer at work, you may hear words that you have not heard before or that have a different meaning in a coding context. Here are some common vocabulary words to know:</p>\n<ul>\n<li><strong>General web development terms:</strong>\n<ul>\n<li><em>Server:</em> A computer that hosts website code, and that &#8220;serves&#8221; website code when requested by a &#8220;client&#8221; computer. Servers usually sit in large warehouses with thousands of other servers, and are similar in size and power to your home computer.</li>\n<li><em>Client:</em> A device used to access a website, including desktop or laptop computers, tablets, or mobile phones.</li>\n<li><em>Designer:</em> An artistic professional who decides how a website will look and feel, along with the ways users will interact with the website — such as, for example, clicking, swiping, scrolling, and so on.</li>\n<li><em>Wireframe:</em> An illustration created by designers that show in detail a website&#8217;s layouts, images, and color schemes.</li>\n<li><em>Developer:</em> An engineering professional who writes code to turn wireframes into useable websites. Based on the type of code written, developers are referred to as front-end, back-end, or full stack.</li>\n<li><em>Front-end:</em> Everything you can see and click in a browser. Front-end developers write code in front-end languages like HTML, CSS, and JavaScript to create the website appearance.</li>\n<li><em>Back-end:</em> Everything that happens behind-the-scenes to make the front-end perform as intended. Back-end developers write code in back-end languages like Ruby or Python to create functionality like logging in users, storing user preferences, and retrieving data like comments on a photo.</li>\n</ul>\n</li>\n<li><strong>Terms related to front-end languages:</strong>\n<ul>\n<li><em>HTML (Hypertext Markup Language): </em>A language used to place text, images, and other content on a webpage.</li>\n<li><em>HTML tag:</em> HTML instructions, usually appearing in pairs. Browsers apply special effects to text between an opening <code>&lt;element&amp;gt</code>; and closing <code>&lt;/element&amp;gt</code>; HTML tag. For instance, the <code>&lt;h1&amp;gt</code>; tag renders in a browser as a large bolded headline and can be used like this: <code>&lt;h1&gt;Dewey beats Truman&lt;/h1&gt;</code>.</li>\n<li><em>HTML attribute:</em> Attributes or parameters for HTML tags that modify the tag&#8217;s behavior. Attributes are always placed in the opening HTML tag. For example, <code>href</code> is the attribute in the following anchor tag (used to create hyperlinks):<br />\n<code>&lt;a href=\"http://www.google.com\"&gt;Search engine&lt;/a&gt;</code></li>\n<li><em>CSS (</em>Cascading Style Sheets): Code that modifies HTML on webpages and that controls the appearance of content by changing text size, image size, and other attributes.</li>\n<li><em>JavaScript:</em> Code that adds interactivity and animation to webpages. JavaScript also detects browser events such as mouse clicks, validates user input such as text entries, and retrieves data from external websites.</li>\n<li><em>Variable:</em> A storage location that&#8217;s given a name and that contains numerical data or text (referred to as <em>strings</em>) for later use.</li>\n<li><em>If statement (conditional):</em> A code instruction that tests a condition that usually includes variables, such as <code>x &lt; 18</code>, and executes code you write when the condition is true.</li>\n<li><em>Function:</em> A name given to a group of programming statements for easy reference and use.</li>\n</ul>\n</li>\n<li><strong>Terms related to back-end languages:</strong>\n<ul>\n<li><em>Ruby:</em> An open-source programming language best known for use in web programming.</li>\n<li><em>Rails:</em> A framework designed to make creating webpages with Ruby easy.</li>\n<li><em>Python:</em> An open-source programming language used on the web, in scientific applications, and for data analysis.</li>\n</ul>\n</li>\n</ul>\n"},{"title":"Coding references and resources","thumb":null,"image":null,"content":"<p>HTML, CSS, and JavaScript are the most common front-end coding languages. The following table lists some online resources, references, and tutorials to help you continue practicing all three languages.</p>\n<ul class=\"level-one\">\n<li>\n<p class=\"first-para\"><a href=\"http://www.w3schools.com\" target=\"_blank\" rel=\"noopener\">W3Schools</a>: Reference guides for HTML, CSS, and JavaScript</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"https://overapi.com/html\" target=\"_blank\" rel=\"noopener\">HTML cheat sheet</a>: Most commonly used HTML commands</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"https://overapi.com/css\" target=\"_blank\" rel=\"noopener\">CSS cheat sheet</a>: Most commonly used CSS commands</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://www.html5rocks.com/en/tutorials/\" target=\"_blank\" rel=\"noopener\">HTML tutorials</a>: Tutorials and articles for the web maintained by Google</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"http://css-tricks.com/\" target=\"_blank\" rel=\"noopener\">CSS tutorials</a>: Tutorials and articles for web programming, with a focus on CSS</p>\n</li>\n<li>\n<p class=\"first-para\"><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript\" target=\"_blank\" rel=\"noopener\">JavaScript tutorials</a>: Tutorials and reference guides for JavaScript</p>\n</li>\n</ul>\n"},{"title":"Common coding mistakes","thumb":null,"image":null,"content":"<p>Code not working? Here are some common mistakes that can trip up even the most experienced coder. If your code won’t run, try running down this checklist to see if you have any of these errors:</p>\n<ul class=\"level-one\">\n<li>\n<p class=\"first-para\">Not having a closing HTML tag <span class=\"code\">&lt;/element&gt;</span> after every opening HTML tag <span class=\"code\">&lt;element&gt;</span>.</p>\n</li>\n<li>\n<p class=\"first-para\">Missing brackets <span class=\"code\">&lt;</span> or <span class=\"code\">&gt;</span> in HTML.</p>\n</li>\n<li>\n<p class=\"first-para\">Missing curly braces, colons, or semicolons in CSS, as in the following:</p>\n<pre class=\"code\">h1 {\r\n color: blue;\r\n}</pre>\n</li>\n<li>\n<p class=\"first-para\">Missing curly braces in JavaScript, especially for <span class=\"code\">if</span> statements.</p>\n</li>\n<li>\n<p class=\"first-para\">Forgetting to have a pair of closing pair of quotes for every opening pair of quotes.</p>\n</li>\n<li>\n<p class=\"first-para\">Having more than one opening and closing <span class=\"code\">&lt;html&gt;</span> tag, <span class=\"code\">&lt;head&gt;</span> tag, or <span class=\"code\">&lt;body&gt;</span> tag.</p>\n</li>\n<li>\n<p class=\"first-para\">Putting HTML code in the CSS file or section, and putting CSS code in the HTML section. If the code deals with style and appearance, it’s likely CSS.</p>\n</li>\n<li>\n<p class=\"first-para\">Not linking to your CSS file using the <span class=\"code\">&lt;script&gt;</span> tag, and so your CSS effects don’t render in the browser.</p>\n</li>\n<li>\n<p class=\"first-para\">Misspelling a part of a command, as in <span class=\"code\">&lt;img scr=&#8221;logo.jpg&#8221;&gt;</span>, which is incorrect because the attribute is spelled <span class=\"code\">src</span> not <span class=\"code\">scr</span>.</p>\n</li>\n<li>\n<p class=\"first-para\">Including attributes outside the opening HTML tag. For example, <span class=\"code\">&lt;img&gt; src=&#8221;logo.jpg&#8221;</span> is incorrect because the attribute is outside the opening image tag.</p>\n</li>\n</ul>\n"}],"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":"Six months","lifeExpectancySetFrom":"2022-01-19T00:00:00+00:00","dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":207582},{"headers":{"creationTime":"2017-07-14T18:35:04+00:00","modifiedTime":"2020-07-01T17:43:41+00:00","timestamp":"2022-02-24T17:05:57+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"slug":"coding","categoryId":33599}],"title":"How to Send Data in Unstructured File Form","strippedTitle":"how to send data in unstructured file form","slug":"send-data-unstructured-file-form","canonicalUrl":"","seo":{"metaDescription":"","noIndex":0,"noFollow":0},"content":"Unstructured data files consist of a series of bits. The file doesn’t separate the bits from each other in any way. You can’t simply look into the file and see any structure because there isn’t any to see. Unstructured file formats rely on the file user to know how to interpret the data.\r\n\r\nFor example, each pixel of a picture file could consist of three 32-bit fields. Knowing that each field is 32-bits is up to you. A header at the beginning of the file may provide clues about interpreting the file, but even so, it’s up to you to know how to interact with the file.\r\n\r\nThis example shows how to work with a picture as an unstructured file. The example image is a public domain offering from <a href=\"https://commons.wikimedia.org/wiki/Main_Page\" target=\"_blank\" rel=\"noopener noreferrer\">commons.wikimedia.org</a>. To work with images, you need to access the <a href=\"https://scikit-image.org/\" target=\"_blank\" rel=\"noopener noreferrer\">scikit-image library</a>, which is a free-of-charge collection of algorithms used for image processing. Here’s a <a href=\"http://scipy-lectures.org/packages/scikit-image/\" target=\"_blank\" rel=\"noopener noreferrer\">tutorial for this library</a>.\r\n\r\nThe first task is to be able to display the image on-screen using the following code. (This code can require a little time to run. The image is ready when the busy indicator disappears from the IPython Notebook tab.)\r\n\r\n<code>from skimage.io import imread</code>\r\n\r\n<code>from skimage.transform import resize</code>\r\n\r\n<code>from matplotlib import pyplot as plt</code>\r\n\r\n<code>import matplotlib.cm as cm</code>\r\n\r\n \r\n\r\n<code>example_file = (\"http://upload.wikimedia.org/\" +</code>\r\n\r\n<code>\"wikipedia/commons/7/7d/Dog_face.png\")</code>\r\n\r\n<code>image = imread(example_file, as_grey=True)</code>\r\n\r\n<code>plt.imshow(image, cmap=cm.gray)</code>\r\n\r\n<code>plt.show()</code>\r\n\r\nThe code begins by importing a number of libraries. It then creates a string that points to the example file online and places it in <code>example_file</code>. This string is part of the <code>imread()</code> method call, along with <code>as_grey</code>, which is set to <code>True</code>. The <code>as_grey</code> argument tells Python to turn color images into grayscale. Any images that are already in grayscale remain that way.\r\n\r\nNow that you have an image loaded, it’s time to render it (make it ready to display on-screen. The <code>imshow()</code> function performs the rendering and uses a grayscale color map. The <code>show()</code> function actually displays <code>image</code> for you.\r\n\r\n[caption id=\"attachment_242157\" align=\"aligncenter\" width=\"535\"]<a href=\"https://www.dummies.com/wp-content/uploads/coding-all-in-one-unstructured-file-form.jpg\"><img class=\"wp-image-242157 size-full\" src=\"https://www.dummies.com/wp-content/uploads/coding-all-in-one-unstructured-file-form.jpg\" alt=\"unstructured file form\" width=\"535\" height=\"463\" /></a> The image appears on-screen after you render and show it.[/caption]\r\n\r\nClose the image when you’re finished viewing it. (The asterisk in the <code>In [*]:</code> entry tells you that the code is still running and you can’t move on to the next step.) The act of closing the image ends the code segment. You now have an image in memory, and you may want to find out more about it. When you run the following code, you discover the image type and size:\r\n\r\n<code>print(\"data type: %s, shape: %s\" %</code>\r\n\r\n<code>(type(image), image.shape))</code>\r\n\r\nThe output from this call tells you that the image type is a <code>numpy.ndarray</code> and that the image size is 90 pixels by 90 pixels. The image is actually an array of pixels that you can manipulate in various ways. For example, if you want to crop the image, you can use the following code to manipulate the image array:\r\n\r\n<code>image2 = image[5:70,0:70]</code>\r\n\r\n<code>plt.imshow(image2, cmap=cm.gray)</code>\r\n\r\n<code>plt.show()</code>\r\n\r\nThe<code> numpy.ndarray</code> in <code>image2</code> is smaller than the one in <code>image</code>, so the output is smaller as well. Typical results are shown below. The purpose of cropping the image is to make it a specific size. Both images must be the same size for you to analyze them. Cropping is one way to ensure that the images are the correct size for analysis.\r\n\r\n[caption id=\"attachment_242158\" align=\"aligncenter\" width=\"535\"]<a href=\"https://www.dummies.com/wp-content/uploads/coding-all-in-one-crop-image.jpg\"><img class=\"wp-image-242158 size-full\" src=\"https://www.dummies.com/wp-content/uploads/coding-all-in-one-crop-image.jpg\" alt=\"crop image\" width=\"535\" height=\"463\" /></a> Cropping the image makes it smaller.[/caption]\r\n\r\nAnother method that you can use to change the image size is to resize it. The following code resizes the image to a specific size for analysis:\r\n\r\n<code>image3 = resize(image2, (30, 30), mode='nearest')</code>\r\n\r\n<code>plt.imshow(image3, cmap=cm.gray)</code>\r\n\r\n<code>print(\"data type: %s, shape: %s\" %</code>\r\n\r\n<code>(type(image3), image3.shape))</code>\r\n\r\nThe output from the <code>print()</code> function tells you that the image is now 30 pixels by 30 pixels in size. You can compare it to any image with the same dimensions.\r\n\r\nAfter you have all the images in the right size, you need to flatten them. A data set row is always a single dimension, not two dimensions. The image is currently an array of 30 pixels by 30 pixels, so you can’t make it part of a data set. The following code flattens <code>image3</code> so that it becomes an array of 900 elements that is stored in <code>image_row</code>:\r\n\r\n<code>image_row = image3.flatten()</code>\r\n\r\n<code>print(\"data type: %s, shape: %s\" %</code>\r\n\r\n<code>(type(image_row), image_row.shape))</code>\r\n\r\nNotice that the type is still a <code>numpy.ndarray</code>. You can add this array to a data set and then use the data set for analysis purposes. The size is 900 elements, as anticipated.","description":"Unstructured data files consist of a series of bits. The file doesn’t separate the bits from each other in any way. You can’t simply look into the file and see any structure because there isn’t any to see. Unstructured file formats rely on the file user to know how to interpret the data.\r\n\r\nFor example, each pixel of a picture file could consist of three 32-bit fields. Knowing that each field is 32-bits is up to you. A header at the beginning of the file may provide clues about interpreting the file, but even so, it’s up to you to know how to interact with the file.\r\n\r\nThis example shows how to work with a picture as an unstructured file. The example image is a public domain offering from <a href=\"https://commons.wikimedia.org/wiki/Main_Page\" target=\"_blank\" rel=\"noopener noreferrer\">commons.wikimedia.org</a>. To work with images, you need to access the <a href=\"https://scikit-image.org/\" target=\"_blank\" rel=\"noopener noreferrer\">scikit-image library</a>, which is a free-of-charge collection of algorithms used for image processing. Here’s a <a href=\"http://scipy-lectures.org/packages/scikit-image/\" target=\"_blank\" rel=\"noopener noreferrer\">tutorial for this library</a>.\r\n\r\nThe first task is to be able to display the image on-screen using the following code. (This code can require a little time to run. The image is ready when the busy indicator disappears from the IPython Notebook tab.)\r\n\r\n<code>from skimage.io import imread</code>\r\n\r\n<code>from skimage.transform import resize</code>\r\n\r\n<code>from matplotlib import pyplot as plt</code>\r\n\r\n<code>import matplotlib.cm as cm</code>\r\n\r\n \r\n\r\n<code>example_file = (\"http://upload.wikimedia.org/\" +</code>\r\n\r\n<code>\"wikipedia/commons/7/7d/Dog_face.png\")</code>\r\n\r\n<code>image = imread(example_file, as_grey=True)</code>\r\n\r\n<code>plt.imshow(image, cmap=cm.gray)</code>\r\n\r\n<code>plt.show()</code>\r\n\r\nThe code begins by importing a number of libraries. It then creates a string that points to the example file online and places it in <code>example_file</code>. This string is part of the <code>imread()</code> method call, along with <code>as_grey</code>, which is set to <code>True</code>. The <code>as_grey</code> argument tells Python to turn color images into grayscale. Any images that are already in grayscale remain that way.\r\n\r\nNow that you have an image loaded, it’s time to render it (make it ready to display on-screen. The <code>imshow()</code> function performs the rendering and uses a grayscale color map. The <code>show()</code> function actually displays <code>image</code> for you.\r\n\r\n[caption id=\"attachment_242157\" align=\"aligncenter\" width=\"535\"]<a href=\"https://www.dummies.com/wp-content/uploads/coding-all-in-one-unstructured-file-form.jpg\"><img class=\"wp-image-242157 size-full\" src=\"https://www.dummies.com/wp-content/uploads/coding-all-in-one-unstructured-file-form.jpg\" alt=\"unstructured file form\" width=\"535\" height=\"463\" /></a> The image appears on-screen after you render and show it.[/caption]\r\n\r\nClose the image when you’re finished viewing it. (The asterisk in the <code>In [*]:</code> entry tells you that the code is still running and you can’t move on to the next step.) The act of closing the image ends the code segment. You now have an image in memory, and you may want to find out more about it. When you run the following code, you discover the image type and size:\r\n\r\n<code>print(\"data type: %s, shape: %s\" %</code>\r\n\r\n<code>(type(image), image.shape))</code>\r\n\r\nThe output from this call tells you that the image type is a <code>numpy.ndarray</code> and that the image size is 90 pixels by 90 pixels. The image is actually an array of pixels that you can manipulate in various ways. For example, if you want to crop the image, you can use the following code to manipulate the image array:\r\n\r\n<code>image2 = image[5:70,0:70]</code>\r\n\r\n<code>plt.imshow(image2, cmap=cm.gray)</code>\r\n\r\n<code>plt.show()</code>\r\n\r\nThe<code> numpy.ndarray</code> in <code>image2</code> is smaller than the one in <code>image</code>, so the output is smaller as well. Typical results are shown below. The purpose of cropping the image is to make it a specific size. Both images must be the same size for you to analyze them. Cropping is one way to ensure that the images are the correct size for analysis.\r\n\r\n[caption id=\"attachment_242158\" align=\"aligncenter\" width=\"535\"]<a href=\"https://www.dummies.com/wp-content/uploads/coding-all-in-one-crop-image.jpg\"><img class=\"wp-image-242158 size-full\" src=\"https://www.dummies.com/wp-content/uploads/coding-all-in-one-crop-image.jpg\" alt=\"crop image\" width=\"535\" height=\"463\" /></a> Cropping the image makes it smaller.[/caption]\r\n\r\nAnother method that you can use to change the image size is to resize it. The following code resizes the image to a specific size for analysis:\r\n\r\n<code>image3 = resize(image2, (30, 30), mode='nearest')</code>\r\n\r\n<code>plt.imshow(image3, cmap=cm.gray)</code>\r\n\r\n<code>print(\"data type: %s, shape: %s\" %</code>\r\n\r\n<code>(type(image3), image3.shape))</code>\r\n\r\nThe output from the <code>print()</code> function tells you that the image is now 30 pixels by 30 pixels in size. You can compare it to any image with the same dimensions.\r\n\r\nAfter you have all the images in the right size, you need to flatten them. A data set row is always a single dimension, not two dimensions. The image is currently an array of 30 pixels by 30 pixels, so you can’t make it part of a data set. The following code flattens <code>image3</code> so that it becomes an array of 900 elements that is stored in <code>image_row</code>:\r\n\r\n<code>image_row = image3.flatten()</code>\r\n\r\n<code>print(\"data type: %s, shape: %s\" %</code>\r\n\r\n<code>(type(image_row), image_row.shape))</code>\r\n\r\nNotice that the type is still a <code>numpy.ndarray</code>. You can add this array to a data set and then use the data set for analysis purposes. The size is 900 elements, as anticipated.","blurb":"","authors":[{"authorId":9097,"name":"Nikhil Abraham","slug":"nikhil-abraham","description":"Nikhil Abraham is the CFO of Udacity, an education company that teaches technology skills that help launch or advance a career. Prior to joining Udacity, Abraham worked at Codecademy, where he taught beginning coders across a variety of professions. He is also author of Coding For Dummies and Getting a Coding Job For Dummies. ","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9097"}}],"primaryCategoryTaxonomy":{"categoryId":33599,"title":"Coding","slug":"coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":242447,"title":"The People Who Bring a Web App to Life","slug":"people-bring-web-app-life","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/242447"}},{"articleId":242444,"title":"Research Sources for Coding Your Own App","slug":"research-sources-coding-app","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/242444"}},{"articleId":242436,"title":"Getting Ready to Code? Do These Things First","slug":"getting-ready-code-things-first","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/242436"}},{"articleId":242408,"title":"Dealing with Dates in Your Data","slug":"dealing-dates-data","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/242408"}},{"articleId":242404,"title":"The Limits of Rating Data in Machine Learning","slug":"limits-rating-data-machine-learning","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/242404"}}],"fromCategory":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281666,"slug":"coding-all-in-one-for-dummies","isbn":"9781119363026","categoryList":["technology","programming-web-design","coding"],"amazon":{"default":"https://www.amazon.com/gp/product/1119363020/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119363020/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119363020-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119363020/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119363020/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/coding-all-in-one-for-dummies-cover-9781119363026-203x255.jpg","width":203,"height":255},"title":"Coding All-in-One For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"\n <p><b data-author-id=\"9097\">Nikhil Abraham</b> is the CFO of Udacity, an education company that teaches technology skills that help launch or advance a career. Prior to joining Udacity, Nik worked at Codecademy where he taught beginning coders across a variety of professions. He is also author of <i>Coding For Dummies</i> and <i>Getting a Coding Job For Dummies.</i> </p>","authors":[{"authorId":9097,"name":"Nikhil Abraham","slug":"nikhil-abraham","description":"Nikhil Abraham is the CFO of Udacity, an education company that teaches technology skills that help launch or advance a career. Prior to joining Udacity, Abraham worked at Codecademy, where he taught beginning coders across a variety of professions. He is also author of Coding For Dummies and Getting a Coding Job For Dummies. ","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9097"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119363026&quot;]}]\" id=\"du-slot-6217baf5b74d0\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119363026&quot;]}]\" id=\"du-slot-6217baf5b7e9b\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Advance","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":242156},{"headers":{"creationTime":"2018-06-29T19:38:49+00:00","modifiedTime":"2018-06-29T19:38:49+00:00","timestamp":"2022-02-24T17:04:33+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"slug":"coding","categoryId":33599}],"title":"Helping Kids with Coding: Distributing Mobile Apps","strippedTitle":"helping kids with coding: distributing mobile apps","slug":"helping-kids-coding-distributing-mobile-apps","canonicalUrl":"","seo":{"metaDescription":"","noIndex":0,"noFollow":0},"content":"After you and your young coder finish making your app, you can share it with anyone who has an Android device. Just go to your list of Projects (Projects  →   My Projects), check the box next to the app you want to publish, and click Publish to Gallery.\r\n\r\n[caption id=\"attachment_253847\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253847 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-publish-app.jpg\" alt=\"publish apps kid coding\" width=\"535\" height=\"293\" /> The view from the Projects list to publish your app to the Gallery.[/caption]\r\n\r\nFill out the form by uploading an image and providing a description. This is where you can put any attributions of media that you might have used in your app. Click the Publish button when you’re ready.\r\n\r\n[caption id=\"attachment_253848\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253848 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-publish-kids-apps.jpg\" alt=\"publish kids apps\" width=\"535\" height=\"418\" /> The form to fill out when you want to publish your app.[/caption]\r\n\r\nThe screen you’re taken to, after you publish your app, has a share link, which you can share with your friends who might want to check out your code. They can then click Open The App and remix it to try it on their own!\r\n\r\nTo share your app with friends who just want to play your game, you have two options.\r\n<ul>\r\n \t<li><strong>Generate a temp QR code.</strong> This code allows your friends to download your app. Open your app and choose Build →   App (provide QR code for .apk). In the pop-up window is the QR code, which you can share with your friends. Using any QR code scanner, they can scan the QR code, open the link that is associated with the QR code, and a download starts. After the download is complete, they can open the app and play your game! The game is available until they delete it, even though the QR code expires in two hours.</li>\r\n \t<li><strong>Download your app files and distribute them to your friends.</strong> You can do this by choosing Build →   App (save .apk to my computer). Then you can upload the file to Google Drive (or any other accessible server), make sure it’s accessible for anyone to view the file, and then distribute the link to the file. When your friends open the link on their Android device, the app starts downloading.</li>\r\n</ul>","description":"After you and your young coder finish making your app, you can share it with anyone who has an Android device. Just go to your list of Projects (Projects  →   My Projects), check the box next to the app you want to publish, and click Publish to Gallery.\r\n\r\n[caption id=\"attachment_253847\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253847 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-publish-app.jpg\" alt=\"publish apps kid coding\" width=\"535\" height=\"293\" /> The view from the Projects list to publish your app to the Gallery.[/caption]\r\n\r\nFill out the form by uploading an image and providing a description. This is where you can put any attributions of media that you might have used in your app. Click the Publish button when you’re ready.\r\n\r\n[caption id=\"attachment_253848\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253848 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-publish-kids-apps.jpg\" alt=\"publish kids apps\" width=\"535\" height=\"418\" /> The form to fill out when you want to publish your app.[/caption]\r\n\r\nThe screen you’re taken to, after you publish your app, has a share link, which you can share with your friends who might want to check out your code. They can then click Open The App and remix it to try it on their own!\r\n\r\nTo share your app with friends who just want to play your game, you have two options.\r\n<ul>\r\n \t<li><strong>Generate a temp QR code.</strong> This code allows your friends to download your app. Open your app and choose Build →   App (provide QR code for .apk). In the pop-up window is the QR code, which you can share with your friends. Using any QR code scanner, they can scan the QR code, open the link that is associated with the QR code, and a download starts. After the download is complete, they can open the app and play your game! The game is available until they delete it, even though the QR code expires in two hours.</li>\r\n \t<li><strong>Download your app files and distribute them to your friends.</strong> You can do this by choosing Build →   App (save .apk to my computer). Then you can upload the file to Google Drive (or any other accessible server), make sure it’s accessible for anyone to view the file, and then distribute the link to the file. When your friends open the link on their Android device, the app starts downloading.</li>\r\n</ul>","blurb":"","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}},{"authorId":9091,"name":"Sarah Guthals","slug":"sarah-guthals","description":"Sarah Guthals, PhD, is a social software engineer, entrepreneur, and former engineering manager at GitHub. She is coauthor of Helping Kids with Coding For Dummies.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9091"}}],"primaryCategoryTaxonomy":{"categoryId":33599,"title":"Coding","slug":"coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[],"relatedArticles":{"fromBook":[{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}},{"articleId":253815,"title":"Teaching Kids Coding: Searching Lists","slug":"teaching-kids-coding-searching-lists","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253815"}}],"fromCategory":[{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}},{"articleId":253815,"title":"Teaching Kids Coding: Searching Lists","slug":"teaching-kids-coding-searching-lists","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253815"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281734,"slug":"helping-kids-with-coding-for-dummies","isbn":"9781119380672","categoryList":["technology","programming-web-design","coding"],"amazon":{"default":"https://www.amazon.com/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119380677-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-for-dummies-cover-9781119380672-203x255.jpg","width":203,"height":255},"title":"Helping Kids with Coding For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"\n <p><b data-author-id=\"9324\">Camille McCue, PhD,</b> is Director of Curriculum Innovations at the Adelson Educational Campus in Las Vegas where she leads the Startup Incubator, teaches STEM, and kickstarts K-12 learning initiatives. <b data-author-id=\"9091\">Sarah Guthals, PhD,</b> co-founded an ed-tech company and now continues to build technology for kids to learn, create, and share safely online. She loves to teach teachers how to teach coding in the classroom. </p>","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}},{"authorId":9091,"name":"Sarah Guthals","slug":"sarah-guthals","description":"Sarah Guthals, PhD, is a social software engineer, entrepreneur, and former engineering manager at GitHub. She is coauthor of Helping Kids with Coding For Dummies.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9091"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119380672&quot;]}]\" id=\"du-slot-6217baa1cc41b\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119380672&quot;]}]\" id=\"du-slot-6217baa1ccdb6\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Explore","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":253846},{"headers":{"creationTime":"2018-06-29T19:26:34+00:00","modifiedTime":"2018-06-29T19:26:34+00:00","timestamp":"2022-02-24T17:04:33+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"slug":"coding","categoryId":33599}],"title":"Using the MIT App Inventor to Teach Kids Coding","strippedTitle":"using the mit app inventor to teach kids coding","slug":"using-mit-app-inventor-teach-kids-coding","canonicalUrl":"","seo":{"metaDescription":"","noIndex":0,"noFollow":0},"content":"If your young coder wants to try apps, give the MIT App Inventor a try. To get started with MIT App Inventor, you need a Google account. Then follow these steps to set up your programming environment:\r\n<ol>\r\n \t<li>Go to <a href=\"http://appinventor.mit.edu\">MIT App Inventor</a> and click Create Apps in the top-right corner of the webpage.</li>\r\n \t<li>Sign in with your Google account.</li>\r\n \t<li>Give permission for Google to share your email address with App Inventor.\r\n\r\n[caption id=\"attachment_253841\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253841 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-mit-app-inventor.jpg\" alt=\"MIT App Inventor\" width=\"535\" height=\"332\" /> Allow Google to share your email address with MIT App Inventor.[/caption]</li>\r\n \t<li>Accept the Terms and Services for App Inventor and click Continue when you’re ready.</li>\r\n \t<li>Dismiss the survey and other items that pop up so that you can get started!\r\n\r\nYou now see a view where all your projects are listed.\r\n\r\n[caption id=\"attachment_253842\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253842 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-mit-app-inventor-projects.jpg\" alt=\"MIT App Inventor projects\" width=\"535\" height=\"368\" /> The view of all your projects in App Inventor after you log in.[/caption]</li>\r\n</ol>\r\nYou’re now ready to start designing and writing your first mobile app!\r\n<h2 id=\"tab1\" >Community and support within MIT App Inventor</h2>\r\nApp Inventor was first released in 2010, and the community of coders and educators has grown. Make sure you’re signed in and then click Gallery. The image below shows the gallery where you find projects and tutorials that other coders have made and published. You and your coder can contribute to these too!\r\n\r\n[caption id=\"attachment_253840\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253840 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-app-inventor-gallery.jpg\" alt=\"App Inventor gallery\" width=\"535\" height=\"368\" /> The view of the App Inventor gallery.[/caption]\r\n\r\nIn addition to the community gallery, MIT has created a number of resources for individuals and classrooms. For example, you’ll find over <a href=\"http://appinventor.mit.edu/explore/ai2/tutorials.html\">30 tutorials</a> divided by difficulty level and an option to filter by topic (such as game).\r\n\r\nThere are also a ton of resources about using App Inventor, setting everything up, troubleshooting, and documentation. All this can be found in the <a href=\"http://appinventor.mit.edu/explore/library\">MIT App Inventor library</a>. Although this page is a bit less user-friendly — basically a list of links — it can be a great place to start if you have a question or experience any trouble.\r\n\r\nThe community isn’t just created by MIT; there are also a number of books that you can find on App Inventor and forums where you can ask questions and get very specific answers on the <a href=\"http://appinventor.mit.edu/explore/library\">App Inventor website</a> under Resources. There are also <a href=\"http://teach.appinventor.mit.edu/\">specific resources for educators</a>. Be sure to explore all the resources when getting your young coder acquainted with the software.\r\n<h2 id=\"tab2\" >The layout of MIT App Inventor</h2>\r\nBefore you get started on your first mobile game, take the time to get acquainted with the programming environment. There are two areas your coder will spend time in: Design View and Code View.\r\n\r\nTo get to Design View, click Start New Project in the top left of the programming environment. Name your project “myFirstApp.” The Design View opens.\r\n\r\n[caption id=\"attachment_253839\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253839 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-design-view-mit-app-inventor.jpg\" alt=\"MIT APp Inventor design view\" width=\"535\" height=\"413\" /> The Design View of the App Inventor programming environment.[/caption]\r\n\r\nNote these six areas:\r\n<ul>\r\n \t<li><strong>Menu Bar:</strong> The menu bar across the top has the title of your app, options for multiple screens, and a toggle button for Designer and Blocks.</li>\r\n \t<li><strong>Palette:</strong> On the left is a list of options for things to add to your app.</li>\r\n \t<li><strong>Viewer:</strong> The viewer is basically what you see on your mobile device after you test your app. This is where you organize all the components to add to your app.</li>\r\n \t<li><strong>Components:</strong> The components list shows all the elements in your app. Sometimes components are invisible, so this is an important view to know everything in your screen.</li>\r\n \t<li><strong>Media:</strong> Under the Components view is a Media view where any sounds or images that you have uploaded to your app appear.</li>\r\n \t<li><strong>Properties:</strong> If you click a component in the Components view, then the properties for that component is listed in this view. You can also change properties in this view, too.</li>\r\n</ul>\r\nThen, to see the Code View, click the Blocks button on the very right of the Menu Bar.\r\n<ul>\r\n \t<li><strong>Menu Bar:</strong> Just like in the Design View, the menu bar allows you to switch screens or go back to the Design View.</li>\r\n \t<li><strong>Blocks:</strong> This view has all the coding blocks (also referred to as tiles). There are generic blocks, but if you have a component in your design, there also are blocks specifically for that component.</li>\r\n \t<li><strong>Media:</strong> This view has all the sounds and images that you have uploaded to your app.</li>\r\n \t<li><strong>Coding Area:</strong> The coding area is where you drag the coding blocks to actually make your app respond to your users.</li>\r\n</ul>\r\n[caption id=\"attachment_253838\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253838 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-mit-app-inventor-code-view.jpg\" alt=\"MIT App Inventor code view\" width=\"535\" height=\"299\" /> The Code View of the App Inventor programming environment.[/caption]","description":"If your young coder wants to try apps, give the MIT App Inventor a try. To get started with MIT App Inventor, you need a Google account. Then follow these steps to set up your programming environment:\r\n<ol>\r\n \t<li>Go to <a href=\"http://appinventor.mit.edu\">MIT App Inventor</a> and click Create Apps in the top-right corner of the webpage.</li>\r\n \t<li>Sign in with your Google account.</li>\r\n \t<li>Give permission for Google to share your email address with App Inventor.\r\n\r\n[caption id=\"attachment_253841\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253841 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-mit-app-inventor.jpg\" alt=\"MIT App Inventor\" width=\"535\" height=\"332\" /> Allow Google to share your email address with MIT App Inventor.[/caption]</li>\r\n \t<li>Accept the Terms and Services for App Inventor and click Continue when you’re ready.</li>\r\n \t<li>Dismiss the survey and other items that pop up so that you can get started!\r\n\r\nYou now see a view where all your projects are listed.\r\n\r\n[caption id=\"attachment_253842\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253842 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-mit-app-inventor-projects.jpg\" alt=\"MIT App Inventor projects\" width=\"535\" height=\"368\" /> The view of all your projects in App Inventor after you log in.[/caption]</li>\r\n</ol>\r\nYou’re now ready to start designing and writing your first mobile app!\r\n<h2 id=\"tab1\" >Community and support within MIT App Inventor</h2>\r\nApp Inventor was first released in 2010, and the community of coders and educators has grown. Make sure you’re signed in and then click Gallery. The image below shows the gallery where you find projects and tutorials that other coders have made and published. You and your coder can contribute to these too!\r\n\r\n[caption id=\"attachment_253840\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253840 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-app-inventor-gallery.jpg\" alt=\"App Inventor gallery\" width=\"535\" height=\"368\" /> The view of the App Inventor gallery.[/caption]\r\n\r\nIn addition to the community gallery, MIT has created a number of resources for individuals and classrooms. For example, you’ll find over <a href=\"http://appinventor.mit.edu/explore/ai2/tutorials.html\">30 tutorials</a> divided by difficulty level and an option to filter by topic (such as game).\r\n\r\nThere are also a ton of resources about using App Inventor, setting everything up, troubleshooting, and documentation. All this can be found in the <a href=\"http://appinventor.mit.edu/explore/library\">MIT App Inventor library</a>. Although this page is a bit less user-friendly — basically a list of links — it can be a great place to start if you have a question or experience any trouble.\r\n\r\nThe community isn’t just created by MIT; there are also a number of books that you can find on App Inventor and forums where you can ask questions and get very specific answers on the <a href=\"http://appinventor.mit.edu/explore/library\">App Inventor website</a> under Resources. There are also <a href=\"http://teach.appinventor.mit.edu/\">specific resources for educators</a>. Be sure to explore all the resources when getting your young coder acquainted with the software.\r\n<h2 id=\"tab2\" >The layout of MIT App Inventor</h2>\r\nBefore you get started on your first mobile game, take the time to get acquainted with the programming environment. There are two areas your coder will spend time in: Design View and Code View.\r\n\r\nTo get to Design View, click Start New Project in the top left of the programming environment. Name your project “myFirstApp.” The Design View opens.\r\n\r\n[caption id=\"attachment_253839\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253839 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-design-view-mit-app-inventor.jpg\" alt=\"MIT APp Inventor design view\" width=\"535\" height=\"413\" /> The Design View of the App Inventor programming environment.[/caption]\r\n\r\nNote these six areas:\r\n<ul>\r\n \t<li><strong>Menu Bar:</strong> The menu bar across the top has the title of your app, options for multiple screens, and a toggle button for Designer and Blocks.</li>\r\n \t<li><strong>Palette:</strong> On the left is a list of options for things to add to your app.</li>\r\n \t<li><strong>Viewer:</strong> The viewer is basically what you see on your mobile device after you test your app. This is where you organize all the components to add to your app.</li>\r\n \t<li><strong>Components:</strong> The components list shows all the elements in your app. Sometimes components are invisible, so this is an important view to know everything in your screen.</li>\r\n \t<li><strong>Media:</strong> Under the Components view is a Media view where any sounds or images that you have uploaded to your app appear.</li>\r\n \t<li><strong>Properties:</strong> If you click a component in the Components view, then the properties for that component is listed in this view. You can also change properties in this view, too.</li>\r\n</ul>\r\nThen, to see the Code View, click the Blocks button on the very right of the Menu Bar.\r\n<ul>\r\n \t<li><strong>Menu Bar:</strong> Just like in the Design View, the menu bar allows you to switch screens or go back to the Design View.</li>\r\n \t<li><strong>Blocks:</strong> This view has all the coding blocks (also referred to as tiles). There are generic blocks, but if you have a component in your design, there also are blocks specifically for that component.</li>\r\n \t<li><strong>Media:</strong> This view has all the sounds and images that you have uploaded to your app.</li>\r\n \t<li><strong>Coding Area:</strong> The coding area is where you drag the coding blocks to actually make your app respond to your users.</li>\r\n</ul>\r\n[caption id=\"attachment_253838\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253838 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-mit-app-inventor-code-view.jpg\" alt=\"MIT App Inventor code view\" width=\"535\" height=\"299\" /> The Code View of the App Inventor programming environment.[/caption]","blurb":"","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}},{"authorId":9091,"name":"Sarah Guthals","slug":"sarah-guthals","description":"Sarah Guthals, PhD, is a social software engineer, entrepreneur, and former engineering manager at GitHub. She is coauthor of Helping Kids with Coding For Dummies.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9091"}}],"primaryCategoryTaxonomy":{"categoryId":33599,"title":"Coding","slug":"coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[{"label":"Community and support within MIT App Inventor","target":"#tab1"},{"label":"The layout of MIT App Inventor","target":"#tab2"}],"relatedArticles":{"fromBook":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}},{"articleId":253815,"title":"Teaching Kids Coding: Searching Lists","slug":"teaching-kids-coding-searching-lists","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253815"}}],"fromCategory":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}},{"articleId":253815,"title":"Teaching Kids Coding: Searching Lists","slug":"teaching-kids-coding-searching-lists","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253815"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281734,"slug":"helping-kids-with-coding-for-dummies","isbn":"9781119380672","categoryList":["technology","programming-web-design","coding"],"amazon":{"default":"https://www.amazon.com/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119380677-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-for-dummies-cover-9781119380672-203x255.jpg","width":203,"height":255},"title":"Helping Kids with Coding For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"\n <p><b data-author-id=\"9324\">Camille McCue, PhD,</b> is Director of Curriculum Innovations at the Adelson Educational Campus in Las Vegas where she leads the Startup Incubator, teaches STEM, and kickstarts K-12 learning initiatives. <b data-author-id=\"9091\">Sarah Guthals, PhD,</b> co-founded an ed-tech company and now continues to build technology for kids to learn, create, and share safely online. She loves to teach teachers how to teach coding in the classroom. </p>","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}},{"authorId":9091,"name":"Sarah Guthals","slug":"sarah-guthals","description":"Sarah Guthals, PhD, is a social software engineer, entrepreneur, and former engineering manager at GitHub. She is coauthor of Helping Kids with Coding For Dummies.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9091"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119380672&quot;]}]\" id=\"du-slot-6217baa1c3bfd\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119380672&quot;]}]\" id=\"du-slot-6217baa1c45c4\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Explore","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":253837},{"headers":{"creationTime":"2018-06-29T19:13:36+00:00","modifiedTime":"2018-06-29T19:13:36+00:00","timestamp":"2022-02-24T17:04:33+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"slug":"coding","categoryId":33599}],"title":"Teaching Kids Strategies for Debugging Code","strippedTitle":"teaching kids strategies for debugging code","slug":"teaching-kids-strategies-debugging-code","canonicalUrl":"","seo":{"metaDescription":"","noIndex":0,"noFollow":0},"content":"When you and your young coder are trying to debug, sometimes no error messages give you insight into the problem. Here, you find a list of strategies for debugging programs where you don’t get an error message, or the error message doesn’t give you enough information.\r\n<h2 id=\"tab1\" >Turning sections on and off</h2>\r\nOne of the best ways to debug is to disable sections of code so that you have small sections to test.\r\n<h3>Using Scratch</h3>\r\nIn Scratch, you might have a lot of scripts that start when the green flag is pressed. This can cause problems if some of the scripts cancel out or affect the other scripts. For example, the image below shows three scripts associated with one sprite.\r\n\r\n[caption id=\"attachment_253832\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253832 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-debug.jpg\" alt=\"debugging code\" width=\"535\" height=\"306\" /> An example Scratch program.[/caption]\r\n\r\nThe problem that the user notices is when the mouse pointer is touching the sprite, it does not meow. To try to figure out the problem, the coder might disconnect all the scripts and only have one script connected at a time. Then they see that the code for the mouse pointer touching the sprite works correctly, but that there is another problem (the code that stops all sounds forever). By connecting and disconnecting the blocks, the coder can identify the problem.\r\n\r\n[caption id=\"attachment_253833\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253833 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-identify-bugs.jpg\" alt=\"identify coding bugs\" width=\"535\" height=\"346\" /> An example of turning off sections in Scratch to identify a bug.[/caption]\r\n<h3>Using App Inventor</h3>\r\nOther block-based languages like App Inventor make turning sections on and off even easier! The image below shows how if you right-click a code block, you can disable that block. In this example, you might want to make sure the initial property settings work before creating the lists and hiding the items. Then, after you confirm the properties are set properly, you can enable the call to <code>setupLists</code> to make sure that works. Then you can enable the call to <code>hideItems</code> to make sure that works.\r\n<p class=\"article-tips remember\">By turning off all sections and then turning each one on one at a time, it’s easier to find bugs.</p>\r\n\r\n<h3>Using Python</h3>\r\nText-based languages have a similar way of turning sections on and off — you only have to comment out the lines of code. In Python, you can comment out a single line of code like this:\r\n<pre class=\"code\">#print 'Hi'</pre>\r\nAnd you can comment out multiple lines of code like this:\r\n<pre class=\"code\">\"'\r\nfor x in range(0, 4):\r\n print ('Hi ' + pets[x])\r\n\"'</pre>\r\nCommenting out code is how you “turn off” or “disable” parts of your code when you’re in a text-based language.\r\n<h2 id=\"tab2\" >Testing sample data</h2>\r\nA common bug that coders run into is not testing data to make sure that the program works. This can especially be a problem if you’re writing programs that take user input. It’s important to make sure you and your young coder think about what kind of input you’re expecting, and test to make sure the input is handled correctly.\r\n\r\nYou might have a program that gets input from the user and prints what the user types, like this Python code:\r\n<pre class=\"code\">name = raw_input('What is your name? ‘)\r\nprint (‘Hi ' + name)</pre>\r\nIt’s important to test to make sure that if you put the following types of input, they still do what you, as the coder, expect:\r\n<pre class=\"code\">Sarah\r\nSarah Guthals\r\n13\r\n11/15\r\nSarah 55 Guthals</pre>\r\nBy mixing letters, spaces, numbers, and other symbols like / you’re ensuring that your program performs as expected. This type of testing is <em>unit testing</em> and ensures that small portions of your program execute correctly with varying input.\r\n<h2 id=\"tab3\" >Adding output messages</h2>\r\nOne of the most challenging aspects of coding is that the code is abstract and sometimes the data is hidden. This is especially tricky when you have complex data or are performing complex operations on data. By adding a number of output messages in your code, you can indicate when certain sections of code have been reached, or you can show the current values of certain variables at various points during execution.\r\n\r\nAn example of adding output messages to a program to gain insight in Python follows. Here, your goal is to write a program to solve an algebraic expression. For example:\r\n<pre class=\"code\">x = input('Provide a number for x: ')\r\ny = input('Provide a number for y: ')\r\nfirst = 2*x\r\nsecond = 6*y\r\nsum = first - second\r\n \r\nprint '2x + 6y = '\r\nprint (sum)</pre>\r\nThere is an error in this program; instead of adding the first and second elements, the coder is accidentally subtracting. Though this error is fairly obvious because this example is small, it shows how a simple typo could completely change the output. If you run this code, you get results like:\r\n<pre class=\"code\">Provide a number for x: <strong>2</strong>\r\nProvide a number for y: <strong>3</strong>\r\n2x + 6y =\r\n-14</pre>\r\nThis is clearly wrong. 2*2 + 6*3 = 4 + 18 = 22, not -14. One way of debugging this code is to add output messages at each point. For example, you could change your code to:\r\n<pre class=\"code\">x = input('Provide a number for x: ')\r\nprint ('x: ')\r\nprint (x)\r\n\r\ny = input('Provide a number for y: ')\r\nprint ('y: ')\r\nprint (y)\r\n\r\nfirst = 2*x\r\nprint ('first: ')\r\nprint (first)\r\n\r\nsecond = 6*y\r\nprint ('second: ')\r\nprint (second)\r\n\r\nsum = first - second\r\n\r\nprint \"2x + 6y = \"\r\nprint sum</pre>\r\nThen, when you run the code you get the following output:\r\n<pre class=\"code\">Provide a number for x: 2\r\nx:\r\n2\r\nProvide a number for y: 3\r\ny:\r\n3\r\nfirst:\r\n4\r\nsecond:\r\n18\r\n2x + 6y =\r\n-14</pre>\r\nThen the coder can see that x, y, first, and second are all correct. This must mean that it’s just when the sum is calculated that there is an error.","description":"When you and your young coder are trying to debug, sometimes no error messages give you insight into the problem. Here, you find a list of strategies for debugging programs where you don’t get an error message, or the error message doesn’t give you enough information.\r\n<h2 id=\"tab1\" >Turning sections on and off</h2>\r\nOne of the best ways to debug is to disable sections of code so that you have small sections to test.\r\n<h3>Using Scratch</h3>\r\nIn Scratch, you might have a lot of scripts that start when the green flag is pressed. This can cause problems if some of the scripts cancel out or affect the other scripts. For example, the image below shows three scripts associated with one sprite.\r\n\r\n[caption id=\"attachment_253832\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253832 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-debug.jpg\" alt=\"debugging code\" width=\"535\" height=\"306\" /> An example Scratch program.[/caption]\r\n\r\nThe problem that the user notices is when the mouse pointer is touching the sprite, it does not meow. To try to figure out the problem, the coder might disconnect all the scripts and only have one script connected at a time. Then they see that the code for the mouse pointer touching the sprite works correctly, but that there is another problem (the code that stops all sounds forever). By connecting and disconnecting the blocks, the coder can identify the problem.\r\n\r\n[caption id=\"attachment_253833\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253833 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-identify-bugs.jpg\" alt=\"identify coding bugs\" width=\"535\" height=\"346\" /> An example of turning off sections in Scratch to identify a bug.[/caption]\r\n<h3>Using App Inventor</h3>\r\nOther block-based languages like App Inventor make turning sections on and off even easier! The image below shows how if you right-click a code block, you can disable that block. In this example, you might want to make sure the initial property settings work before creating the lists and hiding the items. Then, after you confirm the properties are set properly, you can enable the call to <code>setupLists</code> to make sure that works. Then you can enable the call to <code>hideItems</code> to make sure that works.\r\n<p class=\"article-tips remember\">By turning off all sections and then turning each one on one at a time, it’s easier to find bugs.</p>\r\n\r\n<h3>Using Python</h3>\r\nText-based languages have a similar way of turning sections on and off — you only have to comment out the lines of code. In Python, you can comment out a single line of code like this:\r\n<pre class=\"code\">#print 'Hi'</pre>\r\nAnd you can comment out multiple lines of code like this:\r\n<pre class=\"code\">\"'\r\nfor x in range(0, 4):\r\n print ('Hi ' + pets[x])\r\n\"'</pre>\r\nCommenting out code is how you “turn off” or “disable” parts of your code when you’re in a text-based language.\r\n<h2 id=\"tab2\" >Testing sample data</h2>\r\nA common bug that coders run into is not testing data to make sure that the program works. This can especially be a problem if you’re writing programs that take user input. It’s important to make sure you and your young coder think about what kind of input you’re expecting, and test to make sure the input is handled correctly.\r\n\r\nYou might have a program that gets input from the user and prints what the user types, like this Python code:\r\n<pre class=\"code\">name = raw_input('What is your name? ‘)\r\nprint (‘Hi ' + name)</pre>\r\nIt’s important to test to make sure that if you put the following types of input, they still do what you, as the coder, expect:\r\n<pre class=\"code\">Sarah\r\nSarah Guthals\r\n13\r\n11/15\r\nSarah 55 Guthals</pre>\r\nBy mixing letters, spaces, numbers, and other symbols like / you’re ensuring that your program performs as expected. This type of testing is <em>unit testing</em> and ensures that small portions of your program execute correctly with varying input.\r\n<h2 id=\"tab3\" >Adding output messages</h2>\r\nOne of the most challenging aspects of coding is that the code is abstract and sometimes the data is hidden. This is especially tricky when you have complex data or are performing complex operations on data. By adding a number of output messages in your code, you can indicate when certain sections of code have been reached, or you can show the current values of certain variables at various points during execution.\r\n\r\nAn example of adding output messages to a program to gain insight in Python follows. Here, your goal is to write a program to solve an algebraic expression. For example:\r\n<pre class=\"code\">x = input('Provide a number for x: ')\r\ny = input('Provide a number for y: ')\r\nfirst = 2*x\r\nsecond = 6*y\r\nsum = first - second\r\n \r\nprint '2x + 6y = '\r\nprint (sum)</pre>\r\nThere is an error in this program; instead of adding the first and second elements, the coder is accidentally subtracting. Though this error is fairly obvious because this example is small, it shows how a simple typo could completely change the output. If you run this code, you get results like:\r\n<pre class=\"code\">Provide a number for x: <strong>2</strong>\r\nProvide a number for y: <strong>3</strong>\r\n2x + 6y =\r\n-14</pre>\r\nThis is clearly wrong. 2*2 + 6*3 = 4 + 18 = 22, not -14. One way of debugging this code is to add output messages at each point. For example, you could change your code to:\r\n<pre class=\"code\">x = input('Provide a number for x: ')\r\nprint ('x: ')\r\nprint (x)\r\n\r\ny = input('Provide a number for y: ')\r\nprint ('y: ')\r\nprint (y)\r\n\r\nfirst = 2*x\r\nprint ('first: ')\r\nprint (first)\r\n\r\nsecond = 6*y\r\nprint ('second: ')\r\nprint (second)\r\n\r\nsum = first - second\r\n\r\nprint \"2x + 6y = \"\r\nprint sum</pre>\r\nThen, when you run the code you get the following output:\r\n<pre class=\"code\">Provide a number for x: 2\r\nx:\r\n2\r\nProvide a number for y: 3\r\ny:\r\n3\r\nfirst:\r\n4\r\nsecond:\r\n18\r\n2x + 6y =\r\n-14</pre>\r\nThen the coder can see that x, y, first, and second are all correct. This must mean that it’s just when the sum is calculated that there is an error.","blurb":"","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}},{"authorId":9091,"name":"Sarah Guthals","slug":"sarah-guthals","description":"Sarah Guthals, PhD, is a social software engineer, entrepreneur, and former engineering manager at GitHub. She is coauthor of Helping Kids with Coding For Dummies.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9091"}}],"primaryCategoryTaxonomy":{"categoryId":33599,"title":"Coding","slug":"coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[{"label":"Turning sections on and off","target":"#tab1"},{"label":"Testing sample data","target":"#tab2"},{"label":"Adding output messages","target":"#tab3"}],"relatedArticles":{"fromBook":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}},{"articleId":253815,"title":"Teaching Kids Coding: Searching Lists","slug":"teaching-kids-coding-searching-lists","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253815"}}],"fromCategory":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}},{"articleId":253815,"title":"Teaching Kids Coding: Searching Lists","slug":"teaching-kids-coding-searching-lists","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253815"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281734,"slug":"helping-kids-with-coding-for-dummies","isbn":"9781119380672","categoryList":["technology","programming-web-design","coding"],"amazon":{"default":"https://www.amazon.com/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119380677-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-for-dummies-cover-9781119380672-203x255.jpg","width":203,"height":255},"title":"Helping Kids with Coding For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"\n <p><b data-author-id=\"9324\">Camille McCue, PhD,</b> is Director of Curriculum Innovations at the Adelson Educational Campus in Las Vegas where she leads the Startup Incubator, teaches STEM, and kickstarts K-12 learning initiatives. <b data-author-id=\"9091\">Sarah Guthals, PhD,</b> co-founded an ed-tech company and now continues to build technology for kids to learn, create, and share safely online. She loves to teach teachers how to teach coding in the classroom. </p>","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}},{"authorId":9091,"name":"Sarah Guthals","slug":"sarah-guthals","description":"Sarah Guthals, PhD, is a social software engineer, entrepreneur, and former engineering manager at GitHub. She is coauthor of Helping Kids with Coding For Dummies.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9091"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119380672&quot;]}]\" id=\"du-slot-6217baa1bb6fe\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119380672&quot;]}]\" id=\"du-slot-6217baa1bc09d\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Explore","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":253831},{"headers":{"creationTime":"2018-06-29T18:58:22+00:00","modifiedTime":"2018-06-29T18:58:22+00:00","timestamp":"2022-02-24T17:04:33+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"slug":"coding","categoryId":33599}],"title":"Helping Kids Find Common Coding Semantic Errors","strippedTitle":"helping kids find common coding semantic errors","slug":"helping-kids-find-common-coding-semantic-errors","canonicalUrl":"","seo":{"metaDescription":"","noIndex":0,"noFollow":0},"content":"It’s easy for kids to make semantic errors when they’re first learning to code. Unlike syntax errors, semantic errors are often more difficult to capture. This is because semantic errors are typically errors in the programming logic, rather than something that you typed incorrectly. Here, you find a couple of examples of semantic errors that you and your young coder might encounter in a few different programming languages.\r\n<h2 id=\"tab1\" >Infinite loops</h2>\r\nInfinite loops are loops that never end! They go on infinitely. This can be a problem because it might seem like the code just isn't working, but really the program is just running forever and ever.\r\n<h3>Using Java</h3>\r\nIf you wrote a small Java program where you wanted to print the numbers 0 through 9, you might write something like this:\r\n<pre class=\"code\">for(int index = 0; index < 10; index--)\r\n{\r\n System.out.println(index);\r\n}</pre>\r\nBut there is an error in this code! Instead of updating the index to be index + 1, the code updates the index to be index – 1! So the code does the following:\r\n<pre class=\"code\">index = 0\r\nIs index < 10? Yes\r\nPrint index 0\r\nindex = index – 1 index = -1\r\nIs index < 10? Yes\r\nPrint index -1\r\nindex = index – 1 index = -2\r\nIs index < 10? Yes\r\nPrint index -2\r\nindex = index – 1 index = -3\r\nIs index < 10? Yes\r\nPrint index -3</pre>\r\nThis continues forever, because it’s impossible for index to be greater than or equal to 10. So when you run the Java code, the program continues to print forever, until you kill the program!\r\n<h3>Using Scratch</h3>\r\nAlthough infinite loops can be a problem, some programming languages deliberately have implemented infinite loops to make some pretty neat effects! For example, in Scratch there is a forever block which can do some cool things.\r\n<h2 id=\"tab2\" >Off by one</h2>\r\nAnother very common error to run into is called an off by one error. This is very common when dealing with lists and iterating through lists.\r\n<h3>Using Scratch</h3>\r\nScratch, as usual, handles off by one errors for the user without really indicating there’s a problem. For example, the image below shows a program that loops through a list of pets and has the sprite say <code>Hi petName</code>, where <code>petName</code> is replaced with the item from the list (either Luke, Winston, or Princess). The loop repeats four times, but there are only three items in the list. Instead of completely breaking, on its last iteration, Scratch prints <code>Hi</code> with nothing after it.\r\n\r\n[caption id=\"attachment_253827\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253827 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-semantic-errors.jpg\" alt=\"semantic errors coding\" width=\"535\" height=\"147\" /> An example of a Scratch program with an off by one error.[/caption]\r\n<h3>Using Python</h3>\r\nOther programming languages are not as forgiving. For example, in Python you might have the following program to say hello to the three pets:\r\n<pre class=\"code\">pets = ['Luke’, 'Winston', 'Princess']\r\nfor x in range(1, 3):\r\nprint (‘Hi ‘ + pets[x])</pre>\r\nIf you run this program, the output would be:\r\n\r\nThe reason ‘Hi Luke’ doesn’t print is because lists in Python start at 0, not at 1. The correct code would be:\r\n<pre class=\"code\">pets = ['Luke', 'Winston', 'Princess']\r\nfor x in range(0, 3):\r\nprint ('Hi ' + pets[x])</pre>\r\nThe range function used in Python:\r\n<pre class=\"code\">range(0, 3)</pre>\r\nRepresents the elements 0, 1, and 2 because the range function <em>includes</em> the first number but <em>excludes</em> the second.\r\n\r\nAnother version of an off by one error in Python would be if you went beyond the length of the list. For example:\r\n<pre class=\"code\">pets = ['Luke', 'Winston', 'Princess']\r\nfor x in range(0, 4):\r\nprint ('Hi ' + pets[x])</pre>\r\nThis causes even more of an issue, because instead of simply missing an element in the list, you’re trying to access an element that never existed in the first place. The output for running this code is:\r\n<pre class=\"code\">Hi Luke\r\nHi Winston\r\nHi Princess\r\nTraceback (most recent call last):\r\n File \"filename.py\", line 4, in \r\n print ('Hi ') + pets[x]\r\nIndexError: list index out of range</pre>\r\nThere is an actual error, because the data for <code>pets[4]</code> doesn’t exist, so the computer cannot resolve it; therefore it doesn’t know what to do.\r\n<p class=\"article-tips remember\">Off by one errors can be really tricky for young coders, especially if they’re switching between languages where lists start at 1 versus lists that start at 0.</p>","description":"It’s easy for kids to make semantic errors when they’re first learning to code. Unlike syntax errors, semantic errors are often more difficult to capture. This is because semantic errors are typically errors in the programming logic, rather than something that you typed incorrectly. Here, you find a couple of examples of semantic errors that you and your young coder might encounter in a few different programming languages.\r\n<h2 id=\"tab1\" >Infinite loops</h2>\r\nInfinite loops are loops that never end! They go on infinitely. This can be a problem because it might seem like the code just isn't working, but really the program is just running forever and ever.\r\n<h3>Using Java</h3>\r\nIf you wrote a small Java program where you wanted to print the numbers 0 through 9, you might write something like this:\r\n<pre class=\"code\">for(int index = 0; index < 10; index--)\r\n{\r\n System.out.println(index);\r\n}</pre>\r\nBut there is an error in this code! Instead of updating the index to be index + 1, the code updates the index to be index – 1! So the code does the following:\r\n<pre class=\"code\">index = 0\r\nIs index < 10? Yes\r\nPrint index 0\r\nindex = index – 1 index = -1\r\nIs index < 10? Yes\r\nPrint index -1\r\nindex = index – 1 index = -2\r\nIs index < 10? Yes\r\nPrint index -2\r\nindex = index – 1 index = -3\r\nIs index < 10? Yes\r\nPrint index -3</pre>\r\nThis continues forever, because it’s impossible for index to be greater than or equal to 10. So when you run the Java code, the program continues to print forever, until you kill the program!\r\n<h3>Using Scratch</h3>\r\nAlthough infinite loops can be a problem, some programming languages deliberately have implemented infinite loops to make some pretty neat effects! For example, in Scratch there is a forever block which can do some cool things.\r\n<h2 id=\"tab2\" >Off by one</h2>\r\nAnother very common error to run into is called an off by one error. This is very common when dealing with lists and iterating through lists.\r\n<h3>Using Scratch</h3>\r\nScratch, as usual, handles off by one errors for the user without really indicating there’s a problem. For example, the image below shows a program that loops through a list of pets and has the sprite say <code>Hi petName</code>, where <code>petName</code> is replaced with the item from the list (either Luke, Winston, or Princess). The loop repeats four times, but there are only three items in the list. Instead of completely breaking, on its last iteration, Scratch prints <code>Hi</code> with nothing after it.\r\n\r\n[caption id=\"attachment_253827\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253827 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-semantic-errors.jpg\" alt=\"semantic errors coding\" width=\"535\" height=\"147\" /> An example of a Scratch program with an off by one error.[/caption]\r\n<h3>Using Python</h3>\r\nOther programming languages are not as forgiving. For example, in Python you might have the following program to say hello to the three pets:\r\n<pre class=\"code\">pets = ['Luke’, 'Winston', 'Princess']\r\nfor x in range(1, 3):\r\nprint (‘Hi ‘ + pets[x])</pre>\r\nIf you run this program, the output would be:\r\n\r\nThe reason ‘Hi Luke’ doesn’t print is because lists in Python start at 0, not at 1. The correct code would be:\r\n<pre class=\"code\">pets = ['Luke', 'Winston', 'Princess']\r\nfor x in range(0, 3):\r\nprint ('Hi ' + pets[x])</pre>\r\nThe range function used in Python:\r\n<pre class=\"code\">range(0, 3)</pre>\r\nRepresents the elements 0, 1, and 2 because the range function <em>includes</em> the first number but <em>excludes</em> the second.\r\n\r\nAnother version of an off by one error in Python would be if you went beyond the length of the list. For example:\r\n<pre class=\"code\">pets = ['Luke', 'Winston', 'Princess']\r\nfor x in range(0, 4):\r\nprint ('Hi ' + pets[x])</pre>\r\nThis causes even more of an issue, because instead of simply missing an element in the list, you’re trying to access an element that never existed in the first place. The output for running this code is:\r\n<pre class=\"code\">Hi Luke\r\nHi Winston\r\nHi Princess\r\nTraceback (most recent call last):\r\n File \"filename.py\", line 4, in \r\n print ('Hi ') + pets[x]\r\nIndexError: list index out of range</pre>\r\nThere is an actual error, because the data for <code>pets[4]</code> doesn’t exist, so the computer cannot resolve it; therefore it doesn’t know what to do.\r\n<p class=\"article-tips remember\">Off by one errors can be really tricky for young coders, especially if they’re switching between languages where lists start at 1 versus lists that start at 0.</p>","blurb":"","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}},{"authorId":9091,"name":"Sarah Guthals","slug":"sarah-guthals","description":"Sarah Guthals, PhD, is a social software engineer, entrepreneur, and former engineering manager at GitHub. She is coauthor of Helping Kids with Coding For Dummies.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9091"}}],"primaryCategoryTaxonomy":{"categoryId":33599,"title":"Coding","slug":"coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[{"label":"Infinite loops","target":"#tab1"},{"label":"Off by one","target":"#tab2"}],"relatedArticles":{"fromBook":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}},{"articleId":253815,"title":"Teaching Kids Coding: Searching Lists","slug":"teaching-kids-coding-searching-lists","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253815"}}],"fromCategory":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253818,"title":"Teaching Kids to Code Subprograms with Parameters","slug":"teaching-kids-code-subprograms-parameters","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253818"}},{"articleId":253815,"title":"Teaching Kids Coding: Searching Lists","slug":"teaching-kids-coding-searching-lists","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253815"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281734,"slug":"helping-kids-with-coding-for-dummies","isbn":"9781119380672","categoryList":["technology","programming-web-design","coding"],"amazon":{"default":"https://www.amazon.com/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119380677-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-for-dummies-cover-9781119380672-203x255.jpg","width":203,"height":255},"title":"Helping Kids with Coding For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"\n <p><b data-author-id=\"9324\">Camille McCue, PhD,</b> is Director of Curriculum Innovations at the Adelson Educational Campus in Las Vegas where she leads the Startup Incubator, teaches STEM, and kickstarts K-12 learning initiatives. <b data-author-id=\"9091\">Sarah Guthals, PhD,</b> co-founded an ed-tech company and now continues to build technology for kids to learn, create, and share safely online. She loves to teach teachers how to teach coding in the classroom. </p>","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}},{"authorId":9091,"name":"Sarah Guthals","slug":"sarah-guthals","description":"Sarah Guthals, PhD, is a social software engineer, entrepreneur, and former engineering manager at GitHub. She is coauthor of Helping Kids with Coding For Dummies.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9091"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119380672&quot;]}]\" id=\"du-slot-6217baa1b35cd\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119380672&quot;]}]\" id=\"du-slot-6217baa1b3f77\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Explore","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":253826},{"headers":{"creationTime":"2018-06-29T18:23:41+00:00","modifiedTime":"2018-06-29T18:23:41+00:00","timestamp":"2022-02-24T17:04:33+00:00"},"data":{"breadcrumbs":[{"name":"Technology","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33512"},"slug":"technology","categoryId":33512},{"name":"Programming & Web Design","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33592"},"slug":"programming-web-design","categoryId":33592},{"name":"Coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"},"slug":"coding","categoryId":33599}],"title":"Teaching Kids to Code Subprograms with Parameters","strippedTitle":"teaching kids to code subprograms with parameters","slug":"teaching-kids-code-subprograms-parameters","canonicalUrl":"","seo":{"metaDescription":"","noIndex":0,"noFollow":0},"content":"Your coder can provide flexibility to her programs by coding parameters to subprograms. For example, coding a square subprogram allows the program to draw a square of a defined size each time the subprogram is called. But what if you want the square subprogram to draw squares of differing sizes? By adding a parameter to the subprogram you can do just that. A <em>parameter</em> is a variable that you pass into a subprogram, which the subprogram uses as it executes. You can pass a parameter into the square subprogram that tells the code how big to draw the square.\r\n<h2 id=\"tab1\" >Scratch code block with parameters</h2>\r\nScratch allows you to add one or more parameters to any subprogram block you create. Your coder can begin by making a simple block. Then, your coder can add parameters when she first creates the block, or she can edit the block after it has been created — the process is essentially the same. Here are the steps for editing the square code block previously created:\r\n<ol>\r\n \t<li>In the More Blocks category, right-click (Windows) or control+click (Mac) the instance code block tile that you previously created.</li>\r\n \t<li>Select Edit from the pop-up menu which appears.\r\n\r\nThe Edit Block dialog box appears.</li>\r\n \t<li>At the Edit Block dialog box, click the Options tab to expand the options for adding parameters.</li>\r\n \t<li>Click the icon for any of the parameter options shown to add that parameter to your block.\r\n\r\nYou can choose Add Number Input, Add String Input, Add Boolean Input, or Add Label Text. When you click an icon to add that parameter, a blank field is added to your instance code block tile. You can add more than one parameter.</li>\r\n \t<li>Inside the blank field on the instance code block tile, type the variable name of the parameter(s) you’re adding.</li>\r\n \t<li>Select the Run without Screen Refresh check box.<strong>\r\n\r\n</strong>This allows for faster execution of your program.</li>\r\n \t<li>Click OK.<strong>\r\n\r\n</strong>The dialog box closes and the code block tile now shows the added parameter(s).</li>\r\n</ol>\r\n[caption id=\"attachment_253819\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253819 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-scratch-parameters.jpg\" alt=\"scratch parameters\" width=\"535\" height=\"436\" /> Editing a Scratch block definition to add parameters.[/caption]\r\n<p class=\"article-tips warning\">In Scratch, parameters added to code blocks play the same role as variables. When the parameter is added, you can use it just like a variable in your program — although be aware that it doesn’t appear in your list of variables in the Data category.</p>\r\nUsing your edited block with parameters is easy! Just drag the parameter tile from the code block definition (the big “hat” tile) into your code when you want to use the parameter. The parameter replaces code which you previously defined outright. Instead of the code tile for <code>move 100 steps</code>, you now have a code tile for <code>move size steps</code>. This allows for more flexible usage of the code block because it can now accept a number for the size, sent by the main program, and execute the code block with that size as the side length.\r\n\r\nYour main program then calls the parameterized block, sending it a number to use for the size: <code>square 30</code> draws a square with side lengths of 30 pixels; <code>square 110</code> draws a square with side lengths of 110 pixels.\r\n<h2 id=\"tab2\" >JavaScript, with parameters</h2>\r\nYou can add parameters to your JavaScript functions to add flexibility to your programs. To create a function with a parameter in Code.org's App Lab, using JavaScript, complete these steps:\r\n<ol>\r\n \t<li>At the Functions category of tiles, drag a function <code>myFunction(n)</code> tile into the program workspace.<strong>\r\n\r\n</strong>The n is a parameter. If you already added a <code>myFunction()</code> command without a parameter, you can add the parameter by typing the parameter inside the parentheses. (Or, if you are working in tile mode, press the little horizontal arrows to add or remove parameters from your function.) In text mode, separate multiple parameters using a comma and a space following each parameter.</li>\r\n \t<li>Replace the <code>myFunction(n)</code> placehoder, by typing a name for the function, and a name for your parameter(s).\r\n\r\nUse camelCase naming conventions for JavaScript. Each parameter is a variable in your program.</li>\r\n \t<li><strong>A</strong>ttach commands to define your function.<strong>\r\n\r\n</strong>The parameters are referenced by their variable names inside the function.</li>\r\n \t<li>Use the function name and parameter values to call it from your main program.<strong>\r\n\r\n</strong>The parameters values are passed into the function. Parameter values are assigned to the parameter variables and used inside the function.</li>\r\n</ol>\r\nSee the image below for a JavaScript program with functions and parameters, written in the App Lab. This program draws a field of twenty flowers of <em>different</em> sizes and pink color, randomly distributed in the display. Note that there are two parameterized functions: one to draw <code>oneFlower(size)</code>, and one to draw <code>onePetal(size)</code> of the flower.\r\n\r\nHere, the main program calls the <code>oneFlower(size)</code> function that has been defined to include a <code>size</code> parameter. The <code>oneFlower (randomNumber(5, 20))</code> function call sends a random number, from 5 to 20, to the <code>oneFlower(size)</code> function; <code>size</code> takes on a new value between 5 and 20 each time the function is called. The <code>oneFlower(size)</code> function then calls the <code>onePetal(size)</code> function. The <code>onePetal(size)</code> function receives whatever value its parent subprogram received for <code>size</code>. The effect is that flowers of different sizes are drawn onscreen. The emulator shows the result of executing the program.\r\n\r\n[caption id=\"attachment_253820\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253820 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-javascript-parameters.jpg\" alt=\"JavaScript parameters\" width=\"535\" height=\"334\" /> Generating a random number and assigning it to a size parameter in a JavaScript function creates variation in the sizes of the resulting flowers.[/caption]\r\n<h2 id=\"tab3\" >Java, with parameters</h2>\r\nThe image below shows a Java class named Product, written in the BlueJ IDE. The class contains one method, <code>Product</code>, which has two parameters, <code>a</code> and <code>b</code>.\r\n\r\n[caption id=\"attachment_253821\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253821 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-java-parameters.jpg\" alt=\"Java parameters\" width=\"535\" height=\"428\" /> Code a method with parameters in Java.[/caption]\r\n\r\nHere's how to code this program:\r\n<ol>\r\n \t<li>Code the class name: <code>public class Product {</code>.</li>\r\n \t<li>Code the main program.<strong>\r\n\r\n</strong>This is the section labeled <code>main</code>. The <code>main</code> program calls the <code>multiply</code> method, which receives two parameters.</li>\r\n \t<li>Code the <code>multiply</code> method, which has two parameters, <code>a</code> and <code>b</code>.\r\n\r\nThe <code>multiply</code> method defines three variables, <code>a</code>, <code>b</code>, and <code>total</code>. Variables a and b are parameters defined as integers. Their values, 5 and 7, are received from the call located in the main program. The <code>multiply</code> method computes <code>total</code> and prints out its value.</li>\r\n \t<li>Close the <code>class</code> with a curly bracket.</li>\r\n</ol>\r\nThe image below shows the execution of <code>Product</code>. Notice that the values of the variables <code>a</code> and <code>b</code> can be changed outside of the <code>multiply</code> method to result in a new product for <code>total</code>. This makes the <code>multiply</code> method modular and easy to reuse with different variable values on each use. Parameterizing methods build a more flexible program.\r\n\r\n[caption id=\"attachment_253822\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253822 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-java-program.jpg\" alt=\"Java program\" width=\"535\" height=\"419\" /> Execution of a program, including one method with parameters, in Java.[/caption]\r\n<p class=\"article-tips tech\">Subprograms can also generate information that they pass onto other subprograms or back to the main program. In Java, your coder sometimes sees the code <code>void</code>. This means that, when the subprogram is called, it's not sending anything back to the program that called it. In other cases, your coder sees a variable type and name following the name of the main program or of a subprogram. That type and name tells you what type of information is going to be received by the program making the call. The subprogram contains a <code>return</code> command indicating what variable value is being returned (passed back to) the program that called it.</p>","description":"Your coder can provide flexibility to her programs by coding parameters to subprograms. For example, coding a square subprogram allows the program to draw a square of a defined size each time the subprogram is called. But what if you want the square subprogram to draw squares of differing sizes? By adding a parameter to the subprogram you can do just that. A <em>parameter</em> is a variable that you pass into a subprogram, which the subprogram uses as it executes. You can pass a parameter into the square subprogram that tells the code how big to draw the square.\r\n<h2 id=\"tab1\" >Scratch code block with parameters</h2>\r\nScratch allows you to add one or more parameters to any subprogram block you create. Your coder can begin by making a simple block. Then, your coder can add parameters when she first creates the block, or she can edit the block after it has been created — the process is essentially the same. Here are the steps for editing the square code block previously created:\r\n<ol>\r\n \t<li>In the More Blocks category, right-click (Windows) or control+click (Mac) the instance code block tile that you previously created.</li>\r\n \t<li>Select Edit from the pop-up menu which appears.\r\n\r\nThe Edit Block dialog box appears.</li>\r\n \t<li>At the Edit Block dialog box, click the Options tab to expand the options for adding parameters.</li>\r\n \t<li>Click the icon for any of the parameter options shown to add that parameter to your block.\r\n\r\nYou can choose Add Number Input, Add String Input, Add Boolean Input, or Add Label Text. When you click an icon to add that parameter, a blank field is added to your instance code block tile. You can add more than one parameter.</li>\r\n \t<li>Inside the blank field on the instance code block tile, type the variable name of the parameter(s) you’re adding.</li>\r\n \t<li>Select the Run without Screen Refresh check box.<strong>\r\n\r\n</strong>This allows for faster execution of your program.</li>\r\n \t<li>Click OK.<strong>\r\n\r\n</strong>The dialog box closes and the code block tile now shows the added parameter(s).</li>\r\n</ol>\r\n[caption id=\"attachment_253819\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253819 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-scratch-parameters.jpg\" alt=\"scratch parameters\" width=\"535\" height=\"436\" /> Editing a Scratch block definition to add parameters.[/caption]\r\n<p class=\"article-tips warning\">In Scratch, parameters added to code blocks play the same role as variables. When the parameter is added, you can use it just like a variable in your program — although be aware that it doesn’t appear in your list of variables in the Data category.</p>\r\nUsing your edited block with parameters is easy! Just drag the parameter tile from the code block definition (the big “hat” tile) into your code when you want to use the parameter. The parameter replaces code which you previously defined outright. Instead of the code tile for <code>move 100 steps</code>, you now have a code tile for <code>move size steps</code>. This allows for more flexible usage of the code block because it can now accept a number for the size, sent by the main program, and execute the code block with that size as the side length.\r\n\r\nYour main program then calls the parameterized block, sending it a number to use for the size: <code>square 30</code> draws a square with side lengths of 30 pixels; <code>square 110</code> draws a square with side lengths of 110 pixels.\r\n<h2 id=\"tab2\" >JavaScript, with parameters</h2>\r\nYou can add parameters to your JavaScript functions to add flexibility to your programs. To create a function with a parameter in Code.org's App Lab, using JavaScript, complete these steps:\r\n<ol>\r\n \t<li>At the Functions category of tiles, drag a function <code>myFunction(n)</code> tile into the program workspace.<strong>\r\n\r\n</strong>The n is a parameter. If you already added a <code>myFunction()</code> command without a parameter, you can add the parameter by typing the parameter inside the parentheses. (Or, if you are working in tile mode, press the little horizontal arrows to add or remove parameters from your function.) In text mode, separate multiple parameters using a comma and a space following each parameter.</li>\r\n \t<li>Replace the <code>myFunction(n)</code> placehoder, by typing a name for the function, and a name for your parameter(s).\r\n\r\nUse camelCase naming conventions for JavaScript. Each parameter is a variable in your program.</li>\r\n \t<li><strong>A</strong>ttach commands to define your function.<strong>\r\n\r\n</strong>The parameters are referenced by their variable names inside the function.</li>\r\n \t<li>Use the function name and parameter values to call it from your main program.<strong>\r\n\r\n</strong>The parameters values are passed into the function. Parameter values are assigned to the parameter variables and used inside the function.</li>\r\n</ol>\r\nSee the image below for a JavaScript program with functions and parameters, written in the App Lab. This program draws a field of twenty flowers of <em>different</em> sizes and pink color, randomly distributed in the display. Note that there are two parameterized functions: one to draw <code>oneFlower(size)</code>, and one to draw <code>onePetal(size)</code> of the flower.\r\n\r\nHere, the main program calls the <code>oneFlower(size)</code> function that has been defined to include a <code>size</code> parameter. The <code>oneFlower (randomNumber(5, 20))</code> function call sends a random number, from 5 to 20, to the <code>oneFlower(size)</code> function; <code>size</code> takes on a new value between 5 and 20 each time the function is called. The <code>oneFlower(size)</code> function then calls the <code>onePetal(size)</code> function. The <code>onePetal(size)</code> function receives whatever value its parent subprogram received for <code>size</code>. The effect is that flowers of different sizes are drawn onscreen. The emulator shows the result of executing the program.\r\n\r\n[caption id=\"attachment_253820\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253820 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-javascript-parameters.jpg\" alt=\"JavaScript parameters\" width=\"535\" height=\"334\" /> Generating a random number and assigning it to a size parameter in a JavaScript function creates variation in the sizes of the resulting flowers.[/caption]\r\n<h2 id=\"tab3\" >Java, with parameters</h2>\r\nThe image below shows a Java class named Product, written in the BlueJ IDE. The class contains one method, <code>Product</code>, which has two parameters, <code>a</code> and <code>b</code>.\r\n\r\n[caption id=\"attachment_253821\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253821 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-java-parameters.jpg\" alt=\"Java parameters\" width=\"535\" height=\"428\" /> Code a method with parameters in Java.[/caption]\r\n\r\nHere's how to code this program:\r\n<ol>\r\n \t<li>Code the class name: <code>public class Product {</code>.</li>\r\n \t<li>Code the main program.<strong>\r\n\r\n</strong>This is the section labeled <code>main</code>. The <code>main</code> program calls the <code>multiply</code> method, which receives two parameters.</li>\r\n \t<li>Code the <code>multiply</code> method, which has two parameters, <code>a</code> and <code>b</code>.\r\n\r\nThe <code>multiply</code> method defines three variables, <code>a</code>, <code>b</code>, and <code>total</code>. Variables a and b are parameters defined as integers. Their values, 5 and 7, are received from the call located in the main program. The <code>multiply</code> method computes <code>total</code> and prints out its value.</li>\r\n \t<li>Close the <code>class</code> with a curly bracket.</li>\r\n</ol>\r\nThe image below shows the execution of <code>Product</code>. Notice that the values of the variables <code>a</code> and <code>b</code> can be changed outside of the <code>multiply</code> method to result in a new product for <code>total</code>. This makes the <code>multiply</code> method modular and easy to reuse with different variable values on each use. Parameterizing methods build a more flexible program.\r\n\r\n[caption id=\"attachment_253822\" align=\"aligncenter\" width=\"535\"]<img class=\"wp-image-253822 size-full\" src=\"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-java-program.jpg\" alt=\"Java program\" width=\"535\" height=\"419\" /> Execution of a program, including one method with parameters, in Java.[/caption]\r\n<p class=\"article-tips tech\">Subprograms can also generate information that they pass onto other subprograms or back to the main program. In Java, your coder sometimes sees the code <code>void</code>. This means that, when the subprogram is called, it's not sending anything back to the program that called it. In other cases, your coder sees a variable type and name following the name of the main program or of a subprogram. That type and name tells you what type of information is going to be received by the program making the call. The subprogram contains a <code>return</code> command indicating what variable value is being returned (passed back to) the program that called it.</p>","blurb":"","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}},{"authorId":9091,"name":"Sarah Guthals","slug":"sarah-guthals","description":"Sarah Guthals, PhD, is a social software engineer, entrepreneur, and former engineering manager at GitHub. She is coauthor of Helping Kids with Coding For Dummies.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9091"}}],"primaryCategoryTaxonomy":{"categoryId":33599,"title":"Coding","slug":"coding","_links":{"self":"https://dummies-api.dummies.com/v2/categories/33599"}},"secondaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"tertiaryCategoryTaxonomy":{"categoryId":0,"title":null,"slug":null,"_links":null},"trendingArticles":null,"inThisArticle":[{"label":"Scratch code block with parameters","target":"#tab1"},{"label":"JavaScript, with parameters","target":"#tab2"},{"label":"Java, with parameters","target":"#tab3"}],"relatedArticles":{"fromBook":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253815,"title":"Teaching Kids Coding: Searching Lists","slug":"teaching-kids-coding-searching-lists","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253815"}}],"fromCategory":[{"articleId":253846,"title":"Helping Kids with Coding: Distributing Mobile Apps","slug":"helping-kids-coding-distributing-mobile-apps","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253846"}},{"articleId":253837,"title":"Using the MIT App Inventor to Teach Kids Coding","slug":"using-mit-app-inventor-teach-kids-coding","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253837"}},{"articleId":253831,"title":"Teaching Kids Strategies for Debugging Code","slug":"teaching-kids-strategies-debugging-code","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253831"}},{"articleId":253826,"title":"Helping Kids Find Common Coding Semantic Errors","slug":"helping-kids-find-common-coding-semantic-errors","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253826"}},{"articleId":253815,"title":"Teaching Kids Coding: Searching Lists","slug":"teaching-kids-coding-searching-lists","categoryList":["technology","programming-web-design","coding"],"_links":{"self":"https://dummies-api.dummies.com/v2/articles/253815"}}]},"hasRelatedBookFromSearch":false,"relatedBook":{"bookId":281734,"slug":"helping-kids-with-coding-for-dummies","isbn":"9781119380672","categoryList":["technology","programming-web-design","coding"],"amazon":{"default":"https://www.amazon.com/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","ca":"https://www.amazon.ca/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","indigo_ca":"http://www.tkqlhce.com/click-9208661-13710633?url=https://www.chapters.indigo.ca/en-ca/books/product/1119380677-item.html&cjsku=978111945484","gb":"https://www.amazon.co.uk/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20","de":"https://www.amazon.de/gp/product/1119380677/ref=as_li_tl?ie=UTF8&tag=wiley01-20"},"image":{"src":"https://www.dummies.com/wp-content/uploads/helping-kids-with-coding-for-dummies-cover-9781119380672-203x255.jpg","width":203,"height":255},"title":"Helping Kids with Coding For Dummies","testBankPinActivationLink":"","bookOutOfPrint":false,"authorsInfo":"\n <p><b data-author-id=\"9324\">Camille McCue, PhD,</b> is Director of Curriculum Innovations at the Adelson Educational Campus in Las Vegas where she leads the Startup Incubator, teaches STEM, and kickstarts K-12 learning initiatives. <b data-author-id=\"9091\">Sarah Guthals, PhD,</b> co-founded an ed-tech company and now continues to build technology for kids to learn, create, and share safely online. She loves to teach teachers how to teach coding in the classroom. </p>","authors":[{"authorId":9324,"name":"Camille McCue","slug":"camille-mccue","description":"Camille McCue, PhD, is a STEM educator and school principal who has worked for IBM, NASA, and PBS. She has taught every grade from kindergarten to grad school, covering topics ranging from Scratch to AP computer science.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9324"}},{"authorId":9091,"name":"Sarah Guthals","slug":"sarah-guthals","description":"Sarah Guthals, PhD, is a social software engineer, entrepreneur, and former engineering manager at GitHub. She is coauthor of Helping Kids with Coding For Dummies.","_links":{"self":"https://dummies-api.dummies.com/v2/authors/9091"}}],"_links":{"self":"https://dummies-api.dummies.com/v2/books/"}},"collections":[],"articleAds":{"footerAd":"<div class=\"du-ad-region row\" id=\"article_page_adhesion_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_adhesion_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119380672&quot;]}]\" id=\"du-slot-6217baa1ab4f4\"></div></div>","rightAd":"<div class=\"du-ad-region row\" id=\"article_page_right_ad\"><div class=\"du-ad-unit col-md-12\" data-slot-id=\"article_page_right_ad\" data-refreshed=\"false\" \r\n data-target = \"[{&quot;key&quot;:&quot;cat&quot;,&quot;values&quot;:[&quot;technology&quot;,&quot;programming-web-design&quot;,&quot;coding&quot;]},{&quot;key&quot;:&quot;isbn&quot;,&quot;values&quot;:[&quot;9781119380672&quot;]}]\" id=\"du-slot-6217baa1abeb2\"></div></div>"},"articleType":{"articleType":"Articles","articleList":null,"content":null,"videoInfo":{"videoId":null,"name":null,"accountId":null,"playerId":null,"thumbnailUrl":null,"description":null,"uploadDate":null}},"sponsorship":{"sponsorshipPage":false,"backgroundImage":{"src":null,"width":0,"height":0},"brandingLine":"","brandingLink":"","brandingLogo":{"src":null,"width":0,"height":0}},"primaryLearningPath":"Explore","lifeExpectancy":null,"lifeExpectancySetFrom":null,"dummiesForKids":"no","sponsoredContent":"no","adInfo":"","adPairKey":[]},"status":"publish","visibility":"public","articleId":253818}],"_links":{"self":{"self":"https://dummies-api.dummies.com/v2/categories/33599/categoryArticles?sortField=time&sortOrder=1&size=10&offset=0"},"next":{"self":"https://dummies-api.dummies.com/v2/categories/33599/categoryArticles?sortField=time&sortOrder=1&size=10&offset=10"},"last":{"self":"https://dummies-api.dummies.com/v2/categories/33599/categoryArticles?sortField=time&sortOrder=1&size=10&offset=96"}}},"objectTitle":"","status":"success","pageType":"article-category","objectId":"33599","page":1,"sortField":"time","sortOrder":1,"categoriesIds":[],"articleTypes":[],"filterData":{"categoriesFilter":[{"itemId":0,"itemName":"All Categories","count":106}],"articleTypeFilter":[{"articleType":"All Types","count":106},{"articleType":"Articles","count":101},{"articleType":"Cheat Sheet","count":4},{"articleType":"Step by Step","count":1}]},"filterDataLoadedStatus":"success","pageSize":10},"adsState":{"pageScripts":{"headers":{"timestamp":"2022-05-24T18:59:04+00:00"},"adsId":0,"data":{"scripts":[{"pages":["all"],"location":"header","script":"<!--Optimizely Script-->\r\n<script src=\"https://cdn.optimizely.com/js/10563184655.js\"></script>","enabled":false},{"pages":["all"],"location":"header","script":"<!-- comScore Tag -->\r\n<script>var _comscore = _comscore || [];_comscore.push({ c1: \"2\", c2: \"15097263\" });(function() {var s = document.createElement(\"script\"), el = document.getElementsByTagName(\"script\")[0]; s.async = true;s.src = (document.location.protocol == \"https:\" ? \"https://sb\" : \"http://b\") + \".scorecardresearch.com/beacon.js\";el.parentNode.insertBefore(s, el);})();</script><noscript><img src=\"https://sb.scorecardresearch.com/p?c1=2&c2=15097263&cv=2.0&cj=1\" /></noscript>\r\n<!-- / comScore Tag -->","enabled":true},{"pages":["all"],"location":"footer","script":"<!--BEGIN QUALTRICS WEBSITE FEEDBACK SNIPPET-->\r\n<script type='text/javascript'>\r\n(function(){var g=function(e,h,f,g){\r\nthis.get=function(a){for(var a=a+\"=\",c=document.cookie.split(\";\"),b=0,e=c.length;b<e;b++){for(var d=c[b];\" \"==d.charAt(0);)d=d.substring(1,d.length);if(0==d.indexOf(a))return d.substring(a.length,d.length)}return null};\r\nthis.set=function(a,c){var b=\"\",b=new Date;b.setTime(b.getTime()+6048E5);b=\"; expires=\"+b.toGMTString();document.cookie=a+\"=\"+c+b+\"; path=/; \"};\r\nthis.check=function(){var a=this.get(f);if(a)a=a.split(\":\");else if(100!=e)\"v\"==h&&(e=Math.random()>=e/100?0:100),a=[h,e,0],this.set(f,a.join(\":\"));else return!0;var c=a[1];if(100==c)return!0;switch(a[0]){case \"v\":return!1;case \"r\":return c=a[2]%Math.floor(100/c),a[2]++,this.set(f,a.join(\":\")),!c}return!0};\r\nthis.go=function(){if(this.check()){var a=document.createElement(\"script\");a.type=\"text/javascript\";a.src=g;document.body&&document.body.appendChild(a)}};\r\nthis.start=function(){var t=this;\"complete\"!==document.readyState?window.addEventListener?window.addEventListener(\"load\",function(){t.go()},!1):window.attachEvent&&window.attachEvent(\"onload\",function(){t.go()}):t.go()};};\r\ntry{(new g(100,\"r\",\"QSI_S_ZN_5o5yqpvMVjgDOuN\",\"https://zn5o5yqpvmvjgdoun-wiley.siteintercept.qualtrics.com/SIE/?Q_ZID=ZN_5o5yqpvMVjgDOuN\")).start()}catch(i){}})();\r\n</script><div id='ZN_5o5yqpvMVjgDOuN'><!--DO NOT REMOVE-CONTENTS PLACED HERE--></div>\r\n<!--END WEBSITE FEEDBACK SNIPPET-->","enabled":false},{"pages":["all"],"location":"header","script":"<!-- Hotjar Tracking Code for http://www.dummies.com -->\r\n<script>\r\n (function(h,o,t,j,a,r){\r\n h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments)};\r\n h._hjSettings={hjid:257151,hjsv:6};\r\n a=o.getElementsByTagName('head')[0];\r\n r=o.createElement('script');r.async=1;\r\n r.src=t+h._hjSettings.hjid+j+h._hjSettings.hjsv;\r\n a.appendChild(r);\r\n })(window,document,'https://static.hotjar.com/c/hotjar-','.js?sv=');\r\n</script>","enabled":false},{"pages":["article"],"location":"header","script":"<!-- //Connect Container: dummies --> <script src=\"//get.s-onetag.com/bffe21a1-6bb8-4928-9449-7beadb468dae/tag.min.js\" async defer></script>","enabled":true},{"pages":["homepage"],"location":"header","script":"<meta name=\"facebook-domain-verification\" content=\"irk8y0irxf718trg3uwwuexg6xpva0\" />","enabled":true},{"pages":["homepage","article","category","search"],"location":"footer","script":"<!-- Facebook Pixel Code -->\r\n<noscript>\r\n<img height=\"1\" width=\"1\" src=\"https://www.facebook.com/tr?id=256338321977984&ev=PageView&noscript=1\"/>\r\n</noscript>\r\n<!-- End Facebook Pixel Code -->","enabled":true}]}},"pageScriptsLoadedStatus":"success"},"searchState":{"searchList":[],"searchStatus":"initial","relatedArticlesList":[],"relatedArticlesStatus":"initial"},"routeState":{"name":"ArticleCategory","path":"/category/articles/coding-33599/","hash":"","query":{},"params":{"category":"coding-33599"},"fullPath":"/category/articles/coding-33599/","meta":{"routeType":"category","breadcrumbInfo":{"suffix":"Articles","baseRoute":"/category/articles"},"prerenderWithAsyncData":true},"from":{"name":null,"path":"/","hash":"","query":{},"params":{},"fullPath":"/","meta":{}}},"sfmcState":{"newsletterSignupStatus":"initial"}}
Logo
  • Articles Open Article Categories
  • Books Open Book Categories
  • Collections Open Collections list
  • Custom Solutions
  • Home
  • Technology Articles
  • Programming & Web Design Articles
  • Coding Articles

Coding Articles

Basic coding terminology, planning your coding career, programming for web, freelancing tips, example coding projects, and more.

Articles From Coding

page 1
page 2
page 3
page 4
page 5
page 6
page 7
page 8
page 9
page 10
page 11

Filter Results

106 results
106 results
Coding Helping Kids with Coding For Dummies Cheat Sheet

Cheat Sheet / Updated 04-27-2022

Coding is fast becoming a skill that every child needs to be educated for in the 21st Century. But coding is taught at only a small fraction of schools, and often only at the high school level. Helping kids learn how to code also means you’re assisting them in developing a skill that is highly marketable and sets them apart from peers at school and later, in their careers. The topics in this cheat sheet can assist you on getting started when your kid expresses an interest in learning how to code.

View Cheat Sheet
Coding Coding All-in-One For Dummies Cheat Sheet

Cheat Sheet / Updated 02-25-2022

Coding is equal parts vocabulary, logic, and syntax. Coding may at first seem intimidating, but with practice, though, it's easy to get comfortable with its terminology, concepts, and structure. Understanding coding is not unlike learning a new language: Use it often enough and you'll find yourself able to speak, think, and write in code. Still, it's natural for beginners to have questions. There are many coding resources available to you, both on- and off-line. Ask around and you'll find you're not alone — many other people are learning. After all, coding is a never-ending education. Master one facet or another and a new one opens in front of you.

View Cheat Sheet
Coding Coding For Kids For Dummies Cheat Sheet

Cheat Sheet / Updated 02-23-2022

Coding, or computer programming, is your way of communicating with technology. It’s the new literacy you need to master to be successful in the coming decades. Like any form of communication, coding takes place through language. Just as there are many human languages (English, French, Mandarin, Spanish, and so on), there are many coding languages! Two examples of coding languages are Scratch and JavaScript. Scratch is perfect as a coding language for kids because it’s easy and fun to use, Scratch coding for kids allows you to build programs by snapping together commands in the same way you assemble a puzzle. JavaScript is a step up in difficulty because it’s an authentic programming language, used by real coders. JavaScript powers many technologies, and you can use it to make both apps for your phone and control code for operating electronics gadgets. You can ease into JavaScript by using blocks to build programs (just like Scratch) and then switching to text-based coding when you’re ready. Here, discover tips for creating programs in Scratch, coding JavaScript apps in App Lab, and writing JavaScript code in MakeCode to operate the micro:bit electronics board.

View Cheat Sheet
Coding Coding For Dummies Cheat Sheet

Cheat Sheet / Updated 01-19-2022

Coding is equal parts vocabulary, logic, and syntax. Coding may at first seem intimidating, but with practice, though, it’s easy to get comfortable with its terminology, concepts, and structure. Understanding coding is not unlike learning a new language: Use it often enough and you’ll find yourself able to speak, think, and write in code. Still, it’s natural for beginners to have questions. There are many coding resources available to you, both on- and off-line. Ask around and you’ll find you’re not alone — many other people are learning. After all, coding is a never-ending education. Master one facet or another and a new one opens in front of you.

View Cheat Sheet
Coding How to Send Data in Unstructured File Form

Article / Updated 07-01-2020

Unstructured data files consist of a series of bits. The file doesn’t separate the bits from each other in any way. You can’t simply look into the file and see any structure because there isn’t any to see. Unstructured file formats rely on the file user to know how to interpret the data. For example, each pixel of a picture file could consist of three 32-bit fields. Knowing that each field is 32-bits is up to you. A header at the beginning of the file may provide clues about interpreting the file, but even so, it’s up to you to know how to interact with the file. This example shows how to work with a picture as an unstructured file. The example image is a public domain offering from commons.wikimedia.org. To work with images, you need to access the scikit-image library, which is a free-of-charge collection of algorithms used for image processing. Here’s a tutorial for this library. The first task is to be able to display the image on-screen using the following code. (This code can require a little time to run. The image is ready when the busy indicator disappears from the IPython Notebook tab.) from skimage.io import imread from skimage.transform import resize from matplotlib import pyplot as plt import matplotlib.cm as cm example_file = ("http://upload.wikimedia.org/" + "wikipedia/commons/7/7d/Dog_face.png") image = imread(example_file, as_grey=True) plt.imshow(image, cmap=cm.gray) plt.show() The code begins by importing a number of libraries. It then creates a string that points to the example file online and places it in example_file. This string is part of the imread() method call, along with as_grey, which is set to True. The as_grey argument tells Python to turn color images into grayscale. Any images that are already in grayscale remain that way. Now that you have an image loaded, it’s time to render it (make it ready to display on-screen. The imshow() function performs the rendering and uses a grayscale color map. The show() function actually displays image for you. Close the image when you’re finished viewing it. (The asterisk in the In [*]: entry tells you that the code is still running and you can’t move on to the next step.) The act of closing the image ends the code segment. You now have an image in memory, and you may want to find out more about it. When you run the following code, you discover the image type and size: print("data type: %s, shape: %s" % (type(image), image.shape)) The output from this call tells you that the image type is a numpy.ndarray and that the image size is 90 pixels by 90 pixels. The image is actually an array of pixels that you can manipulate in various ways. For example, if you want to crop the image, you can use the following code to manipulate the image array: image2 = image[5:70,0:70] plt.imshow(image2, cmap=cm.gray) plt.show() The numpy.ndarray in image2 is smaller than the one in image, so the output is smaller as well. Typical results are shown below. The purpose of cropping the image is to make it a specific size. Both images must be the same size for you to analyze them. Cropping is one way to ensure that the images are the correct size for analysis. Another method that you can use to change the image size is to resize it. The following code resizes the image to a specific size for analysis: image3 = resize(image2, (30, 30), mode='nearest') plt.imshow(image3, cmap=cm.gray) print("data type: %s, shape: %s" % (type(image3), image3.shape)) The output from the print() function tells you that the image is now 30 pixels by 30 pixels in size. You can compare it to any image with the same dimensions. After you have all the images in the right size, you need to flatten them. A data set row is always a single dimension, not two dimensions. The image is currently an array of 30 pixels by 30 pixels, so you can’t make it part of a data set. The following code flattens image3 so that it becomes an array of 900 elements that is stored in image_row: image_row = image3.flatten() print("data type: %s, shape: %s" % (type(image_row), image_row.shape)) Notice that the type is still a numpy.ndarray. You can add this array to a data set and then use the data set for analysis purposes. The size is 900 elements, as anticipated.

View Article
Coding Helping Kids with Coding: Distributing Mobile Apps

Article / Updated 06-29-2018

After you and your young coder finish making your app, you can share it with anyone who has an Android device. Just go to your list of Projects (Projects  →   My Projects), check the box next to the app you want to publish, and click Publish to Gallery. Fill out the form by uploading an image and providing a description. This is where you can put any attributions of media that you might have used in your app. Click the Publish button when you’re ready. The screen you’re taken to, after you publish your app, has a share link, which you can share with your friends who might want to check out your code. They can then click Open The App and remix it to try it on their own! To share your app with friends who just want to play your game, you have two options. Generate a temp QR code. This code allows your friends to download your app. Open your app and choose Build →   App (provide QR code for .apk). In the pop-up window is the QR code, which you can share with your friends. Using any QR code scanner, they can scan the QR code, open the link that is associated with the QR code, and a download starts. After the download is complete, they can open the app and play your game! The game is available until they delete it, even though the QR code expires in two hours. Download your app files and distribute them to your friends. You can do this by choosing Build →   App (save .apk to my computer). Then you can upload the file to Google Drive (or any other accessible server), make sure it’s accessible for anyone to view the file, and then distribute the link to the file. When your friends open the link on their Android device, the app starts downloading.

View Article
Coding Using the MIT App Inventor to Teach Kids Coding

Article / Updated 06-29-2018

If your young coder wants to try apps, give the MIT App Inventor a try. To get started with MIT App Inventor, you need a Google account. Then follow these steps to set up your programming environment: Go to MIT App Inventor and click Create Apps in the top-right corner of the webpage. Sign in with your Google account. Give permission for Google to share your email address with App Inventor. Accept the Terms and Services for App Inventor and click Continue when you’re ready. Dismiss the survey and other items that pop up so that you can get started! You now see a view where all your projects are listed. You’re now ready to start designing and writing your first mobile app! Community and support within MIT App Inventor App Inventor was first released in 2010, and the community of coders and educators has grown. Make sure you’re signed in and then click Gallery. The image below shows the gallery where you find projects and tutorials that other coders have made and published. You and your coder can contribute to these too! In addition to the community gallery, MIT has created a number of resources for individuals and classrooms. For example, you’ll find over 30 tutorials divided by difficulty level and an option to filter by topic (such as game). There are also a ton of resources about using App Inventor, setting everything up, troubleshooting, and documentation. All this can be found in the MIT App Inventor library. Although this page is a bit less user-friendly — basically a list of links — it can be a great place to start if you have a question or experience any trouble. The community isn’t just created by MIT; there are also a number of books that you can find on App Inventor and forums where you can ask questions and get very specific answers on the App Inventor website under Resources. There are also specific resources for educators. Be sure to explore all the resources when getting your young coder acquainted with the software. The layout of MIT App Inventor Before you get started on your first mobile game, take the time to get acquainted with the programming environment. There are two areas your coder will spend time in: Design View and Code View. To get to Design View, click Start New Project in the top left of the programming environment. Name your project “myFirstApp.” The Design View opens. Note these six areas: Menu Bar: The menu bar across the top has the title of your app, options for multiple screens, and a toggle button for Designer and Blocks. Palette: On the left is a list of options for things to add to your app. Viewer: The viewer is basically what you see on your mobile device after you test your app. This is where you organize all the components to add to your app. Components: The components list shows all the elements in your app. Sometimes components are invisible, so this is an important view to know everything in your screen. Media: Under the Components view is a Media view where any sounds or images that you have uploaded to your app appear. Properties: If you click a component in the Components view, then the properties for that component is listed in this view. You can also change properties in this view, too. Then, to see the Code View, click the Blocks button on the very right of the Menu Bar. Menu Bar: Just like in the Design View, the menu bar allows you to switch screens or go back to the Design View. Blocks: This view has all the coding blocks (also referred to as tiles). There are generic blocks, but if you have a component in your design, there also are blocks specifically for that component. Media: This view has all the sounds and images that you have uploaded to your app. Coding Area: The coding area is where you drag the coding blocks to actually make your app respond to your users.

View Article
Coding Teaching Kids Strategies for Debugging Code

Article / Updated 06-29-2018

When you and your young coder are trying to debug, sometimes no error messages give you insight into the problem. Here, you find a list of strategies for debugging programs where you don’t get an error message, or the error message doesn’t give you enough information. Turning sections on and off One of the best ways to debug is to disable sections of code so that you have small sections to test. Using Scratch In Scratch, you might have a lot of scripts that start when the green flag is pressed. This can cause problems if some of the scripts cancel out or affect the other scripts. For example, the image below shows three scripts associated with one sprite. The problem that the user notices is when the mouse pointer is touching the sprite, it does not meow. To try to figure out the problem, the coder might disconnect all the scripts and only have one script connected at a time. Then they see that the code for the mouse pointer touching the sprite works correctly, but that there is another problem (the code that stops all sounds forever). By connecting and disconnecting the blocks, the coder can identify the problem. Using App Inventor Other block-based languages like App Inventor make turning sections on and off even easier! The image below shows how if you right-click a code block, you can disable that block. In this example, you might want to make sure the initial property settings work before creating the lists and hiding the items. Then, after you confirm the properties are set properly, you can enable the call to setupLists to make sure that works. Then you can enable the call to hideItems to make sure that works. By turning off all sections and then turning each one on one at a time, it’s easier to find bugs. Using Python Text-based languages have a similar way of turning sections on and off — you only have to comment out the lines of code. In Python, you can comment out a single line of code like this: #print 'Hi' And you can comment out multiple lines of code like this: "' for x in range(0, 4): print ('Hi ' + pets[x]) "' Commenting out code is how you “turn off” or “disable” parts of your code when you’re in a text-based language. Testing sample data A common bug that coders run into is not testing data to make sure that the program works. This can especially be a problem if you’re writing programs that take user input. It’s important to make sure you and your young coder think about what kind of input you’re expecting, and test to make sure the input is handled correctly. You might have a program that gets input from the user and prints what the user types, like this Python code: name = raw_input('What is your name? ‘) print (‘Hi ' + name) It’s important to test to make sure that if you put the following types of input, they still do what you, as the coder, expect: Sarah Sarah Guthals 13 11/15 Sarah 55 Guthals By mixing letters, spaces, numbers, and other symbols like / you’re ensuring that your program performs as expected. This type of testing is unit testing and ensures that small portions of your program execute correctly with varying input. Adding output messages One of the most challenging aspects of coding is that the code is abstract and sometimes the data is hidden. This is especially tricky when you have complex data or are performing complex operations on data. By adding a number of output messages in your code, you can indicate when certain sections of code have been reached, or you can show the current values of certain variables at various points during execution. An example of adding output messages to a program to gain insight in Python follows. Here, your goal is to write a program to solve an algebraic expression. For example: x = input('Provide a number for x: ') y = input('Provide a number for y: ') first = 2*x second = 6*y sum = first - second print '2x + 6y = ' print (sum) There is an error in this program; instead of adding the first and second elements, the coder is accidentally subtracting. Though this error is fairly obvious because this example is small, it shows how a simple typo could completely change the output. If you run this code, you get results like: Provide a number for x: 2 Provide a number for y: 3 2x + 6y = -14 This is clearly wrong. 2*2 + 6*3 = 4 + 18 = 22, not -14. One way of debugging this code is to add output messages at each point. For example, you could change your code to: x = input('Provide a number for x: ') print ('x: ') print (x) y = input('Provide a number for y: ') print ('y: ') print (y) first = 2*x print ('first: ') print (first) second = 6*y print ('second: ') print (second) sum = first - second print "2x + 6y = " print sum Then, when you run the code you get the following output: Provide a number for x: 2 x: 2 Provide a number for y: 3 y: 3 first: 4 second: 18 2x + 6y = -14 Then the coder can see that x, y, first, and second are all correct. This must mean that it’s just when the sum is calculated that there is an error.

View Article
Coding Helping Kids Find Common Coding Semantic Errors

Article / Updated 06-29-2018

It’s easy for kids to make semantic errors when they’re first learning to code. Unlike syntax errors, semantic errors are often more difficult to capture. This is because semantic errors are typically errors in the programming logic, rather than something that you typed incorrectly. Here, you find a couple of examples of semantic errors that you and your young coder might encounter in a few different programming languages. Infinite loops Infinite loops are loops that never end! They go on infinitely. This can be a problem because it might seem like the code just isn't working, but really the program is just running forever and ever. Using Java If you wrote a small Java program where you wanted to print the numbers 0 through 9, you might write something like this: for(int index = 0; index < 10; index--) { System.out.println(index); } But there is an error in this code! Instead of updating the index to be index + 1, the code updates the index to be index – 1! So the code does the following: index = 0 Is index < 10? Yes Print index 0 index = index – 1 index = -1 Is index < 10? Yes Print index -1 index = index – 1 index = -2 Is index < 10? Yes Print index -2 index = index – 1 index = -3 Is index < 10? Yes Print index -3 This continues forever, because it’s impossible for index to be greater than or equal to 10. So when you run the Java code, the program continues to print forever, until you kill the program! Using Scratch Although infinite loops can be a problem, some programming languages deliberately have implemented infinite loops to make some pretty neat effects! For example, in Scratch there is a forever block which can do some cool things. Off by one Another very common error to run into is called an off by one error. This is very common when dealing with lists and iterating through lists. Using Scratch Scratch, as usual, handles off by one errors for the user without really indicating there’s a problem. For example, the image below shows a program that loops through a list of pets and has the sprite say Hi petName, where petName is replaced with the item from the list (either Luke, Winston, or Princess). The loop repeats four times, but there are only three items in the list. Instead of completely breaking, on its last iteration, Scratch prints Hi with nothing after it. Using Python Other programming languages are not as forgiving. For example, in Python you might have the following program to say hello to the three pets: pets = ['Luke’, 'Winston', 'Princess'] for x in range(1, 3): print (‘Hi ‘ + pets[x]) If you run this program, the output would be: The reason ‘Hi Luke’ doesn’t print is because lists in Python start at 0, not at 1. The correct code would be: pets = ['Luke', 'Winston', 'Princess'] for x in range(0, 3): print ('Hi ' + pets[x]) The range function used in Python: range(0, 3) Represents the elements 0, 1, and 2 because the range function includes the first number but excludes the second. Another version of an off by one error in Python would be if you went beyond the length of the list. For example: pets = ['Luke', 'Winston', 'Princess'] for x in range(0, 4): print ('Hi ' + pets[x]) This causes even more of an issue, because instead of simply missing an element in the list, you’re trying to access an element that never existed in the first place. The output for running this code is: Hi Luke Hi Winston Hi Princess Traceback (most recent call last): File "filename.py", line 4, in print ('Hi ') + pets[x] IndexError: list index out of range There is an actual error, because the data for pets[4] doesn’t exist, so the computer cannot resolve it; therefore it doesn’t know what to do. Off by one errors can be really tricky for young coders, especially if they’re switching between languages where lists start at 1 versus lists that start at 0.

View Article
Coding Teaching Kids to Code Subprograms with Parameters

Article / Updated 06-29-2018

Your coder can provide flexibility to her programs by coding parameters to subprograms. For example, coding a square subprogram allows the program to draw a square of a defined size each time the subprogram is called. But what if you want the square subprogram to draw squares of differing sizes? By adding a parameter to the subprogram you can do just that. A parameter is a variable that you pass into a subprogram, which the subprogram uses as it executes. You can pass a parameter into the square subprogram that tells the code how big to draw the square. Scratch code block with parameters Scratch allows you to add one or more parameters to any subprogram block you create. Your coder can begin by making a simple block. Then, your coder can add parameters when she first creates the block, or she can edit the block after it has been created — the process is essentially the same. Here are the steps for editing the square code block previously created: In the More Blocks category, right-click (Windows) or control+click (Mac) the instance code block tile that you previously created. Select Edit from the pop-up menu which appears. The Edit Block dialog box appears. At the Edit Block dialog box, click the Options tab to expand the options for adding parameters. Click the icon for any of the parameter options shown to add that parameter to your block. You can choose Add Number Input, Add String Input, Add Boolean Input, or Add Label Text. When you click an icon to add that parameter, a blank field is added to your instance code block tile. You can add more than one parameter. Inside the blank field on the instance code block tile, type the variable name of the parameter(s) you’re adding. Select the Run without Screen Refresh check box. This allows for faster execution of your program. Click OK. The dialog box closes and the code block tile now shows the added parameter(s). In Scratch, parameters added to code blocks play the same role as variables. When the parameter is added, you can use it just like a variable in your program — although be aware that it doesn’t appear in your list of variables in the Data category. Using your edited block with parameters is easy! Just drag the parameter tile from the code block definition (the big “hat” tile) into your code when you want to use the parameter. The parameter replaces code which you previously defined outright. Instead of the code tile for move 100 steps, you now have a code tile for move size steps. This allows for more flexible usage of the code block because it can now accept a number for the size, sent by the main program, and execute the code block with that size as the side length. Your main program then calls the parameterized block, sending it a number to use for the size: square 30 draws a square with side lengths of 30 pixels; square 110 draws a square with side lengths of 110 pixels. JavaScript, with parameters You can add parameters to your JavaScript functions to add flexibility to your programs. To create a function with a parameter in Code.org's App Lab, using JavaScript, complete these steps: At the Functions category of tiles, drag a function myFunction(n) tile into the program workspace. The n is a parameter. If you already added a myFunction() command without a parameter, you can add the parameter by typing the parameter inside the parentheses. (Or, if you are working in tile mode, press the little horizontal arrows to add or remove parameters from your function.) In text mode, separate multiple parameters using a comma and a space following each parameter. Replace the myFunction(n) placehoder, by typing a name for the function, and a name for your parameter(s). Use camelCase naming conventions for JavaScript. Each parameter is a variable in your program. Attach commands to define your function. The parameters are referenced by their variable names inside the function. Use the function name and parameter values to call it from your main program. The parameters values are passed into the function. Parameter values are assigned to the parameter variables and used inside the function. See the image below for a JavaScript program with functions and parameters, written in the App Lab. This program draws a field of twenty flowers of different sizes and pink color, randomly distributed in the display. Note that there are two parameterized functions: one to draw oneFlower(size), and one to draw onePetal(size) of the flower. Here, the main program calls the oneFlower(size) function that has been defined to include a size parameter. The oneFlower (randomNumber(5, 20)) function call sends a random number, from 5 to 20, to the oneFlower(size) function; size takes on a new value between 5 and 20 each time the function is called. The oneFlower(size) function then calls the onePetal(size) function. The onePetal(size) function receives whatever value its parent subprogram received for size. The effect is that flowers of different sizes are drawn onscreen. The emulator shows the result of executing the program. Java, with parameters The image below shows a Java class named Product, written in the BlueJ IDE. The class contains one method, Product, which has two parameters, a and b. Here's how to code this program: Code the class name: public class Product {. Code the main program. This is the section labeled main. The main program calls the multiply method, which receives two parameters. Code the multiply method, which has two parameters, a and b. The multiply method defines three variables, a, b, and total. Variables a and b are parameters defined as integers. Their values, 5 and 7, are received from the call located in the main program. The multiply method computes total and prints out its value. Close the class with a curly bracket. The image below shows the execution of Product. Notice that the values of the variables a and b can be changed outside of the multiply method to result in a new product for total. This makes the multiply method modular and easy to reuse with different variable values on each use. Parameterizing methods build a more flexible program. Subprograms can also generate information that they pass onto other subprograms or back to the main program. In Java, your coder sometimes sees the code void. This means that, when the subprogram is called, it's not sending anything back to the program that called it. In other cases, your coder sees a variable type and name following the name of the main program or of a subprogram. That type and name tells you what type of information is going to be received by the program making the call. The subprogram contains a return command indicating what variable value is being returned (passed back to) the program that called it.

View Article
page 1
page 2
page 3
page 4
page 5
page 6
page 7
page 8
page 9
page 10
page 11

Quick Links

  • About For Dummies
  • Contact Us
  • Activate A Book Pin

Connect

Opt in to our newsletter!

By entering your email address and clicking the “Submit” button, you agree to the Terms of Use and Privacy Policy & to receive electronic communications from Dummies.com, which may include marketing promotions, news and updates.

About Dummies

Dummies has always stood for taking on complex concepts and making them easy to understand. Dummies helps everyone be more knowledgeable and confident in applying what they know. Whether it's to pass that big test, qualify for that big promotion or even master that cooking technique; people who rely on dummies, rely on it to learn the critical skills and relevant information necessary for success.

Terms of Use
Privacy Policy
Cookies Settings
Do Not Sell My Personal Info - CA Only