{"id":3363,"date":"2020-11-13T00:00:00","date_gmt":"2020-11-13T00:00:00","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/how-to-write-a-good-and-quality-code\/"},"modified":"2024-06-19T08:37:58","modified_gmt":"2024-06-19T08:37:58","slug":"jak-napsat-dobry-a-kvalitni-kod","status":"publish","type":"post","link":"https:\/\/thecodest.co\/cs\/blog\/how-to-write-a-good-and-quality-code\/","title":{"rendered":"Jak napsat dobr\u00fd a kvalitn\u00ed k\u00f3d?"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Build solid, not stupid code<\/strong><\/h2>\n\n\n\n<p>Let\u2019s start by introducing the most elementary rules that are called SOLID. It is a term describing a collection of design principles for good <a href=\"https:\/\/thecodest.co\/cs\/dictionary\/what-is-code-refactoring\/\">code<\/a> that was invented by Robert C. Martin and how it goes:<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>S means Single Responsibility Principle<\/strong><\/h2>\n\n\n\n<p>It states that a class should have one and only one reason to change. In other words, a class should have only one job to do, so we should avoid writing big classes with many responsibilities. If our class has to do a lot of things then each of them should be delegated into separate ones.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class Notification\n  def initialize(params)\n    @params = params\n  end\n\n  def call\n    EmailSender.new(message).call\n  end\n\n  private\n\n  def message\n    # some implementation\n  end\nend<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">O means Open\/Closed Principle<\/h2>\n\n\n\n<p>It states that you should be able to extend a classes behavior, without modifying it. In other words, it should be easy to extend a class without making any modifications to it. We can achieve this e.g by using strategy pattern or decorators.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class Notification\n  def initialize(params, sender)\n    @params = params\n    @sender = sender\n  end\n\n  def call\n    sender.call message\n  end\n\n  private\n\n  def message\n    # some implementation\n  end\nend\n\nclass EmailSender\n  def call(message)\n    # some implementation\n  end\nend\n\nclass SmsSender\n  def call(message)\n    # some implementation\n  end\nend<\/code><\/pre>\n\n\n\n<p>With this design, it is possible to add new senders without changing any code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">L means Liskov Substitution Principle<\/h2>\n\n\n\n<p>It states that derived classes must be substitutable for their base classes. In other words, usage of classes which come from the same ancestor should be easy to replace by other descendant.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">class Logger {\n  info (message) {\n    console.info(this._prefixFor('info') + message)\n  }\n\n  error (message, err) {\n    console.error(this._prefixFor('error') + message)\n    if (err) {\n      console.error(err)\n    }\n  }\n\n  _prefixFor (type) {\n    \/\/ some implementation\n  }\n}\n\nclass ScepticLogger extends Logger {\n  info (message) {\n    super.info(message)\n    console.info(this._prefixFor('info') + 'And that is all I had to say.')\n  }\n\n  error (message, err) {\n    super.error(message, err)\n    console.error(this._prefixFor('error') + 'Big deal!')\n  }\n}<\/code><\/pre>\n\n\n\n<p>We can easily replace the name of the class, because both has exactly the same usage interface.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>I mean Interface Segregation Principle<\/strong><\/h2>\n\n\n\n<p>It states that you should make fine grained interfaces that are client specific. What is an interface? It\u2019s a provided way of usage of some part of the code. So a violation of this rule could be e.g a class with too many methods as well as a method with too many argument options. A good example to visualize this principle is a repository pattern, not only because we often put a lot of methods into a single class but also those methods are exposed to a risk to accept too many arguments.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"># not the best example this time\nclass NotificationRepository\n  def find_all_by_ids(ids:, info:)\n    notifications = Notification.where(id: ids)\n    info ? notifications.where(type: :info) : notifications\n  end\nend\n\n# and a better one\nclass NotificationRepository\n  def find_all_by_ids(ids:)\n    Notification.where(id: ids)\n  end\n\n  def find_all_by_ids_info(ids:)\n    find_all_by_ids(ids).where(type: :info)\n  end\nend<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">D means Dependency Inversion Principle<\/h2>\n\n\n\n<p>It states that you should depend on abstractions, not on concretions. In other words, a class that uses another one should not depend on its implementation details, all what is important is the user interface.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">class Notification\n  def initialize(params, sender)\n    @params = params\n    @sender = sender\n  end\n\n  def call\n    sender.call message\n  end\n\n  private\n\n  def message\n    # some implementation\n  end\nend<\/code><\/pre>\n\n\n\n<p>All we need to know about sender object is that it exposes `call` method which expects the message as an argument.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Not the best code ever<\/h2>\n\n\n\n<p>It is also very important to know the things which should be strictly avoided while writing code, so here goes another collection with STUPID principles which makes code not maintainable, hard for test, and reuse.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">S means Singleton<\/h2>\n\n\n\n<p>Singletons are often considered as anti-patterns and generally should be avoided. But the main problem with this pattern is that it is a kind of excuse for global variables\/methods and could be quickly overused by developers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">T means Tight Coupling<\/h2>\n\n\n\n<p>It is preserved when a change in one module requires also changes in other parts of the application.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">U means Untestability<\/h2>\n\n\n\n<p>If your code is good, then writing tests should sound like fun, not a nightmare.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>P means Premature Optimization<\/strong><\/h2>\n\n\n\n<p>The word premature is the key here, if you don\u2019t need it now then it\u2019s a waste of time. It is better to focus on a good, clean code than in some micro-optimizations &#8211; which generally causes more complex code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>I mean Indescriptive Naming<\/strong><\/h2>\n\n\n\n<p>It is the hardest thing in writing good code, but remember that it\u2019s is not only for the rest of your <a href=\"https:\/\/thecodest.co\/cs\/dictionary\/how-to-lead-software-development-team\/\">team<\/a> but also for future you, so treat you right \ud83d\ude42 It is better to write a long name for a method but it says everything, than short and enigmatic one.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">D means Duplication<\/h2>\n\n\n\n<p>The main reason for duplication in code is following the tight coupling principle. If your code is tightly coupled, you just can\u2019t reuse it and duplicated code appears, so follow DRY and don\u2019t repeat yourself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">It\u2019s not really important right now<\/h2>\n\n\n\n<p>I would like to also mention two very important things which are often left out. You should have heard about the first one &#8211; it\u2019s YAGNI which means: you aren\u2019t gonna need it. From time to time I observe this problem while doing code review or even writing my own code, but we should switch our thinking about implementing a feature. We should write exactly the code that we need at this very moment, not more or less. We should have in mind that everything changes very quickly (especially application requirements) so there is no point to think that something someday will come in handy. Don\u2019t waste your time.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">I don\u2019t understand<\/h2>\n\n\n\n<p>And the last thing, not really obvious I suppose, and may be quite controversial to some, it\u2019s a descriptive code. I don\u2019t mean by that only using the right names for classes, variables or methods. It is really, really good when the whole code is readable from the first sight. What is the purpose of the very short code whereas it is as enigmatic as it can be, and no one knows what it does, except the person who wrote it? In my opinion, it is better to write some chars<em>condition statements<\/em>something else more than one word and then yesterday sitting and wondering: wait what is the result, how it happened, and so on.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript\">const params = [\n  {\n    movies: [\n      { title: 'The Shawshank Redemption' },\n      { title: 'One Flew Over the Cuckoo's Nest' }\n    ]\n  },\n  {\n    movies: [\n      { title: 'Saving Private Ryan' },\n      { title: 'Pulp Fiction' },\n      { title: 'The Shawshank Redemption' },\n    ]\n  }\n]\n\n\/\/ first proposition\nfunction uniqueMovieTitlesFrom (params) {\n  const titles = params\n    .map(param =&gt; param.movies)\n    .reduce((prev, nex) =&gt; prev.concat(next))\n    .map(movie =&gt; movie.title)\n\n  return [...new Set(titles)]\n}\n\n\/\/ second proposition\nfunction uniqueMovieTitlesFrom (params) {\n  const titles = {}\n  params.forEach(param =&gt; {\n    param.movies.forEach(movie =&gt; titles[movie.title] = true)\n  })\n\n  return Object.keys(titles)\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>To sum up<\/strong><\/h2>\n\n\n\n<p>As you can see, there are a lot of rules to remember, but as I mentioned at the beginning writing a nice code is a matter of time. If you start thinking about one improvement to your coding habits then you will see that another good rule will follow, because all good things arise from themselves just like the bad ones.<\/p>\n\n\n\n<p><strong>Read more:<\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/thecodest.co\/blog\/ruby-on-jets-ruby-aws-lambda\/\">What is Ruby on Jets and how to build an app using it?<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/thecodest.co\/blog\/vuelendar-a-new-codests-project-based-on-vue-js\/\">Vuelendar. A new Codest\u2019s project based on Vue.js<\/a><\/strong><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/thecodest.co\/blog\/codests-weekly-report-of-best-tech-articles-building-software-for-50m-concurrent-sockets-10\/\">Codest\u2019s weekly report of best tech articles. Building software for 50M concurrent sockets (10)<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Napsat p\u011bkn\u00fd, dob\u0159e navr\u017een\u00fd a dob\u0159e vypadaj\u00edc\u00ed k\u00f3d nen\u00ed tak t\u011b\u017ek\u00e9, jak se zd\u00e1. Vy\u017eaduje to trochu \u00fasil\u00ed, abyste se sezn\u00e1mili s hlavn\u00edmi pravidly a prost\u011b je v k\u00f3du pou\u017eili. A nemus\u00ed to b\u00fdt jako v\u0161echno najednou, ale jak se budete c\u00edtit pohodln\u011b s jednou v\u011bc\u00ed, zkuste p\u0159em\u00fd\u0161let o dal\u0161\u00ed atd.<\/p>","protected":false},"author":2,"featured_media":3364,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3363","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to write a good and quality code? - The Codest<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/cs\/blog\/jak-napsat-dobry-a-kvalitni-kod\/\" \/>\n<meta property=\"og:locale\" content=\"cs_CZ\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to write a good and quality code?\" \/>\n<meta property=\"og:description\" content=\"Writing a nice, well designed and good looking code is not as hard as it seems to be. It requires a little effort to get to know the main rules and just use them in your code. And it doesn\u2019t have to be like everything at once, but as you feel comfortable with one thing try to think about another, and so on.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/cs\/blog\/jak-napsat-dobry-a-kvalitni-kod\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-13T00:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-06-19T08:37:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/how-to-write-good-code.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"How to write a good and quality code?\",\"datePublished\":\"2020-11-13T00:00:00+00:00\",\"dateModified\":\"2024-06-19T08:37:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/\"},\"wordCount\":993,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/how-to-write-good-code.png\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"cs-CZ\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/\",\"name\":\"How to write a good and quality code? - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/how-to-write-good-code.png\",\"datePublished\":\"2020-11-13T00:00:00+00:00\",\"dateModified\":\"2024-06-19T08:37:58+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/#breadcrumb\"},\"inLanguage\":\"cs-CZ\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"cs-CZ\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/how-to-write-good-code.png\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/how-to-write-good-code.png\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/how-to-write-a-good-and-quality-code\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to write a good and quality code?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"cs-CZ\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"cs-CZ\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"cs-CZ\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/cs\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Jak napsat dobr\u00fd a kvalitn\u00ed k\u00f3d? - The Codest","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:\/\/thecodest.co\/cs\/blog\/jak-napsat-dobry-a-kvalitni-kod\/","og_locale":"cs_CZ","og_type":"article","og_title":"How to write a good and quality code?","og_description":"Writing a nice, well designed and good looking code is not as hard as it seems to be. It requires a little effort to get to know the main rules and just use them in your code. And it doesn\u2019t have to be like everything at once, but as you feel comfortable with one thing try to think about another, and so on.","og_url":"https:\/\/thecodest.co\/cs\/blog\/jak-napsat-dobry-a-kvalitni-kod\/","og_site_name":"The Codest","article_published_time":"2020-11-13T00:00:00+00:00","article_modified_time":"2024-06-19T08:37:58+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/how-to-write-good-code.png","type":"image\/png"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"How to write a good and quality code?","datePublished":"2020-11-13T00:00:00+00:00","dateModified":"2024-06-19T08:37:58+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/"},"wordCount":993,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/how-to-write-good-code.png","articleSection":["Software Development"],"inLanguage":"cs-CZ","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/","url":"https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/","name":"Jak napsat dobr\u00fd a kvalitn\u00ed k\u00f3d? - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/how-to-write-good-code.png","datePublished":"2020-11-13T00:00:00+00:00","dateModified":"2024-06-19T08:37:58+00:00","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/#breadcrumb"},"inLanguage":"cs-CZ","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/"]}]},{"@type":"ImageObject","inLanguage":"cs-CZ","@id":"https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/how-to-write-good-code.png","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/how-to-write-good-code.png","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/how-to-write-a-good-and-quality-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"How to write a good and quality code?"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"The Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"cs-CZ"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"cs-CZ","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"cs-CZ","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/cs\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/posts\/3363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/comments?post=3363"}],"version-history":[{"count":12,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/posts\/3363\/revisions"}],"predecessor-version":[{"id":7881,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/posts\/3363\/revisions\/7881"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/media\/3364"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/media?parent=3363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/categories?post=3363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/cs\/wp-json\/wp\/v2\/tags?post=3363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}