{"id":3904,"date":"2018-03-23T22:50:37","date_gmt":"2018-03-23T21:50:37","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=3904"},"modified":"2018-03-23T10:51:13","modified_gmt":"2018-03-23T09:51:13","slug":"the-mistakes-i-made-as-a-beginner-programmer-samer-buna-medium","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2018\/03\/23\/the-mistakes-i-made-as-a-beginner-programmer-samer-buna-medium\/","title":{"rendered":"The Mistakes I Made As a Beginner Programmer \u2013 Samer Buna \u2013 Medium"},"content":{"rendered":"<p><a href=\"https:\/\/medium.com\/@samerbuna\/the-mistakes-i-made-as-a-beginner-programmer-ac8b3e54c312\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"alignnone size-full\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/2000\/1%2AaPoiIzO6HE4uwMBLXgkB6A.png?w=910&#038;ssl=1\" alt=\"\" \/><\/a> Good reading: <em><a href=\"https:\/\/medium.com\/@samerbuna\/the-mistakes-i-made-as-a-beginner-programmer-ac8b3e54c312\">The Mistakes I Made As a Beginner Programmer by\u00a0 Samer Buna<\/a><\/em><\/p>\n<p><!--more--><\/p>\n<p><!--nextpage--><\/p>\n<blockquote>\n<div class=\"section-inner sectionLayout--insetColumn\">\n<h1 id=\"1a84\" class=\"graf graf--h3 graf--leading graf--title\">The Mistakes I Made As a Beginner Programmer<\/h1>\n<h2 id=\"26d6\" class=\"graf graf--h4 graf-after--h3 graf--subtitle\">Learn to identify them, make habits to avoid\u00a0them<\/h2>\n<\/div>\n<div class=\"section-inner sectionLayout--fullWidth\"><\/div>\n<div class=\"section-inner sectionLayout--fullWidth\">\n<figure id=\"6629\" class=\"graf graf--figure graf--layoutFillWidth graf-after--h4\" data-scroll=\"native\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*aPoiIzO6HE4uwMBLXgkB6A.png\" data-width=\"2856\" data-height=\"1474\" data-scroll=\"native\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/2000\/1%2AaPoiIzO6HE4uwMBLXgkB6A.png?w=910&#038;ssl=1\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/2000\/1*aPoiIzO6HE4uwMBLXgkB6A.png\" \/><\/div>\n<\/div>\n<\/figure>\n<\/div>\n<div class=\"section-inner sectionLayout--insetColumn\">\n<p id=\"1ea1\" class=\"graf graf--p graf-after--figure\">Let me make one thing clear first. If you are a beginner programmer, this article is not meant to make you feel bad about the mistakes that you might be making but rather to make you aware of them, teach you to spot signs of them, and remind you to avoid them.<\/p>\n<p id=\"a8ea\" class=\"graf graf--p graf-after--p\">I have made these mistakes in the past and learned from each and every one of them. I am happy to have formed coding habits to help me avoid them. You should do too.<\/p>\n<p id=\"52c3\" class=\"graf graf--p graf-after--p\">These mistakes are not presented here in any particular order.<\/p>\n<h3 id=\"f7e9\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">1) Writing Code Without\u00a0Planning<\/strong><\/h3>\n<p id=\"cb91\" class=\"graf graf--p graf-after--h3\">High-quality written content, in general, cannot be created easily. It requires careful thinking and research. High-quality programs are no exception.<\/p>\n<p id=\"514d\" class=\"graf graf--p graf-after--p\">Writing quality programs is a process with a flow:<br \/>\n<strong class=\"markup--strong markup--p-strong\">Think<\/strong>. <strong class=\"markup--strong markup--p-strong\">Research<\/strong>. <strong class=\"markup--strong markup--p-strong\">Plan<\/strong>. <strong class=\"markup--strong markup--p-strong\">Write<\/strong>. <strong class=\"markup--strong markup--p-strong\">Validate<\/strong>. <strong class=\"markup--strong markup--p-strong\">Modify<\/strong>.<br \/>\nUnfortunately, there is no good acronym for this. You need to create a habit to always go through the <em class=\"markup--em markup--p-em\">right<\/em> amount of these activities.<\/p>\n<p id=\"006d\" class=\"graf graf--p graf-after--p\">One of the biggest mistakes I have made as a beginner programmer was to start writing code right away without much thinking and researching. While this might work for a small stand-alone application, it has a big, negative effect on larger applications.<\/p>\n<p id=\"50c2\" class=\"graf graf--p graf-after--p\">Just like you need to think before saying anything you might regret, you need to think before you code anything you might regret. Coding is also a way to communicate your thoughts.<\/p>\n<blockquote id=\"b498\" class=\"graf graf--pullquote graf-after--p\"><p><em class=\"markup--em markup--pullquote-em\">When angry, count to 10 before you speak. If very angry, a\u00a0hundred.<\/em><\/p><\/blockquote>\n<blockquote id=\"e77c\" class=\"graf graf--pullquote graf-after--pullquote\"><p><em class=\"markup--em markup--pullquote-em\">\u2014 Thomas Jefferson.<\/em><\/p><\/blockquote>\n<p id=\"6bd0\" class=\"graf graf--p graf-after--pullquote\">Here is my version of that quote:<\/p>\n<blockquote id=\"3a0e\" class=\"graf graf--pullquote graf-after--p\"><p><em class=\"markup--em markup--pullquote-em\">When reviewing code, count to 10 before you refactor a line. If the code does not have tests, a\u00a0hundred.<\/em><\/p><\/blockquote>\n<\/div>\n<\/blockquote>\n<blockquote id=\"c0ff\" class=\"graf graf--pullquote graf-after--pullquote\"><p><em class=\"markup--em markup--pullquote-em\">\u2014 Samer\u00a0Buna<\/em><\/p><\/blockquote>\n<p id=\"8d4b\" class=\"graf graf--p graf-after--pullquote\">Programming is mostly about reading previous code, researching what is needed and how it fits within the current system, and planning the writing of features with small, testable increments. The actual writing of lines of code is probably only 10% of the whole process.\n<\/p>\n<p id=\"48ca\" class=\"graf graf--p graf-after--p\">Do not think about programming as writing lines of code. Programming is a logic-based creativity that needs nurturing.<\/p>\n<h3 id=\"3f44\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">2) Planning Too Much Before Writing\u00a0Code<\/strong><\/h3>\n<\/p>\n<p>&lt;<\/p>\n<p>p id=&#8221;fa12&#8243; class=&#8221;graf graf&#8211;p graf-after&#8211;h3&#8243;>Yes. Planning before jumping into writing code is a good thing, but even good things can hurt you when you do too much of them. Too much water might poison you.<\/p>\n<p id=\"6c0c\" class=\"graf graf--p graf-after--p\">Do not look for a perfect plan. That does not exist in the world of programming. Look for a good-enough plan, something that you can use to get started. The truth is, your plan will change, but what it was good for is to force you into some structure that leads to more clarity in your code. Too much planning is simply a waste of your time.<\/p>\n<p id=\"35fb\" class=\"graf graf--p graf-after--p\">I am only talking about planning small features. Planning all the features at once should simply be outlawed! It is what we call the <strong class=\"markup--strong markup--p-strong\">Waterfall Approach<\/strong>, which is a system linear plan with distinct steps that are to be finished one by one. You can imagine how much planning that approach needs. This is not the kind of planning I am talking about here. The waterfall approach does not work. Anything complicated can only be implemented with agile adaptations to reality.<\/p>\n<p id=\"ef0a\" class=\"graf graf--p graf-after--p\">Writing programs has to be a responsive activity. You will add features you would never have thought of in a waterfall plan. You will remove features because of reasons you would never have considered in a waterfall plan. You need to fix bugs and adapt to changes. You need to be agile.<\/p>\n<p id=\"6385\" class=\"graf graf--p graf-after--p\">However, always plan your next few features. Do that very carefully because too little planning and too much planning can both hurt the quality of your code, and the quality of your code is not something you can risk.<\/p>\n<h3 id=\"f805\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">3) Underestimating the Importance of Code\u00a0Quality<\/strong><\/h3>\n<p id=\"3d84\" class=\"graf graf--p graf-after--h3\">If you can only focus on one aspect of the code that you write, it should be its <strong class=\"markup--strong markup--p-strong\">readability<\/strong>. Unclear code is trash. It is not even recyclable.<\/p>\n<p id=\"3a9f\" class=\"graf graf--p graf-after--p\">Never underestimate the importance of code quality. Look at coding as a way to communicate implementations. Your main job as a coder is to clearly communicate the implementations of any solutions that you are working on.<\/p>\n<p id=\"9956\" class=\"graf graf--p graf-after--p\">One of my favorite quotes about programming is:<\/p>\n<blockquote id=\"c5f4\" class=\"graf graf--pullquote graf-after--p\"><p><span class=\"markup--quote markup--pullquote-quote is-other\" data-creator-ids=\"c64c4b529a5d anon\"><em class=\"markup--em markup--pullquote-em\">Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you\u00a0live.<\/em><\/span><\/p><\/blockquote>\n<blockquote id=\"087b\" class=\"graf graf--pullquote graf-after--pullquote\"><p><em class=\"markup--em markup--pullquote-em\">\u2014 John\u00a0Woods<\/em><\/p><\/blockquote>\n<p id=\"059a\" class=\"graf graf--p graf-after--pullquote\"><strong class=\"markup--strong markup--p-strong\">Brilliant advice, John!<\/strong>\n<\/p>\n<p id=\"04a8\" class=\"graf graf--p graf-after--p\">Even the small things matter. For example, if you are not consistent with your indentation and capitalization, you should simply lose your license to code.<\/p>\n<pre id=\"1f83\" class=\"graf graf--pre graf-after--p\">tHIS is\n  WAY MORE important<\/pre>\n<pre id=\"34e1\" class=\"graf graf--pre graf-after--pre\">than\n         you think<\/pre>\n<\/p>\n<p id=\"0cef\" class=\"graf graf--p graf-after--pre\">Another simple thing is the use of long lines. Anything beyond 80 characters is much harder to read. You might be tempted to place some long condition on the same line to keep an if-statement block more visible. Do not do that. Just never go beyond the 80 character limit, ever.<\/p>\n<p id=\"e248\" class=\"graf graf--p graf-after--p\">Many of the simple problems like these can be easily fixed with <strong class=\"markup--strong markup--p-strong\">linting <\/strong>and <strong class=\"markup--strong markup--p-strong\">formatting <\/strong>tools. In JavaScript, we have two excellent tools that work perfectly together: <strong class=\"markup--strong markup--p-strong\">ESLint <\/strong>and <strong class=\"markup--strong markup--p-strong\">Prettier<\/strong>. Do yourself a favor and always use them.<\/p>\n<p id=\"ef1a\" class=\"graf graf--p graf-after--p\">Here are a few more mistakes related to code quality:<\/p>\n<p id=\"3243\" class=\"graf graf--p graf-after--p\">\u2014 Using many lines in a function or a file. You should always break long code into smaller chunks that can be tested and managed separately.<\/p>\n<blockquote id=\"b2f8\" class=\"graf graf--pullquote graf-after--p\"><p><em class=\"markup--em markup--pullquote-em\">Any function that has more than 10 lines is just too\u00a0long<\/em><\/p><\/blockquote>\n<p id=\"0581\" class=\"graf graf--p graf-after--pullquote\">\u2014 Using double negatives. Please do not not not do that.<\/p>\n<blockquote id=\"52ec\" class=\"graf graf--pullquote graf-after--p\"><p><em class=\"markup--em markup--pullquote-em\">Using double negatives is just very not not\u00a0wrong<\/em><\/p><\/blockquote>\n<p id=\"fc34\" class=\"graf graf--p graf-after--pullquote\">\u2014 Using short, generic, or type-based variable names. Give your variables descriptive and non-ambiguous names.<\/p>\n<blockquote id=\"59e4\" class=\"graf graf--pullquote graf-after--p\"><p><em class=\"markup--em markup--pullquote-em\">There are only two hard things in Computer Science: cache invalidation and naming things.<\/em><\/p>\n<p>\u2014\u200aPhil\u00a0Karlton<\/p><\/blockquote>\n<p id=\"6f96\" class=\"graf graf--p graf-after--pullquote\">\u2014 Hard-coding primitive strings and numbers without descriptions. If you want to write logic that depends on a fixed primitive string or number value, put that value in a constant and give it a good name.<\/p>\n<pre id=\"65bc\" class=\"graf graf--pre graf-after--p\">const <strong class=\"markup--strong markup--pre-strong\">answerToLifeTheUniverseAndEverything<\/strong> = 42;<\/pre>\n<\/p>\n<p id=\"47ce\" class=\"graf graf--p graf-after--pre\">\u2014 Using sloppy shortcuts and workarounds to avoid spending more time around simple problems. Do not dance around problems. Face your realities.<\/p>\n<p id=\"416d\" class=\"graf graf--p graf-after--p\">\u2014 Thinking that longer code is better. Shorter code is better in most cases. Only write longer versions if they make the code more readable. For example, do not use clever one-liners and nested ternary expressions just to keep the code shorter, but also do not intentionally make the code longer when it does not need to be. Deleting unnecessary code is the best thing you can do in any program.<\/p>\n<blockquote id=\"af81\" class=\"graf graf--pullquote graf-after--p\"><p><em class=\"markup--em markup--pullquote-em\">Measuring programming progress by lines of code is like measuring aircraft building progress by weight.<\/em><\/p>\n<p>\u2014\u200aBill\u00a0Gates<\/p><\/blockquote>\n<p id=\"8acb\" class=\"graf graf--p graf-after--pullquote\">\u2014 The excessive use of conditional logic. Most of what you think needs conditional logic can be accomplished without it. Consider all the alternatives and pick exclusively based on readability. Do not optimize for performance unless you can measure. Related: avoid <a class=\"markup--anchor markup--p-anchor\" href=\"https:\/\/en.wikipedia.org\/wiki\/Yoda_conditions\" target=\"_blank\" rel=\"noopener nofollow\" data-href=\"https:\/\/en.wikipedia.org\/wiki\/Yoda_conditions\"><strong class=\"markup--strong markup--p-strong\">Yoda conditions<\/strong><\/a> and assignments within conditionals.<\/p>\n<h3 id=\"a81a\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">4) Picking the First\u00a0Solution<\/strong><\/h3>\n<\/p>\n<p id=\"2b0a\" class=\"graf graf--p graf-after--h3\">When I was starting to program, I remember that when I got presented with a problem, I would find a solution and just immediately run with it. I would rush the implementation right away before thinking about the complexities and potential failures of my first identified solution.<\/p>\n<p id=\"fa69\" class=\"graf graf--p graf-after--p\">While the first solution might be tempting, the good solutions are usually discovered once you start questioning all the solutions that you find. If you cannot think of multiple solutions to a problem, that is probably a sign that you do not completely understand the problem.<\/p>\n<p id=\"090a\" class=\"graf graf--p graf-after--p\">Your job as a professional programmer is not to find <em class=\"markup--em markup--p-em\">a solution <\/em>to the problem. It is to find the <strong class=\"markup--strong markup--p-strong\">simplest <\/strong>solution to the problem. By \u201csimple\u201d I mean the solution has to work correctly and perform adequately but still be simple enough to read, understand, and maintain.<\/p>\n<blockquote id=\"90f7\" class=\"graf graf--pullquote graf-after--p\"><p><em class=\"markup--em markup--pullquote-em\">There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies.<\/em><\/p><\/blockquote>\n<blockquote id=\"1ccf\" class=\"graf graf--pullquote graf-after--pullquote\"><p><em class=\"markup--em markup--pullquote-em\">\u2014 C.A.R.\u00a0Hoare<\/em><\/p><\/blockquote>\n<h3 id=\"aac1\" class=\"graf graf--h3 graf-after--pullquote\"><strong class=\"markup--strong markup--h3-strong\">5) Not\u00a0Quitting<\/strong><\/h3>\n<p id=\"04d7\" class=\"graf graf--p graf-after--h3\">Another mistake that I have made more often than I cared to admit is sticking with the first solution even after I identify that it might not be the simplest approach. This is probably psychologically related to the \u201c<strong class=\"markup--strong markup--p-strong\">not-quitting<\/strong>\u201d mentality. This is a good mentality to have in most activities, but it should not apply to programming. In fact, when it comes to writing programs, the right mentality is <strong class=\"markup--strong markup--p-strong\">fail early and fail often<\/strong>.\n<\/p>\n<p id=\"2317\" class=\"graf graf--p graf-after--p\">The minute you begin doubting a solution, you should consider throwing it away and re-thinking the problem. This is true no matter how much you were invested in that solution. Source control tools like GIT can help you branch off and experiment with many different solutions. Leverage that.<\/p>\n<blockquote id=\"a3f1\" class=\"graf graf--pullquote graf-after--p\"><p><em class=\"markup--em markup--pullquote-em\">Do not be attached to code because of how much effort you put into it. Bad code needs to be discarded.<\/em><\/p><\/blockquote>\n<h3 id=\"6891\" class=\"graf graf--h3 graf-after--pullquote\"><strong class=\"markup--strong markup--h3-strong\">6) Not\u00a0Googling<\/strong><\/h3>\n<p id=\"88f0\" class=\"graf graf--p graf-after--h3\">There has been many instances where I wasted precious time trying to solve a problem when I should have just researched it first.\n<\/p>\n<p id=\"e0ba\" class=\"graf graf--p graf-after--p\">Unless you are using a bleeding-edge technology, when you run into a problem, chances are someone else ran into the same problem and found a solution for it. Save yourself some time and <strong class=\"markup--strong markup--p-strong\">Google It First<\/strong>.<\/p>\n<p id=\"2f1e\" class=\"graf graf--p graf-after--p\">Sometimes, Googling will reveal that what you think is a problem is really not, and what you need to do is not fix it but rather embrace it. Do not assume that you know everything needed to pick a solution to a problem. Google will surprise you.<\/p>\n<p id=\"06a9\" class=\"graf graf--p graf-after--p\">However, be careful what you Google for. Another sign of a newbie is copying and using others code as is without understanding it. While that code might correctly solve your problem, you should never use any line of code that you do not fully understand.<\/p>\n<p id=\"4bd6\" class=\"graf graf--p graf-after--p\">If you want to be a creative coder, never think that you know what you\u2019re doing.<\/p>\n<blockquote id=\"c864\" class=\"graf graf--pullquote graf-after--p\"><p><em class=\"markup--em markup--pullquote-em\">The most dangerous thought that you can have as a creative person is to think that you know what you\u2019re\u00a0doing.<\/em><\/p><\/blockquote>\n<blockquote id=\"b16f\" class=\"graf graf--pullquote graf-after--pullquote\"><p><em class=\"markup--em markup--pullquote-em\">\u2014 Bret\u00a0Victor<\/em><\/p><\/blockquote>\n<h3 id=\"9816\" class=\"graf graf--h3 graf-after--pullquote\"><strong class=\"markup--strong markup--h3-strong\">7) Not Using Encapsulation<\/strong><\/h3>\n<p id=\"6dac\" class=\"graf graf--p graf-after--h3\">This point is not about using the object-oriented paradigm. The use of the encapsulation concept is always useful. Not using encapsulation often leads to harder-to-maintain systems.\n<\/p>\n<p id=\"9665\" class=\"graf graf--p graf-after--p\">In an application, a feature should have only one place that handles it. That is usually the responsibility of a single object. That object should only reveal what is absolutely necessary for other objects of the application to use it. This is not about secrecy but rather about the concept of reducing dependencies between the different parts of an application. Sticking with these rules allows you to safely make changes in the internals of your classes, objects, and functions without worrying about breaking things on a bigger scale.\n<\/p>\n<p id=\"0b43\" class=\"graf graf--p graf-after--p\">Conceptual units of logic and state should get their own <strong class=\"markup--strong markup--p-strong\">classes<\/strong>. By class, I mean a blueprint template. This can be an actual <strong class=\"markup--strong markup--p-strong\">Class <\/strong>object or a <strong class=\"markup--strong markup--p-strong\">Function <\/strong>object. You might also identify it as a <strong class=\"markup--strong markup--p-strong\">Module <\/strong>or a <strong class=\"markup--strong markup--p-strong\">Package<\/strong>.<\/p>\n<p id=\"b3d9\" class=\"graf graf--p graf-after--p\">Within a class of logic, self-contained pieces of tasks should get their own methods. Methods should do one thing and do that thing well. Similar classes should use the same method names.<\/p>\n<p id=\"8f66\" class=\"graf graf--p graf-after--p\">As a beginner programmer, I did not always have the instinct to start a new class for a conceptual unit and I often failed to identify what can be self-contained. If you see a \u201c<code class=\"\" data-line=\"\">Util<\/code>\u201d class that has been used as a dumping ground for many things that do not belong together, that is a sign of newbie code. If you make a simple change and then discover that the change has a cascading effect and you need to do many changes elsewhere, that is another sign of newbie code.<\/p>\n<p id=\"37c0\" class=\"graf graf--p graf-after--p\">Before adding a method to a class or adding more responsibilities to a method, think and question your instincts. You need time here. Do not skip or think that you will <strong class=\"markup--strong markup--p-strong\">refactor that later<\/strong>. Just do it right the first time.<\/p>\n<p id=\"56e2\" class=\"graf graf--p graf-after--p\">The big idea here is that you want your code to have <strong class=\"markup--strong markup--p-strong\">High Cohesion <\/strong>and <strong class=\"markup--strong markup--p-strong\">Low Coupling<\/strong>, which is just a fancy term that means keep related code together (in a class) and reduce the dependencies between different classes.<\/p>\n<h3 id=\"ad23\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">8) Planning for the\u00a0Unknown<\/strong><\/h3>\n<p id=\"17e9\" class=\"graf graf--p graf-after--h3\">It is often tempting to think beyond the solution that you are writing. All sort of what-ifs will pop into your head with every line of code that you write. This is a good thing for testing edge cases, but it is just wrong to use as a driver for <strong class=\"markup--strong markup--p-strong\">potential needs<\/strong>.<\/p>\n<p id=\"edd9\" class=\"graf graf--p graf-after--p\">You need to identify which of these two main categories your what-ifs belong to. Do not write code that you do not need today. Do not plan for the unknown future.<\/p>\n<p id=\"5a97\" class=\"graf graf--p graf-after--p\">Writing a feature because you think that you might need it in the future is simply wrong. Do not do it.<\/p>\n<p id=\"b98e\" class=\"graf graf--p graf-after--p\">Always write the minimum amount of code that you need today for the solution that you are implementing. Handle edge-cases, sure, but do not add <em class=\"markup--em markup--p-em\">edge-features<\/em>.<\/p>\n<blockquote id=\"1e96\" class=\"graf graf--pullquote graf-after--p\"><p><em class=\"markup--em markup--pullquote-em\">Growth for the sake of growth is the ideology of the cancer\u00a0cell.<\/em><\/p><\/blockquote>\n<blockquote id=\"8893\" class=\"graf graf--pullquote graf-after--pullquote\"><p><em class=\"markup--em markup--pullquote-em\">\u2014 Edward\u00a0Abbey<\/em><\/p><\/blockquote>\n<h3 id=\"8cd4\" class=\"graf graf--h3 graf-after--pullquote\"><strong class=\"markup--strong markup--h3-strong\">9) Not Using the Right Data Structures<\/strong><\/h3>\n<p id=\"3172\" class=\"graf graf--p graf-after--h3\">When preparing for interviews, beginner programmers usually put too much focus on algorithms. It is good to identify good algorithms and use them when needed, but memorizing them will probably never attribute to your programming genius.\n<\/p>\n<p id=\"52b0\" class=\"graf graf--p graf-after--p\">However, memorizing the strengths and weaknesses of the various data structures that you can use in your language will certainly make you a better developer.\n<\/p>\n<p id=\"983e\" class=\"graf graf--p graf-after--p\">Using the wrong data structure is a big and strongly-lit billboard sign that screams newbie code here.<\/p>\n<p id=\"4c63\" class=\"graf graf--p graf-after--p\">This article is not meant to teach you about data structures but let me mention a couple of quick examples:<\/p>\n<p id=\"6eec\" class=\"graf graf--p graf-after--p\"><strong class=\"markup--strong markup--p-strong\">\u2014 Using lists (arrays) instead of maps (objects) to manage records<\/strong><\/p>\n<p id=\"257e\" class=\"graf graf--p graf-after--p\">The most common data structure mistake is probably the use of lists instead of maps to manage a list of records. Yes, to manage a LIST of records you should use a MAP.<\/p>\n<p id=\"34a3\" class=\"graf graf--p graf-after--p\">Note that I am talking about a list of records here where each record has an identifier that\u2019s to be used to lookup that record. Using lists for scalar values is okay and often the better choice specially if the focus of the usage is \u201cpushing\u201d values to the list.<\/p>\n<p id=\"2374\" class=\"graf graf--p graf-after--p\">In JavaScript, the most common list structure is an array and the most common map structure is an object (there is also a map structure in modern JavaScript).<\/p>\n<p id=\"c88e\" class=\"graf graf--p graf-after--p\">Using lists over maps for managing records is often wrong. While this point is really only true for large collections, I would say just stick with it all the time. The main reason this is important is because when looking up records using their identifiers, maps are a lot faster than lists.<\/p>\n<p id=\"99f6\" class=\"graf graf--p graf-after--p\"><strong class=\"markup--strong markup--p-strong\">\u2014 Not Using Stacks<\/strong><\/p>\n<p id=\"1010\" class=\"graf graf--p graf-after--p\">When writing any code that requires some form of recursion, it is always tempting to use simple recursive functions. However, it is usually hard to optimize recursive code, especially in single-threaded environments.<\/p>\n<p id=\"ff31\" class=\"graf graf--p graf-after--p\">Optimizing recursive code depends on what recursive functions return. For example, optimizing a recursive function that returns two or more calls to itself is a lot harder than optimizing a recursive function that simply returns a single call to itself.<\/p>\n<p id=\"b8f0\" class=\"graf graf--p graf-after--p\">What we tend to overlook as beginners is that there is an alternative to using recursive functions. You can just use a <em class=\"markup--em markup--p-em\">Stack<\/em> structure. Push function calls to a Stack yourself and start popping them out when you are ready to traverse the calls back.<\/p>\n<h3 id=\"01e8\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">10) Making Existing Code\u00a0Worse<\/strong><\/h3>\n<p id=\"6634\" class=\"graf graf--p graf-after--h3\">Imagine that you were given a messy room like this:<\/p>\n<figure id=\"a73e\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\"><\/div>\n<\/figure>\n<figure id=\"a73e\" class=\"graf graf--figure graf-after--p\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*T6gU2PGfqll9h1zT6ApTUA.png\" data-width=\"974\" data-height=\"472\" data-action=\"zoom\" data-action-value=\"1*T6gU2PGfqll9h1zT6ApTUA.png\" data-scroll=\"native\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1600\/1%2AT6gU2PGfqll9h1zT6ApTUA.png?w=910&#038;ssl=1\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*T6gU2PGfqll9h1zT6ApTUA.png\" \/><\/div>\n<\/div>\n<\/figure>\n<p id=\"cf8b\" class=\"graf graf--p graf-after--figure\">You were then asked to add an item to that room. Since it is a big mess already, you might be tempted to put that item anywhere. You can be done with your task in a few seconds.<\/p>\n<p id=\"9190\" class=\"graf graf--p graf-after--p\">Do not do that with messy code. Do not make it worse! Always leave the code a bit cleaner than when you started to work with it.<\/p>\n<p id=\"51d7\" class=\"graf graf--p graf-after--p\">The right thing to do to the room above is to clean what is needed in order to place the new item in the right place. For example, if the item is a piece of clothing that needs to be placed in a closet, you need to clear a path to that closet. That is part of doing your task correctly.<\/p>\n<p id=\"0a70\" class=\"graf graf--p graf-after--p\">Here are a few wrong practices that usually make the code a bigger mess than what it was (not a complete list):<\/p>\n<ul class=\"postList\">\n<li id=\"ad8e\" class=\"graf graf--li graf-after--p\"><strong class=\"markup--strong markup--li-strong\">Duplicating code<\/strong>. If you copy\/paste a code section to only change a line after that, you are simply duplicating code and making a bigger mess. In the context of the messy room example above, this would be like introducing another chair with a lower base instead of investing in a new chair that is height-adjustable. Always keep the concept of abstraction in your mind and use it when you can.<\/li>\n<li id=\"3b69\" class=\"graf graf--li graf-after--li\"><strong class=\"markup--strong markup--li-strong\">Not using configuration files<\/strong>. If you need to use a value that could potentially be different in different environments or at different times, that value belongs in a configuration file. If you need to use a value in multiple places in your code, that value belongs in a configuration file. Just ask yourself this question all the time when you introduce a new value to the code: does this value belong in a configuration file? The answer will most likely be yes.<\/li>\n<li id=\"5b44\" class=\"graf graf--li graf-after--li\"><strong class=\"markup--strong markup--li-strong\">Using unnecessary conditional statements and temporary variables<\/strong>. Every if-statement is a logic branch that needs to be at-least double tested. When you can avoid conditionals without sacrificing readability, you should. The major problem with this is extending a function with a branch logic instead of introducing another function. Every time you think you need an if-statement or a new function variable you should ask yourself: am I changing the code at the right level or should I go think about the problem at a higher level?<\/li>\n<\/ul>\n<p id=\"0c79\" class=\"graf graf--p graf-after--li\">On the topic of unnecessary if-statements, think about this code:<\/p>\n<pre id=\"971d\" class=\"graf graf--pre graf-after--p\">function isOdd(number) {\n  if (number % 2 === 1) {\n    return true;\n  } else {\n    return false;\n  }\n}<\/pre>\n<p id=\"0a2a\" class=\"graf graf--p graf-after--pre\">The <code class=\"\" data-line=\"\">isOdd<\/code> function above has a few problems but can you see the most obvious one?<\/p>\n<p id=\"adc9\" class=\"graf graf--p graf-after--p\">It uses an unnecessary if-statement. Here is an equivalent code:<\/p>\n<pre id=\"6a7f\" class=\"graf graf--pre graf-after--p\">function isOdd(number) {\n  return (number % 2 === 1);\n};<\/pre>\n<h3 id=\"dcd3\" class=\"graf graf--h3 graf-after--pre\"><strong class=\"markup--strong markup--h3-strong\">11) Writing Comments About the Obvious\u00a0Things<\/strong><\/h3>\n<p id=\"1d1a\" class=\"graf graf--p graf-after--h3\">I have learned the hard way to avoid writing comments when I can. Most comments can be replaced with better-named elements in your code.<\/p>\n<p id=\"cb9f\" class=\"graf graf--p graf-after--p\">For example, instead of the following code:<\/p>\n<pre id=\"e41e\" class=\"graf graf--pre graf-after--p\"><strong class=\"markup--strong markup--pre-strong\">\/\/ This function sums only odd numbers in an array<\/strong>\nconst sum = (val) =&gt; {\n  return val.reduce((a, b) =&gt; {\n    if (b % 2 === 1) { <strong class=\"markup--strong markup--pre-strong\">\/\/ If the current number is even<\/strong>\n      a+=b;            <strong class=\"markup--strong markup--pre-strong\">\/\/ Add current number to accumulator<\/strong>\n    }<\/pre>\n<pre id=\"ba45\" class=\"graf graf--pre graf-after--pre\">    return a;          <strong class=\"markup--strong markup--pre-strong\">\/\/ The accumulator<\/strong>\n  }, 0);\n};<\/pre>\n<p id=\"6b00\" class=\"graf graf--p graf-after--pre\">The same code can be written without comments like this:<\/p>\n<pre id=\"b7e3\" class=\"graf graf--pre graf-after--p\">const <strong class=\"markup--strong markup--pre-strong\">sumOddValues<\/strong> = (<strong class=\"markup--strong markup--pre-strong\">array<\/strong>) =&gt; {\n  return array.reduce((<strong class=\"markup--strong markup--pre-strong\">accumulator<\/strong>, <strong class=\"markup--strong markup--pre-strong\">currentNumber<\/strong>) =&gt; {\n    if (<strong class=\"markup--strong markup--pre-strong\">isOdd<\/strong>(currentNumber)) { \n      return accumulator + currentNumber;\n    }<\/pre>\n<pre id=\"afc6\" class=\"graf graf--pre graf-after--pre\">    return accumulator;\n  }, 0);\n};<\/pre>\n<p id=\"0bcb\" class=\"graf graf--p graf-after--pre\">Just using better names for functions and arguments simply makes most comments unnecessary. Keep that in mind before writing any comment.<\/p>\n<p id=\"a0ee\" class=\"graf graf--p graf-after--p\">However, sometimes you are forced into situations where the only clarity you can add to the code is via comments. This is when you should structure your comments to answer the question of <em class=\"markup--em markup--p-em\">WHY this code<\/em> rather than the question of <em class=\"markup--em markup--p-em\">WHAT is this code doing<\/em>.<\/p>\n<p id=\"911a\" class=\"graf graf--p graf-after--p\">If you are strongly tempted to write a WHAT comment to clarify the code, please do not point out the obvious. Here is an example of some useless comments that only add noise to the code:<\/p>\n<pre id=\"f80a\" class=\"graf graf--pre graf-after--p\"><strong class=\"markup--strong markup--pre-strong\">\/\/ create a variable and initialize it to 0<\/strong>\nlet sum = 0;<\/pre>\n<pre id=\"cd23\" class=\"graf graf--pre graf-after--pre\"><strong class=\"markup--strong markup--pre-strong\">\/\/ Loop over array<\/strong>\narray.forEach(\n  <strong class=\"markup--strong markup--pre-strong\">\/\/ For each number in the array<\/strong>\n  (number) =&gt; {\n    <strong class=\"markup--strong markup--pre-strong\">\/\/ Add the current number to the sum variable<\/strong>\n    sum += number;\n  }\n);<\/pre>\n<p id=\"eca0\" class=\"graf graf--p graf-after--pre\">Do not be that programmer. Do not accept that code. Remove these comments if you have to deal with them. If you happen to be employing programmers who write comments like the above, go fire them, right now.<\/p>\n<h3 id=\"0af8\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">12) Not Writing\u00a0Tests<\/strong><\/h3>\n<p id=\"283a\" class=\"graf graf--p graf-after--h3\">I am going to keep this point simple. If you think you are an expert programmer and that thinking gives you the confidence to write code without tests, you are a newbie in my book.<\/p>\n<p id=\"aeaa\" class=\"graf graf--p graf-after--p\">If you are not writing tests in code, you are most likely testing your program some other way, manually. If you are building a web application, you will be refreshing and interacting with the application after every few lines of code. I do that too. There is nothing wrong with manually testing your code. However, you should manually test your code to figure out how to automatically test it. If you successfully test an interaction with your application, you should go back to your code editor and write code to automatically perform the exact same interaction the next time you add more code to the project.<\/p>\n<p id=\"ba3e\" class=\"graf graf--p graf-after--p\">You are a human being. You are going to forget to test all previously successful validations after each code change. Make the computer do that for you!<\/p>\n<p id=\"4004\" class=\"graf graf--p graf-after--p\">If you can, start by guessing or designing your validations even before you write the code to satisfy them. Testing-driven development (TDD) is not just some fancy hype. It positively affects the way you think about your features and how to come up with a better design for them.<\/p>\n<p id=\"a871\" class=\"graf graf--p graf-after--p\">TDD is not for everyone and it does not work well for every project, but if you can utilize it (even in part) you should totally do so.<\/p>\n<h3 id=\"5e40\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">13) Assuming That If Things are Working then Things are\u00a0Right<\/strong><\/h3>\n<p id=\"8a0e\" class=\"graf graf--p graf-after--h3\">Take a look at this function that implements the <code class=\"\" data-line=\"\">sumOddValues<\/code> feature. Is there anything wrong with it?<\/p>\n<pre id=\"6e4c\" class=\"graf graf--pre graf-after--p\">const sumOddValues = (array) =&gt; {\n  return array.reduce((accumulator, currentNumber) =&gt; {\n    if (currentNumber % 2 === 1) { \n      return accumulator + currentNumber;\n    }<\/pre>\n<pre id=\"cff7\" class=\"graf graf--pre graf-after--pre\">    return accumulator;\n  });\n};\n \n \n<strong class=\"markup--strong markup--pre-strong\">console.assert(\n  sumOddValues([1, 2, 3, 4, 5]) === 9\n);<\/strong><\/pre>\n<p id=\"5056\" class=\"graf graf--p graf-after--pre\">The assertion passes. Life is good. Right, RIGHT?<\/p>\n<p id=\"f684\" class=\"graf graf--p graf-after--p\">The problem with the code above is that it not complete. It correctly handles a few cases (and the assertion used happens to be one of these cases) but it has many problems beyond that. Let me go through a few of them:<\/p>\n<p id=\"71d0\" class=\"graf graf--p graf-after--p\"><strong class=\"markup--strong markup--p-strong\">\u2014 Problem #1: <\/strong>There is no handling for empty input. What should happen when the function is called without any arguments? Right now you get an error revealing the function\u2019s implementation when that happens:<\/p>\n<pre id=\"154d\" class=\"graf graf--pre graf-after--p\">TypeError: Cannot read property 'reduce' of undefined.<\/pre>\n<figure id=\"85d7\" class=\"graf graf--figure graf-after--pre\">\n<div class=\"aspectRatioPlaceholder is-locked\"><\/div>\n<\/figure>\n<section class=\"section section--body section--first\">\n<div class=\"section-content\">\n<div class=\"section-inner sectionLayout--insetColumn\">\n<figure id=\"85d7\" class=\"graf graf--figure graf-after--pre\">\n<div class=\"aspectRatioPlaceholder is-locked\">\n<div class=\"progressiveMedia js-progressiveMedia graf-image is-canvasLoaded is-imageLoaded\" data-image-id=\"1*DBFKfU-dhTK7xrTI8Ye-iQ.png\" data-width=\"974\" data-height=\"249\" data-action=\"zoom\" data-action-value=\"1*DBFKfU-dhTK7xrTI8Ye-iQ.png\" data-scroll=\"native\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"progressiveMedia-image js-progressiveMedia-image\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1600\/1%2ADBFKfU-dhTK7xrTI8Ye-iQ.png?w=910&#038;ssl=1\" data-src=\"https:\/\/cdn-images-1.medium.com\/max\/1600\/1*DBFKfU-dhTK7xrTI8Ye-iQ.png\" \/><\/div>\n<\/div>\n<\/figure>\n<p id=\"0d57\" class=\"graf graf--p graf-after--figure\">That is usually a sign of bad code for two main reasons.<\/p>\n<ul class=\"postList\">\n<li id=\"f131\" class=\"graf graf--li graf-after--p\">Users of your function should not encounter implementation details about it.<\/li>\n<li id=\"e0c7\" class=\"graf graf--li graf-after--li\">The error is not helpful for the user. Your function just did not work for them. However, if the error was more clear about the usage problem, they would know that they used the function incorrectly. For example, you can opt to have the function throw a user-defined exception like this:<\/li>\n<\/ul>\n<pre id=\"3a99\" class=\"graf graf--pre graf-after--li\">TypeError: Cannot execute function for empty list.<\/pre>\n<p id=\"c02c\" class=\"graf graf--p graf-after--pre\">Maybe instead of throwing an error, you need to design your function to just ignore empty input and return a sum of <code class=\"\" data-line=\"\">0<\/code>. Regardless, something has to be done for this case.<\/p>\n<p id=\"7190\" class=\"graf graf--p graf-after--p\"><strong class=\"markup--strong markup--p-strong\">\u2014 Problem #2: <\/strong>There is no handling of invalid input. What should happen if the function is called with a string, an integer, or an object value instead of an array?<\/p>\n<p id=\"ed89\" class=\"graf graf--p graf-after--p\">Here is what the function would throw now:<\/p>\n<pre id=\"4d78\" class=\"graf graf--pre graf-after--p\">sumOddValues(42);<\/pre>\n<pre id=\"c8ac\" class=\"graf graf--pre graf-after--pre\">TypeError: array.reduce is not a function<\/pre>\n<p id=\"9c97\" class=\"graf graf--p graf-after--pre\">Well, that is unfortunate because <code class=\"\" data-line=\"\">array.reduce<\/code> is definitely a function!<\/p>\n<p id=\"c987\" class=\"graf graf--p graf-after--p\">Since we named the function\u2019s argument <code class=\"\" data-line=\"\">array<\/code>, anything you call the function with (<code class=\"\" data-line=\"\">42<\/code> in the example above) is labeled as <code class=\"\" data-line=\"\">array<\/code> within the function. The error is basically saying that <code class=\"\" data-line=\"\">42.reduce<\/code> is not a function.<\/p>\n<p id=\"b4c8\" class=\"graf graf--p graf-after--p\">You see how that error is confusing, right? Maybe a more helpful error would have been:<\/p>\n<pre id=\"1bd0\" class=\"graf graf--pre graf-after--p\">TypeError: <code class=\"\" data-line=\"\">42 is not an array, dude.<\/code><\/pre>\n<p id=\"636b\" class=\"graf graf--p graf-after--pre\">Problems #1 and #2 are sometimes referred to as edge-cases. These are some common edge-cases to plan for, but there are usually less obvious edge-cases that you need to think about as well. For example, what happens if we use negative numbers?<\/p>\n<pre id=\"a6b5\" class=\"graf graf--pre graf-after--p\">sumOddValues([1, 2, 3, 4, 5, -13]) \/\/ =&gt; still 9<\/pre>\n<p id=\"3408\" class=\"graf graf--p graf-after--pre\">Well, <code class=\"\" data-line=\"\">-13<\/code> is an odd number. Is this the behavior that you want this function to have? Should it throw an error? Should it include the negative numbers in the sum? Or should it simply just ignore negative numbers like it is doing now? Maybe you will realize that the function should have been named <code class=\"\" data-line=\"\">sumPositiveOddNumbers<\/code>.<\/p>\n<p id=\"7094\" class=\"graf graf--p graf-after--p\">Making a decision on this case is easy. The more important point is, if you do not write a test case to document your decision, future maintainers of your function will have no clue if your ignoring of negative numbers was intentional or buggy.<\/p>\n<blockquote id=\"87ac\" class=\"graf graf--pullquote graf-after--p\"><p>It\u2019s not a bug. It\u2019s a\u00a0feature.<\/p><\/blockquote>\n<blockquote id=\"f2bc\" class=\"graf graf--pullquote graf-after--pullquote\"><p>\u2014 Someone who forgot a test\u00a0case<\/p><\/blockquote>\n<p id=\"f6ee\" class=\"graf graf--p graf-after--pullquote\"><strong class=\"markup--strong markup--p-strong\">\u2014 Problem #3: <\/strong>Not all valid cases are tested. Forget edge-cases, this function has a legitimate and very simple case that it does not handle correctly:<\/p>\n<pre id=\"2a3e\" class=\"graf graf--pre graf-after--p\">sumOddValues([2, 1, 3, 4, 5]) \/\/ =&gt; 11<\/pre>\n<\/p>\n<p id=\"9d12\" class=\"graf graf--p graf-after--pre\">The <code class=\"\" data-line=\"\">2<\/code> above was included in sum when it should not have been.\n<\/p>\n<p id=\"086b\" class=\"graf graf--p graf-after--p\">The solution is simple, <code class=\"\" data-line=\"\">reduce<\/code> accepts a second argument to be used as the initial value for the <code class=\"\" data-line=\"\">accumulator<\/code>. If that argument is not provided (like in the code above), <code class=\"\" data-line=\"\">reduce<\/code> will just use the <em class=\"markup--em markup--p-em\">first<\/em> value in the collection as the initial value for the <code class=\"\" data-line=\"\">accumulator<\/code>. This is why the first even value in the test case above was included in the sum.<\/p>\n<p id=\"bb44\" class=\"graf graf--p graf-after--p\">While you might have spotted this problem right away or when the code was written, this test case that revealed it should have been included in the tests, in the first place, along with many other test cases, like all-even numbers, a list that has <code class=\"\" data-line=\"\">0<\/code> in it, and an empty list.<\/p>\n<p id=\"76bc\" class=\"graf graf--p graf-after--p\">If you see minimal tests that do not handle many cases or ignore edge-cases, that is another sign of newbie code.<\/p>\n<h3 id=\"0db4\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">14) Not Questioning Existing\u00a0Code<\/strong><\/h3>\n<p id=\"3a11\" class=\"graf graf--p graf-after--h3\">Unless you are a super coder who always works solo, there is no doubt that you will encounter some kind of stupid code in your life. Beginners will not recognize it and they usually assume that it is good code since it seems to be working and it has been part of the codebase for a long time.<\/p>\n<p id=\"23d6\" class=\"graf graf--p graf-after--p\">What is worse is that if the bad code uses bad practices, the beginner might be tempted to repeat that bad practice elsewhere in the codebase because they learned it from what they thought was good code.<\/p>\n<p id=\"6eeb\" class=\"graf graf--p graf-after--p\">Some code looks bad but it might have a special condition around it that forced the developer to write it that way. This is a good place for a detailed comment that teaches beginners about that condition and why the code is written that way.<\/p>\n<p id=\"5618\" class=\"graf graf--p graf-after--p\">As a beginner, you should just assume that any undocumented code that you do not understand is a candidate for being bad. Question it. Ask about it. <code class=\"\" data-line=\"\">git blame<\/code> it!<\/p>\n<p id=\"1022\" class=\"graf graf--p graf-after--p\">If the author of that code is long gone or cannot remember it, research that code and try to understand everything about it. Only when you completely understand the code you get to form an opinion whether it is bad or good. Do not assume anything before that.<\/p>\n<h3 id=\"1ce3\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">15) Obsessing About Best Practices<\/strong><\/h3>\n<p id=\"6998\" class=\"graf graf--p graf-after--h3\">I think the term \u201cbest practices\u201d is actually harmful. It implies that no further research is needed. Here is the BEST practice ever. Do not question it!<\/p>\n<p id=\"7e8b\" class=\"graf graf--p graf-after--p\">There are no best practices. There are probably <em class=\"markup--em markup--p-em\">good<\/em> practices <em class=\"markup--em markup--p-em\">today<\/em> and <em class=\"markup--em markup--p-em\">for this programming language<\/em>.<\/p>\n<p id=\"435e\" class=\"graf graf--p graf-after--p\">Some of what we previously identified as best practices in programming are labeled today as bad practices.<\/p>\n<p id=\"0cf7\" class=\"graf graf--p graf-after--p\">You can always find better practices if you invest enough time. Stop worrying about best practices and focus on what you can do best.<\/p>\n<p id=\"d961\" class=\"graf graf--p graf-after--p\">Do not do something because of a quote you read somewhere, or because you saw someone else do it, or because someone said this is a best practice.<\/p>\n<h3 id=\"705d\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">16) Obsessing About Performance<\/strong><\/h3>\n<blockquote id=\"2d79\" class=\"graf graf--pullquote graf-after--h3\"><p><em class=\"markup--em markup--pullquote-em\">Premature optimization is the root of all evil (or at least most of it) in programming<\/em><\/p><\/blockquote>\n<blockquote id=\"4d09\" class=\"graf graf--pullquote graf-after--pullquote\"><p><em class=\"markup--em markup--pullquote-em\">\u2014 Donald Knuth\u00a0(1974)<\/em><\/p><\/blockquote>\n<p id=\"4cf3\" class=\"graf graf--p graf-after--pullquote\">While programming has significantly changed since Donald Knuth wrote the above statement, I think it still holds valuable advice today.\n<\/p>\n<p id=\"dae0\" class=\"graf graf--p graf-after--p\">The good rule to remember about this is: if you cannot measure the suspected efficiently problem with the code, do not attempt to optimize it.\n<\/p>\n<p id=\"eb62\" class=\"graf graf--p graf-after--p\">If you are optimizing before executing the code, chances are you are doing it prematurely. There is also a big change that the optimization that you are investing your time in is completely unnecessary.<\/p>\n<p id=\"b0ec\" class=\"graf graf--p graf-after--p\">Of course there are some obvious optimizations that you should always consider before introducing new code. For example, in Node.js, it is extremely important that you do not flood the event loop or block the call stack. This an example of an early optimization that you should always keep in mind. Ask yourself: Will the code I am thinking about block the call stack?<\/p>\n<p id=\"8f91\" class=\"graf graf--p graf-after--p\">Any non-obvious optimization that is carried out on any existing code without measurements is considered harmful and should be avoided. What you think could be a performance gain if done might turn out to be a source of new, unexpected bugs.<\/p>\n<p id=\"c4e0\" class=\"graf graf--p graf-after--p\">Do not waste your time optimizing unmeasured performance problems.<\/p>\n<h3 id=\"f355\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">17) Not Targeting the End-user Experience<\/strong><\/h3>\n<p id=\"3a98\" class=\"graf graf--p graf-after--h3\">What is the easiest way to add a feature to an application? Look at it from the point of view of yourself, or how it fits in the current User Interface. Right? If the feature is to capture some kind of input from the user, then append it to that form that you already have. If that feature is to add a link to a page, then add it to that nested menu of links that you already have.<\/p>\n<p id=\"e776\" class=\"graf graf--p graf-after--p\"><strong class=\"markup--strong markup--p-strong\">Do not be that developer.<\/strong> Be one of the professional ones who put themselves in their end-users\u2019 shoes. They imagine what the users of this particular feature need and how they might behave. They think about the ways to make the feature easy for the users to find and use, not about the easy way to make the feature exist in the application somehow without any thoughts about that feature\u2019s discoverability and usability.<\/p>\n<h3 id=\"b1d1\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">18) Not Picking the Right Tool for the\u00a0Job<\/strong><\/h3>\n<p id=\"faae\" class=\"graf graf--p graf-after--h3\">Everyone has their list of favorite tools to assist them in their programming-related activates. Some tools are great and some are bad but most tools are great for one particular thing and not so great for many others.<\/p>\n<p id=\"8109\" class=\"graf graf--p graf-after--p\">A hammer is a great tool to drive a nail into a wall but it is the worst tool to use with a screw. Do not use a hammer on a screw just because you \u201clove\u201d that hammer. Do not use a hammer on a screw just because that is the most popular hammer on Amazon with 5.0 user reviews.<\/p>\n<p id=\"0c86\" class=\"graf graf--p graf-after--p\">Relying on a tool\u2019s popularity rather than how much it fits the problem is a sign of a true newbie.<\/p>\n<p id=\"c3b2\" class=\"graf graf--p graf-after--p\">One problem about this point is that you will probably not know the \u201cbetter\u201d tools for a certain job. Within your current knowledge, a tool might be the best tool that you know of. However, when compared to other options, it would not make the top list. You need to familiarize yourself with the tools available to you and keep an open mind about the new tools that you can start using.<\/p>\n<p id=\"2b06\" class=\"graf graf--p graf-after--p\">Some coders refuse to use new tools. They are comfortable with their existing tools and they probably do not want to learn any new ones. I understand that and I can relate to it, but it is simply wrong.<\/p>\n<p id=\"725a\" class=\"graf graf--p graf-after--p\">You can build a house with primitive tools and take your sweet time or you can invest some time and money in good tools and build a better house much faster. Tools are continually improving and you need to get comfortable learning about them and using them.<\/p>\n<h3 id=\"0077\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">19) Not Understanding that Code Problems Will Cause Data\u00a0Problems<\/strong><\/h3>\n<p id=\"bb6f\" class=\"graf graf--p graf-after--h3\">An important aspect of a program is often the management of some form of data. The program will be the interface to add new records, delete old ones, and modify others.<\/p>\n<p id=\"22f4\" class=\"graf graf--p graf-after--p\">Even the smallest bugs in a program\u2019s code will result in an unpredictable state for the data it manages. This is especially true if all validations on the data are done entirely through the same buggy program.<\/p>\n<p id=\"1d51\" class=\"graf graf--p graf-after--p\">Beginners might not immediately connect the dots when it comes to code-data relationship. They might feel okay continuing to use some buggy code in production because feature X that is not working is not super important. The problem is that buggy code might be continually introducing data integrity problems that are not obvious at first.<\/p>\n<p id=\"a04b\" class=\"graf graf--p graf-after--p\">What is worse is that shipping code that fixed the bugs without fixing the subtle data problems that were caused by these bugs will just accumulate more data problems that take the case into the \u201cunrecoverable-level\u201d label.<\/p>\n<p id=\"1e68\" class=\"graf graf--p graf-after--p\">How do you protect yourself from problems like these? You can simply use multiple layers of data integrity validations. Do not rely on the single user interface. Create validations on front-ends, back-ends, network communications, and databases. If that is not an option, then you have to at-least use database-level constraints.<\/p>\n<p id=\"3ad7\" class=\"graf graf--p graf-after--p\">Familiarize yourself with database constraints and use all of them when you add columns and tables to your database:<\/p>\n<ul class=\"postList\">\n<li id=\"8c77\" class=\"graf graf--li graf-after--p\">A <strong class=\"markup--strong markup--li-strong\">NOT NULL <\/strong>constraint on a column means that null values will be rejected for that column. If your application assumes the existence of a value for that field, its source should be defined as not null in your database.<\/li>\n<li id=\"329f\" class=\"graf graf--li graf-after--li\">A <strong class=\"markup--strong markup--li-strong\">UNIQUE <\/strong>constraint on a column means that the column cannot have duplicate values across the whole table. For example, this is great for a username or email field on a Users table.<\/li>\n<li id=\"9898\" class=\"graf graf--li graf-after--li\">A <strong class=\"markup--strong markup--li-strong\">CHECK <\/strong>constraint is a custom expression that has to evaluate to true for the data to be accepted. For example, if you have a normal percentage column whose values have to be between 0 and 100, you can use a check constraint to enforce that.<\/li>\n<li id=\"7ec5\" class=\"graf graf--li graf-after--li\">A <strong class=\"markup--strong markup--li-strong\">PRIMARY KEY <\/strong>constraint means that the column\u2019s values are both not-null and unique as well. You are probably using this one. Each table in the database should have a primary key to identify its records.<\/li>\n<li id=\"9e47\" class=\"graf graf--li graf-after--li\">A <strong class=\"markup--strong markup--li-strong\">FOREIGN KEY <\/strong>constraint means that the column\u2019s values have to match values in another table column, which is usually a primary key.<\/li>\n<\/ul>\n<p id=\"e510\" class=\"graf graf--p graf-after--li\">Another newbie problem that is related to data integrity is the lack of thinking in terms of transactions. If multiple operations need to change the same data source and they depend on each other, they HAVE to be wrapped in a transaction that can be rolled back when one of these operations fail.<\/p>\n<h3 id=\"6f0e\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">20) Reinventing the\u00a0Wheel<\/strong><\/h3>\n<p id=\"f1e0\" class=\"graf graf--p graf-after--h3\">This is a tricky point. In programming, some wheels are simply worth reinventing. Programming is not a well-defined domain. So many things change so fast and new requirements are introduced faster than any team can handle.<\/p>\n<p id=\"5988\" class=\"graf graf--p graf-after--p\">For example, if you need a wheel that spins at different speeds based on the time of the day, instead of customizing the wheel we all know and love, maybe we need to rethink it. However, unless you actually need a wheel that is not used in its typical design, do not reinvent it. Just use the damn wheel.<\/p>\n<p id=\"9622\" class=\"graf graf--p graf-after--p\">Do not spend your precious time researching which is the best wheel out there. Just do a quick research and use what you find. Only replace wheels when you can clearly see that they do not perform as advertised.<\/p>\n<p id=\"a7f0\" class=\"graf graf--p graf-after--p\">The cool thing about programming is that most wheels are free and open for you to see their internal design. You can easily judge coding wheels by their internal design quality. Use open-source wheels if you can. Open-source packages can be debugged and fixed easily. They can also be replaced easily. In addition, it is easier to support them in-house.<\/p>\n<p id=\"d35b\" class=\"graf graf--p graf-after--p\">However, if you need a wheel, do not buy a whole new car and put the car that you are maintaining on top of that new car. Do not include a whole library just to use a function or two out of it. The best example about this is the <strong class=\"markup--strong markup--p-strong\">lodash <\/strong>library in JavaScript. If you just need to shuffle an array, just import the <code class=\"\" data-line=\"\">shuffle<\/code> method. Do not import the whole freaking lodash library.<\/p>\n<h3 id=\"4673\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">21) Having the Wrong Attitude Towards Code\u00a0Reviews<\/strong><\/h3>\n<p id=\"8a96\" class=\"graf graf--p graf-after--h3\">One sign of coding newbies is that they often look at code reviews as criticism. They do not like them. They do not appreciate them. They even fear them.<\/p>\n<p id=\"6458\" class=\"graf graf--p graf-after--p\">This is just wrong. If you feel that way, you need to change this attitude right away. Look at every code review as a learning opportunity. Welcome them and appreciate them. Learn from them. And most importantly, thank your reviewers when they teach you something.<\/p>\n<p id=\"4756\" class=\"graf graf--p graf-after--p\">You are a forever code learner. You need to accept that. Most code reviews will teach you something you did not know. Categorize them as a learning resource.<\/p>\n<p id=\"39fd\" class=\"graf graf--p graf-after--p\">Sometimes, the reviewer will be wrong and it will be your turn to teach them something. However, if that something was not obvious from just your code, then maybe your code needs to be modified in that case. And if you need to teach your reviewer something anyway, just know that teaching is one of the most rewarding activities that you can do as a programmer.<\/p>\n<h3 id=\"2f8d\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">22) Not Using Source\u00a0Control<\/strong><\/h3>\n<p id=\"fef4\" class=\"graf graf--p graf-after--h3\">Newbies sometimes underestimate the power of a good source\/revision control system, and by good I mean <strong class=\"markup--strong markup--p-strong\">Git<\/strong>.<\/p>\n<p id=\"1f86\" class=\"graf graf--p graf-after--p\">Source control is not about just pushing your changes for others to have and build on. It is a lot bigger than that. Source control is about clear history. Code will be questioned and the history of the progress of that code will help answer some of the tough questions. This is why we care about commit messages. They are yet another channel to communicate your implementations and using them with small commits help future maintainers of your code figure out how the code reached the state that it is in right now.<\/p>\n<p id=\"5c77\" class=\"graf graf--p graf-after--p\">Commit often and commit early and for the love of consistency use present tense verbs in your commit subject line. Be detailed with your messages but keep in mind that they should be summaries. If you need more than a few lines in them, that is probably a sign that your commit is simply too long. Rebase!<\/p>\n<p id=\"d32a\" class=\"graf graf--p graf-after--p\">Do not include anything unnecessary in your commit messages. For example, do not list the files that were added, modified, or deleted in your commit summaries. That list exists in the commit object itself and can be easily displayed with some Git command arguments. It would simply be noise in the summary message. Some teams like to have different summaries per file changed and I see that as another sign of a commit that is too big.<\/p>\n<p id=\"446c\" class=\"graf graf--p graf-after--p\">Source control is also about discoverability. If you encounter a function and you start questioning its need or design, you can find the commit that introduced it and see the context of that function. Commits can even help you identify what code introduced a bug into the program. Git even offers a binary search within commits (the <code class=\"\" data-line=\"\">bisect<\/code> command) to locate the single guilty commit that introduced a bug.<\/p>\n<p id=\"806a\" class=\"graf graf--p graf-after--p\">Source control can also be leveraged in wonderful ways even before the changes become official commits. The use of features like staging changes, patching selectively, resetting, stashing, amending, applying, diffing, reversing and many others add some rich tools to your coding flow. Understand them, learn them, use them, and appreciate them.<\/p>\n<p id=\"1281\" class=\"graf graf--p graf-after--p\">The fewer Git features you know, the more of a newbie you are in my book.<\/p>\n<h3 id=\"c038\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">23) Over-Using Shared\u00a0State<\/strong><\/h3>\n<p id=\"ccee\" class=\"graf graf--p graf-after--h3\">This, again, will not be a point about functional programming versus other paradigms. That is a topic for another article.<\/p>\n<p id=\"5bdc\" class=\"graf graf--p graf-after--p\">This is just about the fact that shared state is a source of problems and should be avoided, if possible. If that is not possible, the use of shared state should be kept to an absolute minimum.<\/p>\n<p id=\"d360\" class=\"graf graf--p graf-after--p\">What I did not realize as a beginner programmer is that every variable we define represents a shared state. It holds data that can be changed by all elements in the same scope as that variable. The more global the scope is, the worse the span of this shared state. Try to keep new states contained in small scopes and make sure they do not leak upward.<\/p>\n<p id=\"2e17\" class=\"graf graf--p graf-after--p\">The big problem with shared state starts to happen when multiple resources need to change that state together in the same tick of the event loop (in event-loop-based environments). Race conditions will happen.<\/p>\n<p id=\"59b0\" class=\"graf graf--p graf-after--p\">Here is the thing: a newbie might be tempted to use a timer as a workaround for this shared state race condition problem, especially if they have to deal with a data lock issue. That is a big red flag. Do not do it. Watch for it, point it out in code reviews, and never accept it.<\/p>\n<h3 id=\"17fa\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">24) Having the Wrong Attitude About\u00a0Errors<\/strong><\/h3>\n<p id=\"594c\" class=\"graf graf--p graf-after--h3\">Errors are a good thing. They mean you are making progress. They mean you have an easy follow-up change to make more progress.<\/p>\n<p id=\"c77a\" class=\"graf graf--p graf-after--p\">Expert programmers love errors. Newbies hate them.<\/p>\n<p id=\"c3eb\" class=\"graf graf--p graf-after--p\">If seeing these wonderful little red error messages bother you, you need to change that attitude. You need to look at them as helpers. You need to deal with them. You need to leverage them to make progress.<\/p>\n<p id=\"44ff\" class=\"graf graf--p graf-after--p\">Some errors need to be upgraded to exceptions. Exceptions are user-defined errors that you need to plan for. Some errors need to be left alone. They need to crash the application and make it exit.<\/p>\n<h3 id=\"6bed\" class=\"graf graf--h3 graf-after--p\"><strong class=\"markup--strong markup--h3-strong\">25) Not Taking\u00a0Breaks<\/strong><\/h3>\n<p id=\"509c\" class=\"graf graf--p graf-after--h3\">You are a human and your brain needs breaks. Your body needs breaks. You will often be in the zone and forget to take breaks. I look at that as another sign of newbies. This is not something you can compromise. Integrate something in your workflow to force you to take breaks. Take a lot of short breaks. Leave your chair and take a short walk and use it to think about what you need to do next. Come back to the code with fresh eyes.<\/p>\n<p id=\"80a6\" class=\"graf graf--p graf-after--p\">This has been a long post. You deserve a break.<\/p>\n<p id=\"3f47\" class=\"graf graf--p graf-after--p graf--trailing\">Thanks for reading<\/p>\n<\/div>\n<\/div>\n<\/section>\n<section class=\"section section--body section--last\">\n<div class=\"section-divider\">\n<hr class=\"section-divider\" \/>\n<\/div>\n<div class=\"section-content\">\n<div class=\"section-inner sectionLayout--insetColumn\">\n<p id=\"eb25\" class=\"graf graf--p graf--leading\">Learning React or Node? Checkout my books:<\/p>\n<ul class=\"postList\">\n<li id=\"45db\" class=\"graf graf--li graf-after--p\"><a class=\"markup--anchor markup--li-anchor\" href=\"http:\/\/amzn.to\/2peYJZj\" target=\"_blank\" rel=\"nofollow noopener\" data-href=\"http:\/\/amzn.to\/2peYJZj\">Learn React.js by Building Games<\/a><\/li>\n<li id=\"6d6c\" class=\"graf graf--li graf-after--li graf--trailing\"><a class=\"markup--anchor markup--li-anchor\" href=\"http:\/\/amzn.to\/2FYfYru\" target=\"_blank\" rel=\"nofollow noopener\" data-href=\"http:\/\/amzn.to\/2FYfYru\">Node.js Beyond the Basics<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Good reading: The Mistakes I Made As a Beginner Programmer by\u00a0 Samer Buna<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2018\/03\/23\/the-mistakes-i-made-as-a-beginner-programmer-samer-buna-medium\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"link","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[72],"tags":[],"class_list":["post-3904","post","type-post","status-publish","format-link","hentry","category-documentations","post_format-post-format-link"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-10Y","jetpack-related-posts":[{"id":2129,"url":"https:\/\/monodes.com\/predaelli\/2017\/02\/01\/thonny-python-ide-for-beginners\/","url_meta":{"origin":3904,"position":0},"title":"Thonny, Python IDE for beginners","author":"Paolo Redaelli","date":"2017-02-01","format":"link","excerpt":"\u00a0Thonny, Python IDE for beginners","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"https:\/\/monodes.com\/predaelli\/category\/python\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1600,"url":"https:\/\/monodes.com\/predaelli\/2016\/05\/27\/html5-beginners-guide-gaurav-kumar-gupta\/","url_meta":{"origin":3904,"position":1},"title":"HTML5 Beginner\u2019s Guide &#8211; Gaurav Kumar Gupta","author":"Paolo Redaelli","date":"2016-05-27","format":"link","excerpt":"http:\/\/www.gauravkgupta.com\/development\/html5-beginners-guide\/","rel":"","context":"In &quot;Web&quot;","block_context":{"text":"Web","link":"https:\/\/monodes.com\/predaelli\/category\/web\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":763,"url":"https:\/\/monodes.com\/predaelli\/2015\/10\/31\/how-to-differentiate-between-an-average-and-a-good-programmer\/","url_meta":{"origin":3904,"position":2},"title":"How to differentiate between an Average and a Good Programmer?","author":"Paolo Redaelli","date":"2015-10-31","format":false,"excerpt":"\u00a0How to differentiate between an Average and a Good Programmer? \u00a0 Oh my! It's so true! javarevisited looks like a really good programming blog as I found gems like\u00ab10 Articles Every Programmer Must Read \u00bb among What Every Programmer Should Know about Memory What Every Computer Scientist Should Know About\u2026","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"Being a good programmer is 3% talent, 97% not being distracted by the Internet","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/10\/Being%2Ba%2BProgrammer.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":8838,"url":"https:\/\/monodes.com\/predaelli\/2021\/10\/18\/3-books-every-programmer-should-read\/","url_meta":{"origin":3904,"position":3},"title":"3 Books Every Programmer Should Read","author":"Paolo Redaelli","date":"2021-10-18","format":"link","excerpt":"3 Books Every Programmer Should Read by Aniket, in JavaScript in Plain English","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2021\/10\/0LbZTDudWWHsDhMdA.jpg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":4852,"url":"https:\/\/monodes.com\/predaelli\/2018\/11\/04\/programmers-fonts\/","url_meta":{"origin":3904,"position":4},"title":"Programmers fonts","author":"Paolo Redaelli","date":"2018-11-04","format":false,"excerpt":"Fira code is not the only programmers font. Its web page also lists: HaskligMonoidFixedsys ExcelsiorIosevkaDejaVu Sans Code they are all free-as-in-freedom. Personally I prefer Fira","rel":"","context":"In &quot;Fonts&quot;","block_context":{"text":"Fonts","link":"https:\/\/monodes.com\/predaelli\/category\/fonts\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6564,"url":"https:\/\/monodes.com\/predaelli\/2020\/01\/29\/how-to-improve-when-youre-a-self-taught-programmer\/","url_meta":{"origin":3904,"position":5},"title":"How to Improve When You\u2019re a Self-Taught Programmer","author":"Paolo Redaelli","date":"2020-01-29","format":false,"excerpt":"How to Improve When You\u2019re a Self-Taught Programmer It wasn't so bad for me....","rel":"","context":"In &quot;Senza categoria&quot;","block_context":{"text":"Senza categoria","link":"https:\/\/monodes.com\/predaelli\/category\/senza-categoria\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/3904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=3904"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/3904\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=3904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=3904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=3904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}