{"id":62147,"date":"2022-09-05T21:01:38","date_gmt":"2022-09-05T13:01:38","guid":{"rendered":"https:\/\/www.hongkiat.com\/blog\/?p=62147"},"modified":"2023-04-06T19:19:50","modified_gmt":"2023-04-06T11:19:50","slug":"basic-programming-principals","status":"publish","type":"post","link":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/","title":{"rendered":"10 Essential Programming Principles for Successful Coders"},"content":{"rendered":"<p>As a programmer, your role is to write code that works properly and provides the desired output. However, the code must also be easy to understand, maintain, and extend. To meet this challenge, you need to combine the key concepts of programming with the principles of good coding.<\/p>\n<p>In this post, I\u2019ll share my top 10 programming principles to help you improve how you write code \u2013 making life easier for you, your fellow developers, and your end users.<\/p>\n<h2>Why are Programming Principles important?<\/h2>\n<p>By learning some programming principles and using them in your code, you\u2019ll become a better developer. Following these practices improves the overall quality of code and makes it easier for you or someone else to make changes or add functionality in the future.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/basic-programming-principals\/1-programming-principles.jpg\" alt=\"programming principles\" width=\"800\" height=\"451\"><\/figure>\n<p><small>Image source: <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.bounteous.com\/insights\/2019\/07\/03\/good-code-programming-principles\/\">Bounteous<\/a><\/small><\/p>\n<p>Programming principles help you to avoid problems such as <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/clean-messy-html-codes-html-washer\/\" rel=\"noopener\">messy<\/a> or overly complex code, programs that break with one adjustment, and variables that don\u2019t make sense. Sticking to them will also enable you to collaborate more successfully by ensuring fellow programmers can understand your code.<\/p>\n<p>Whether you\u2019re creating a basic program or an enterprise-grade application, it\u2019s worth familiarizing yourself with these 10 principles.<\/p>\n<h2>Ten Programming Principles to follow:<\/h2>\n<h3>1. KISS (Keep It Simple, Stupid!)<\/h3>\n<p>Keeping your code simple and clean is one of the most important programming principles. enterprisSome developers like to show off by writing overly lengthy or advanced code, but even though it may look clever, the code may not be particularly clear.<\/p>\n<p>You should always strive to make your code easy to understand \u2013 if you can write a script in one line, then do that! You could break a complex problem into smaller chunks or remove some unnecessary code. The aim is to reduce complexity and solve problems, not to impress people.<\/p>\n<p>Using clear variable names is another way to keep it simple. Remember to take advantage of coding libraries and existing tools.<\/p>\n<h3>2. Don\u2019t Repeat Yourself (DRY)<\/h3>\n<p>Programmers love an acronym, right? This one\u2019s simple to remember \u2013 it\u2019s telling you not to repeat code. Repetition is a common mistake because if you duplicate data, logic, or function, your code will be lengthy and it\u2019ll take more time to maintain, debug, or modify it.<\/p>\n<p>Repeating yourself includes copying and pasting code within your program. Instead of duplicating lines, it\u2019s better to find an algorithm that uses a loop instead since it\u2019s much easier to debug one loop that handles 20 repetitions than 20 blocks of code that each handles one repetition.<\/p>\n<p>The opposite of the DRY principle is WET (of course), which stands for Write Everything Twice or Waste Everyone\u2019s Time. Neither of which is a good idea.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/basic-programming-principals\/dry-vs-wet-code.jpg\" alt=\"dry vs wet code\" width=\"800\" height=\"686\"><\/figure>\n<p><small>Image source: <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.techtarget.com\/searchsoftwarequality\/answer\/Which-programming-practices-alleviate-code-redundancy\">TechTarget<\/a><\/small><\/p>\n<h3>3. You Aren\u2019t Gonna Need It (YAGNI)<\/h3>\n<p>On a similar theme, you shouldn\u2019t be writing code purely on the off-chance that you might need it in the future. In other words, the YAGNI principle tells you to write code only for the current situation rather than trying to solve a problem that doesn\u2019t exist.<\/p>\n<p>Features and functionality should only be added when required. Otherwise, your software or program will become bigger and more complex than it needs to be. YAGNI comes from the software development methodology of Extreme Programming (XP), which is all about reducing inefficiency.<\/p>\n<p>Programmers sometimes violate this principle while trying to adhere to DRY coding practices, so keep both in mind.<\/p>\n<h3>4. Document Your Code<\/h3>\n<p>Okay, so you\u2019ve written your code and understand it (I hope!). But just because it makes sense to you doesn\u2019t mean it\u2019ll be clear to somebody else. You can help your fellow developers by <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/why-documentation-essential\/\" rel=\"noopener\">documenting your code<\/a> with comments and improving the naming of your variables and functions.<\/p>\n<p>For example, if you were designing a call-routing algorithm to be used in VoIP call center solutions, you could leave comments to explain the various functions and make them easier to understand for other developers or testers.<\/p>\n<p>All programming languages allow you to attach comments to your code, so you should make it a habit to do so. Yes, it\u2019s a little extra work, but it\u2019s important when collaborating with others. Plus, if you come back to modify the code in a few months, you\u2019ll be glad you did it!<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/basic-programming-principals\/writing-better-comments.jpg\" alt=\"writing better comments\" width=\"800\" height=\"686\"><\/figure>\n<p><small>Image source: <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.shecancode.io\/blog\/5-ways-to-write-better-comments\">SheCanCode<\/a><\/small><\/p>\n<h3>5. Composition Over Inheritance<\/h3>\n<p>If you are reusing code that you\u2019ve already written, there are two ways of doing this: inheritance and composition. Most programmers favor composition (although inheritance does have its advantages, so don\u2019t disregard it completely).<\/p>\n<p>The composition over inheritance principle is especially useful if you\u2019re using object-oriented programming or OOP (which actually has its own set of principles). It states that objects with complex behaviors should contain instances of objects with individual behaviors \u2013 they should not inherit a class and add new behaviors.<\/p>\n<p>With inheritance, class frameworks quickly become unwieldy, leading to myriad classes that may or may not meet your needs. Class hierarchies are hard to change once they\u2019ve been deployed, as you can\u2019t change a superclass without risking breaking a user\u2019s subclass. And there\u2019s less flexibility for defining special-case behaviors.<\/p>\n<p>Composition programming is cleaner to write and easier to maintain, providing a simpler, more testable codebase. It allows for flexibility-defining behaviors \u2013 you can design classes for easy additions or changes and delay the creation of components until they are needed.<\/p>\n<h3>6. Open\/Closed<\/h3>\n<p>If you\u2019re releasing a library or framework that others will use, Open\/Closed is an important principle. It means that software artifacts such as classes and modules are open to extension but closed to modification. This makes the code more stable and easier to maintain.<\/p>\n<p>Let\u2019s say you\u2019re asked to write code for an e-signature software company\u2019s agency agreement template>. You release a framework version for coders to modify directly and integrate your released code. But if you release a major update down the line, the code will break. It\u2019s better to release code that encourages extension while preventing direct modification, which minimizes the risk of introducing new bugs.<\/p>\n<h3>7. Single Responsibility<\/h3>\n<p>This principle states that every class or module in a program should only provide one specific functionality, and there should not be more than one reason for a class to change. The goal is to avoid multiplying side effects or responsibilities in a single method or class.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/basic-programming-principals\/single-responsibility.jpg\" alt=\"single responsibility\" width=\"800\" height=\"569\"><\/figure>\n<p><small>Image source: <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/irmakesin.medium.com\/solid-design-principles-explained-the-single-responsibility-principle-1cb999aa0aa6\">Medium<\/a><\/small><\/p>\n<p>Classes get more complicated if you add too many responsibilities, and it\u2019s more difficult to create additional functionality for a specific module. It\u2019s better to break them up into smaller classes and modules, making it easier to isolate a certain module for troubleshooting.<\/p>\n<p>Single Responsibility and Open\/Closed are both part of the SOLID principles laid out by Robert C Martin (the others being Liskov Substitution, Interface Segregation, and Dependency Inversion).<\/p>\n<h3>8. SoC \u2013 Separation of Concerns<\/h3>\n<p>This <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/developer-habits\/\" rel=\"noopener\">programming principle<\/a> is an abstract version of single responsibility. SoC states that a program should be designed with different containers, which should not have access to each other. Each piece of code is completely independent.<\/p>\n<p>It\u2019s a way of separating a complicated application into different sections or domains, each of which does a specific job or addresses a different concern. This makes it easier to maintain, update, reuse, and debug the code.<\/p>\n<p>A well-known example is the model-view-controller (MVC) design, currently used in popular web frameworks. A program is divided into three distinct sections \u2013 data (model), logic (controller), and what end-user sees (view) \u2013 and each section is handled independently.<\/p>\n<h3>9. Minimize coupling<\/h3>\n<p>Code coupling is when two modules or two layers have a degree of interdependence, such as sharing a code or having access to the same data. This can create problems, including code that is hard to follow and maintain.<\/p>\n<p>For example, if a developer couples their API endpoints with a specific view on a frontend application, such as a multi-line phone system, the endpoint cannot be reused for a different view, such as a mobile application. (You may be wondering: what is a multi-line phone system>?)<\/p>\n<p>Programmers need to understand how a code is coupled to minimize coupling, which involves understanding the responsibilities of each layer. Single responsibility also reduces the coupling between the individual components of the software and code.<\/p>\n<figure><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/assets.hongkiat.com\/uploads\/basic-programming-principals\/code-coupling.jpg\" alt=\"code coupling\" width=\"800\" height=\"400\"><\/figure>\n<p><small>Image source: <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/livebook.manning.com\/book\/code-like-a-pro\/chapter-10\/10\">Manning<\/a><\/small><\/p>\n<h3>10. Refactor<\/h3>\n<p>Codebases are always evolving, so there will be times when you need to revisit, rewrite, or redesign entire chunks of code. Instead of seeing this as a failure of your first attempt, think of it as a learning opportunity.<\/p>\n<p>Refactoring code means reviewing it and looking for ways to optimize it, making it more efficient while keeping the results exactly the same. However, you should avoid premature optimization. Don\u2019t optimize your algorithm in the early stage of development because you can\u2019t predict bottlenecks, and the requirements may change.<\/p>\n<h2>Final thoughts<\/h2>\n<p>If we were to distill this list down to one key principle, it would be this: make your code easy to understand and maintain. Several of the programming principles in our list have this purpose in mind, from KISS and DRY to single responsibility and documenting your code.<\/p>\n<p>If you follow these principles, you\u2019ll be able to create simple code that does what it\u2019s supposed to and is understandable by others. And you\u2019ll know the right time to <a target=\"_blank\" href=\"https:\/\/www.hongkiat.com\/blog\/code-optimisation-why-you-need-it\/\" rel=\"noopener\">optimize<\/a> it. One final tip \u2013 keep learning to keep improving.<\/p>","protected":false},"excerpt":{"rendered":"<p>As a programmer, your role is to write code that works properly and provides the desired output. However, the code must also be easy to understand, maintain, and extend. To meet this challenge, you need to combine the key concepts of programming with the principles of good coding. In this post, I\u2019ll share my top&hellip;<\/p>\n","protected":false},"author":608,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[352],"tags":[3231],"topic":[],"class_list":["entry-content","is-maxi"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v22.8 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>10 Essential Programming Principles for Successful Coders - Hongkiat<\/title>\n<meta name=\"description\" content=\"Make sure you write code that&#039;s easy to understand, reuse, and maintain, by following these 10 basic programming principles.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"10 Essential Programming Principles for Successful Coders\" \/>\n<meta property=\"og:description\" content=\"As a programmer, your role is to write code that works properly and provides the desired output. However, the code must also be easy to understand,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/\" \/>\n<meta property=\"og:site_name\" content=\"Hongkiat\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/hongkiatcom\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-05T13:01:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-06T11:19:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/assets.hongkiat.com\/uploads\/basic-programming-principals\/1-programming-principles.jpg\" \/>\n<meta name=\"author\" content=\"Richard Conn\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:site\" content=\"@hongkiat\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Richard Conn\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/basic-programming-principals\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/basic-programming-principals\\\/\"},\"author\":{\"name\":\"Richard Conn\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/22cf58f3fc184c6cd3cc9a0ef78c3cf6\"},\"headline\":\"10 Essential Programming Principles for Successful Coders\",\"datePublished\":\"2022-09-05T13:01:38+00:00\",\"dateModified\":\"2023-04-06T11:19:50+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/basic-programming-principals\\\/\"},\"wordCount\":1536,\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/basic-programming-principals\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/basic-programming-principals\\\/1-programming-principles.jpg\",\"keywords\":[\"Programming Language\"],\"articleSection\":[\"Web Design\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/basic-programming-principals\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/basic-programming-principals\\\/\",\"name\":\"10 Essential Programming Principles for Successful Coders - Hongkiat\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/basic-programming-principals\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/basic-programming-principals\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/basic-programming-principals\\\/1-programming-principles.jpg\",\"datePublished\":\"2022-09-05T13:01:38+00:00\",\"dateModified\":\"2023-04-06T11:19:50+00:00\",\"description\":\"Make sure you write code that's easy to understand, reuse, and maintain, by following these 10 basic programming principles.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/basic-programming-principals\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/basic-programming-principals\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/basic-programming-principals\\\/#primaryimage\",\"url\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/basic-programming-principals\\\/1-programming-principles.jpg\",\"contentUrl\":\"https:\\\/\\\/assets.hongkiat.com\\\/uploads\\\/basic-programming-principals\\\/1-programming-principles.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/basic-programming-principals\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"10 Essential Programming Principles for Successful Coders\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"name\":\"Hongkiat\",\"description\":\"Tech and Design Tips\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#organization\",\"name\":\"Hongkiat.com\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"contentUrl\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/wp-content\\\/uploads\\\/hkdc-logo-rect-yoast.jpg\",\"width\":1200,\"height\":799,\"caption\":\"Hongkiat.com\"},\"image\":{\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/hongkiatcom\",\"https:\\\/\\\/x.com\\\/hongkiat\",\"https:\\\/\\\/www.pinterest.com\\\/hongkiat\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/#\\\/schema\\\/person\\\/22cf58f3fc184c6cd3cc9a0ef78c3cf6\",\"name\":\"Richard Conn\",\"description\":\"Richard Conn is the Senior Director for Demand Generation at 8x8, a leading communication platform with an integrated contact center, hosted PBX, voice, video, and chat functionality. Richard is an analytical &amp; results-driven digital marketing leader with a track record of achieving major ROI improvements in fast-paced, competitive B2B environments. Richard has also written for other domains, such as Infobase and ShowMyPC.\",\"sameAs\":[\"https:\\\/\\\/www.8x8.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/mbaconn\\\/\"],\"url\":\"https:\\\/\\\/www.hongkiat.com\\\/blog\\\/author\\\/richardconn\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"10 Essential Programming Principles for Successful Coders - Hongkiat","description":"Make sure you write code that's easy to understand, reuse, and maintain, by following these 10 basic programming principles.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/","og_locale":"en_US","og_type":"article","og_title":"10 Essential Programming Principles for Successful Coders","og_description":"As a programmer, your role is to write code that works properly and provides the desired output. However, the code must also be easy to understand,","og_url":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/","og_site_name":"Hongkiat","article_publisher":"https:\/\/www.facebook.com\/hongkiatcom","article_published_time":"2022-09-05T13:01:38+00:00","article_modified_time":"2023-04-06T11:19:50+00:00","og_image":[{"url":"https:\/\/assets.hongkiat.com\/uploads\/basic-programming-principals\/1-programming-principles.jpg","type":"","width":"","height":""}],"author":"Richard Conn","twitter_card":"summary_large_image","twitter_creator":"@hongkiat","twitter_site":"@hongkiat","twitter_misc":{"Written by":"Richard Conn","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/#article","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/"},"author":{"name":"Richard Conn","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/22cf58f3fc184c6cd3cc9a0ef78c3cf6"},"headline":"10 Essential Programming Principles for Successful Coders","datePublished":"2022-09-05T13:01:38+00:00","dateModified":"2023-04-06T11:19:50+00:00","mainEntityOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/"},"wordCount":1536,"publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/basic-programming-principals\/1-programming-principles.jpg","keywords":["Programming Language"],"articleSection":["Web Design"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/","url":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/","name":"10 Essential Programming Principles for Successful Coders - Hongkiat","isPartOf":{"@id":"https:\/\/www.hongkiat.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/#primaryimage"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/#primaryimage"},"thumbnailUrl":"https:\/\/assets.hongkiat.com\/uploads\/basic-programming-principals\/1-programming-principles.jpg","datePublished":"2022-09-05T13:01:38+00:00","dateModified":"2023-04-06T11:19:50+00:00","description":"Make sure you write code that's easy to understand, reuse, and maintain, by following these 10 basic programming principles.","breadcrumb":{"@id":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/#primaryimage","url":"https:\/\/assets.hongkiat.com\/uploads\/basic-programming-principals\/1-programming-principles.jpg","contentUrl":"https:\/\/assets.hongkiat.com\/uploads\/basic-programming-principals\/1-programming-principles.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.hongkiat.com\/blog\/basic-programming-principals\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hongkiat.com\/blog\/"},{"@type":"ListItem","position":2,"name":"10 Essential Programming Principles for Successful Coders"}]},{"@type":"WebSite","@id":"https:\/\/www.hongkiat.com\/blog\/#website","url":"https:\/\/www.hongkiat.com\/blog\/","name":"Hongkiat","description":"Tech and Design Tips","publisher":{"@id":"https:\/\/www.hongkiat.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hongkiat.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.hongkiat.com\/blog\/#organization","name":"Hongkiat.com","url":"https:\/\/www.hongkiat.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","contentUrl":"https:\/\/www.hongkiat.com\/blog\/wp-content\/uploads\/hkdc-logo-rect-yoast.jpg","width":1200,"height":799,"caption":"Hongkiat.com"},"image":{"@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/hongkiatcom","https:\/\/x.com\/hongkiat","https:\/\/www.pinterest.com\/hongkiat\/"]},{"@type":"Person","@id":"https:\/\/www.hongkiat.com\/blog\/#\/schema\/person\/22cf58f3fc184c6cd3cc9a0ef78c3cf6","name":"Richard Conn","description":"Richard Conn is the Senior Director for Demand Generation at 8x8, a leading communication platform with an integrated contact center, hosted PBX, voice, video, and chat functionality. Richard is an analytical &amp; results-driven digital marketing leader with a track record of achieving major ROI improvements in fast-paced, competitive B2B environments. Richard has also written for other domains, such as Infobase and ShowMyPC.","sameAs":["https:\/\/www.8x8.com\/","https:\/\/www.linkedin.com\/in\/mbaconn\/"],"url":"https:\/\/www.hongkiat.com\/blog\/author\/richardconn\/"}]}},"jetpack_featured_media_url":"https:\/\/","jetpack_shortlink":"https:\/\/wp.me\/p4uxU-gan","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/62147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/users\/608"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/comments?post=62147"}],"version-history":[{"count":3,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/62147\/revisions"}],"predecessor-version":[{"id":66003,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/posts\/62147\/revisions\/66003"}],"wp:attachment":[{"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/media?parent=62147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/categories?post=62147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/tags?post=62147"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hongkiat.com\/blog\/wp-json\/wp\/v2\/topic?post=62147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}