{"id":33,"date":"2020-10-19T23:17:07","date_gmt":"2020-10-20T04:17:07","guid":{"rendered":"https:\/\/wowfall2020.londietmartin.com\/?p=33"},"modified":"2020-11-01T18:46:40","modified_gmt":"2020-11-02T00:46:40","slug":"how-to-think-code-a-guide-to-problem-solving-with-code","status":"publish","type":"post","link":"https:\/\/wowfall2020.londietmartin.com\/?p=33","title":{"rendered":"How to think Code? \u2013 A Guide to problem-solving with Code"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">By: Charlessia Robinson, October 2020<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">      Coding is 10% working and 90% thinking. Truthfully, it can be 90% understanding why the code is not working. In other words, you are just staring at the screen as if you have been bamboozled. That unpredictability might keep experienced developers on their toes, but for beginners this could be a breaking point. Before you feel the pressure to quit, I would suggest considering the ways in which your approaching code.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/wowfall2020.londietmartin.com\/wp-content\/uploads\/2020\/10\/pexels-andrea-piacquadio-3755761-1.jpg?resize=512%2C341&#038;ssl=1\" alt=\"Woman looking at computer frustrated with coding\" class=\"wp-image-41\" width=\"512\" height=\"341\" srcset=\"https:\/\/i0.wp.com\/wowfall2020.londietmartin.com\/wp-content\/uploads\/2020\/10\/pexels-andrea-piacquadio-3755761-1.jpg?resize=1024%2C682&amp;ssl=1 1024w, https:\/\/i0.wp.com\/wowfall2020.londietmartin.com\/wp-content\/uploads\/2020\/10\/pexels-andrea-piacquadio-3755761-1.jpg?resize=300%2C200&amp;ssl=1 300w, https:\/\/i0.wp.com\/wowfall2020.londietmartin.com\/wp-content\/uploads\/2020\/10\/pexels-andrea-piacquadio-3755761-1.jpg?resize=768%2C512&amp;ssl=1 768w, https:\/\/i0.wp.com\/wowfall2020.londietmartin.com\/wp-content\/uploads\/2020\/10\/pexels-andrea-piacquadio-3755761-1.jpg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">      Coding is no different than cooking up dinner for the holidays, organizing and categorizing your pantry to losing weight and running a marathon. All these tasks may seem too big and complex to take on. However, once you begin to break the problem down into steps, it gets easier and less tedious to solve. It is all about building a system that is functional and maintainable for you.<\/p>\n\n\n\n<p class=\"has-dark-gray-color has-text-color wp-block-paragraph\">      In the coding world, we call this incremental development which intends to avoid debugging by adding and testing only a small amount of code at a time<strong> <a>(<\/a><\/strong><sub>1<\/sub><strong>). <\/strong>Unsurprisingly, the more lines of code you write, the more lines of code you will need to debug. Therefore, its important to write, test and execute. So, from experience, I would make this a habit. It is easy to get defeated when your code is not working or behaving properly. However, errors in your code allow you to see its flaws. It is better to catch them now, before someone else does.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">      There are different types of errors that you may come across with buggy code. Identifying the source can save you time and confusion. They normally fall into the following three categories.<\/p>\n\n\n\n<h5 class=\"has-text-color wp-block-heading\" style=\"color:#5a11e4\"><strong><u>Syntax errors<\/u><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">These are errors that occur when you violate the rules of writing in that specific language<strong>. <\/strong>This compiler error indicates something that must be fixed before the code can be compiled <strong>(<\/strong><sub>2<\/sub><strong>).<\/strong> These are the most common errors that beginners see first like a missing semicolon or bracket.<\/p>\n\n\n\n<h5 class=\"has-text-color wp-block-heading\" style=\"color:#5a11e4\"><strong><u>Runtime errors<\/u><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Errors which occur during program execution after successful compilation <strong>(<\/strong><sub>2<\/sub><strong>).<em> <\/em><\/strong>Starting out, I would not stress over this. Your programs will be simple enough where you will not run into this issue just yet.<\/p>\n\n\n\n<h5 class=\"has-text-color wp-block-heading\" style=\"color:#5a11e4\"><strong><u>Semantic errors<\/u><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">This error occurs when the statements written in the program are not meaningful to the compiler <strong>(<\/strong><sub>2<\/sub><strong>)<\/strong><em>. <\/em>Therefore, this is more difficult to see. So, as a programmer, you must make a mental note of what the code should intentionally be doing.<\/p>\n\n\n\n<h4 class=\"has-text-color wp-block-heading\" style=\"color:#1a22ea\"><span style=\"text-decoration: underline\">Tips for Debugging<\/span><\/h4>\n\n\n\n<h5 class=\"has-text-color wp-block-heading\" style=\"color:#009617\"><strong><em><u>Look behind you<\/u><\/em><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">For beginners, it\u2019s hard to pinpoint where the errors are coming from. The error might not be happening on the line that your developer tool is suggesting. It could be occurring in the code above you. For instance, you could have mistyped or forgot to add proper headings to your document.<\/p>\n\n\n\n<h5 class=\"has-text-color wp-block-heading\" style=\"color:#009617\"><strong><em><u>Look in front of you<\/u><\/em><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Are you experiencing problems in the code below? Did you forget to add a return statement or a closing tag? Whichever one may be the case, it is important to separate the code out into sections. You should always divide and conquer.<\/p>\n\n\n\n<h5 class=\"has-text-color wp-block-heading\" style=\"color:#009617\"><strong><em><u>Undo and start over<\/u><\/em><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">If I know that I have gotten ahead of myself, I like to start over. It gives me a clean slate to think about my code and refocus. Although, you should always save the code previously worked on somewhere else. So, if you must go back to it, you will have it.<\/p>\n\n\n\n<h5 class=\"has-text-color wp-block-heading\" style=\"color:#009617\"><strong><em><u>Write and test line by line<\/u><\/em><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Coding requires a great deal of precision and patience. Yes, you wrote the same code for the thousandth time. However, you are not immune from the same errors occurring for the thousandth time. Your mind could be focused on the next line of code, errands you need to run, or what you want for lunch.<\/p>\n\n\n\n<h5 class=\"has-text-color wp-block-heading\" style=\"color:#009617\"><strong><em><u>Take a deep breath<\/u><\/em><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Its okay to take a break and step away from the computer. Sometimes, its easy to experience programmer burnout. Remember, programming is not a sprint, but a marathon. Work at your own pace and you will get there.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/wowfall2020.londietmartin.com\/wp-content\/uploads\/2020\/10\/pexels-mentatdgt-937453.jpg?resize=480%2C320&#038;ssl=1\" alt=\"Woman seated on floor with coffee in hand looking joyful and relaxing.\" class=\"wp-image-38\" width=\"480\" height=\"320\" srcset=\"https:\/\/i0.wp.com\/wowfall2020.londietmartin.com\/wp-content\/uploads\/2020\/10\/pexels-mentatdgt-937453.jpg?w=640&amp;ssl=1 640w, https:\/\/i0.wp.com\/wowfall2020.londietmartin.com\/wp-content\/uploads\/2020\/10\/pexels-mentatdgt-937453.jpg?resize=300%2C200&amp;ssl=1 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/figure><\/div>\n\n\n\n<h5 class=\"has-text-color wp-block-heading\" style=\"color:#009617\"><strong><em><u>Take time to refresh your memory<\/u><\/em><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Do not beat yourself up if you do not know what is wrong with your code. Its fine to look things up. Always consider that you are probably not the first programmer to have this issue.<\/p>\n\n\n\n<h5 class=\"has-text-color wp-block-heading\" style=\"color:#009617\"><strong><em><u>Do not get too attached to your code<\/u><\/em><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">With code, there are multiple ways to solve a problem. I know how easy it is to get caught up solving a problem a certain way. It can be difficult to let go of your original code and implement another solution. However, it is important to explore your options. This is how you make progress and strengthen your skills.<\/p>\n\n\n\n<h5 class=\"has-text-color wp-block-heading\" style=\"color:#009617\"><strong><em><u>Follow coding conventions<\/u><\/em><\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Following programming conventions has made debugging code more efficient for developers. This could be creating separate files, adding classes, indenting space to using identifiers like id tags to variables and functions. Separating and defining your code allows for code reuse. You can fix buggy code for multiple files without going line by line.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/wowfall2020.londietmartin.com\/wp-content\/uploads\/2020\/10\/pexels-pixabay-270360.jpg?resize=480%2C320&#038;ssl=1\" alt=\"A screenshot of html coding\" class=\"wp-image-39\" width=\"480\" height=\"320\" srcset=\"https:\/\/i0.wp.com\/wowfall2020.londietmartin.com\/wp-content\/uploads\/2020\/10\/pexels-pixabay-270360.jpg?w=640&amp;ssl=1 640w, https:\/\/i0.wp.com\/wowfall2020.londietmartin.com\/wp-content\/uploads\/2020\/10\/pexels-pixabay-270360.jpg?resize=300%2C200&amp;ssl=1 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">(1) Downey, Allen B., Think Python. O\u2019Reilly Media Inc., 2016.                  <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">(2) \u201cErrors in C++\u201d, Geeks for Geeks, <a href=\"https:\/\/www.geeksforgeeks.org\/errors-in-cc\/\">https:\/\/www<\/a><a href=\"https:\/\/www.geeksforgeeks.org\/errors-in-cc\/\" target=\"_blank\" rel=\"noreferrer noopener\">.<\/a><a href=\"https:\/\/www.geeksforgeeks.org\/errors-in-cc\/\">geeksforgeeks.org\/errors-in-cc\/<\/a> Accessed 5 October 2020.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Source: Images<\/strong><\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Piacquadio, Andrea. &#8220;Woman in Red T-Shirt Looking at Her Laptop.&#8221; <a href=\"https:\/\/www.pexels.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><em>https:\/\/www.pexels.com\/<\/em><\/a>. 17 February 2020. <a href=\"https:\/\/www.pexels.com\/photo\/woman-in-red-t-shirt-looking-at-her-laptop-3755761\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.pexels.com\/photo\/woman-in-red-t-shirt-looking-at-her-laptop-3755761\/<\/a>. Accessed 10 October 2020.<\/li><li>Mentatdgt. \u201cWoman posing. Wearing White Dress Shirt Sitting on Window.\u201d <a href=\"https:\/\/www.pexels.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><em>https:\/\/www.pexels.com\/<\/em><\/a>. 2018 March 13. <a href=\"https:\/\/www.pexels.com\/photo\/woman-posing-wearing-white-dress-shirt-sitting-on-window-937453\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.pexels.com\/photo\/woman-posing-wearing-white-dress-shirt-sitting-on-window-937453\/<\/a>. Accessed 10 October 2020.<\/li><\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Pixabay. \u201cTurned-on Computer Monitor Displaying Text.\u201d <a href=\"https:\/\/www.pexels.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.pexels.com\/<\/a>. 2016 December 23. <a href=\"https:\/\/www.pexels.com\/photo\/business-code-coding-computer-270360\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.pexels.com\/photo\/business-code-coding-computer-270360\/<\/a>. Accessed 10 October 2020.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By: Charlessia Robinson, October 2020 Coding is 10% working and 90% thinking. Truthfully, it can be 90% understanding why the code is not working. In&hellip;<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_monsterinsights_skip_tracking":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/wowfall2020.londietmartin.com\/index.php?rest_route=\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wowfall2020.londietmartin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wowfall2020.londietmartin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wowfall2020.londietmartin.com\/index.php?rest_route=\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/wowfall2020.londietmartin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33"}],"version-history":[{"count":5,"href":"https:\/\/wowfall2020.londietmartin.com\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":634,"href":"https:\/\/wowfall2020.londietmartin.com\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions\/634"}],"wp:attachment":[{"href":"https:\/\/wowfall2020.londietmartin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wowfall2020.londietmartin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wowfall2020.londietmartin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}