{"componentChunkName":"component---node-modules-gatsby-theme-medium-to-own-blog-src-templates-blog-post-js","path":"/the-way-we-write-software-these-days/","result":{"data":{"site":{"siteMetadata":{"siteUrl":"https://javame.netlify.app","githubUrl":"https://github.com/aterreno/blog"}},"mdx":{"fields":{"slug":"/the-way-we-write-software-these-days/"},"excerpt":"In  my previous blog  post I did write about most of the conversations and feedbacks I’ve got after the Italian Agile Day.  In this one I…","timeToRead":2,"frontmatter":{"title":"The way we write software these days","description":"","categories":[],"date":"November 28, 2010","canonical_link":"https://javame.netlify.app//the-way-we-write-software-these-days-ea1820f3345f"},"body":"function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"The way we write software these days\",\n  \"description\": \"\",\n  \"date\": \"2010-11-28T00:00:00.000Z\",\n  \"categories\": [],\n  \"published\": true,\n  \"canonical_link\": \"https://javame.netlify.app//the-way-we-write-software-these-days-ea1820f3345f\",\n  \"redirect_from\": [\"/the-way-we-write-software-these-days-ea1820f3345f\"]\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, [\"components\"]);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"In \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"http://www.the-arm.com/2010/11/agiler-at-forward-and-successful-at-the-iad10/\",\n    \"target\": \"_blank\",\n    \"rel\": \"nofollow noopener noreferrer\"\n  }), \"my previous blog\"), \" post I did write about most of the conversations and feedbacks I\\u2019ve got after the Italian Agile Day.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"In this one I want to address the software design.\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Rewrite preferred over Refactoring\")), mdx(\"p\", null, \"As I said during the speech we don\\u2019t do that much refactoring anymore and we rather throw away the code and rewrite it from scratch.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"http://twitter.com/paolopolce\",\n    \"target\": \"_blank\",\n    \"rel\": \"nofollow noopener noreferrer\"\n  }), \"Paolo Polce\"), \" said more or less something like this:\"), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, \"\\u201CYou guys are good and write good enough code already, that\\u2019s why you need less (or none) refactoring\\u201D\")), mdx(\"p\", null, \"It\\u2019s probably true, he gave me a good explanation, from a scale from zero to ten we probably write code that is already a six or a seven, so there\\u2019s little need for refactoring.\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"I\\u2019ve to say that we do refactor a bit, especially when a new feature comes in or when we re-open the code base after a week or more.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"The big difference is that if we don\\u2019t like it at all anymore, if there are some code smells, if the code is resistant to change we just rewrite it.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"Also, one type of refactoring we do often is to reduce the codebase size.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"I truly believe that the main goal of refactoring should be keep the codebase small.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"I had a chat with \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"http://michaeljon.es/\",\n    \"target\": \"_blank\",\n    \"rel\": \"nofollow noopener noreferrer\"\n  }), \"Mike\"), \" the other day and I found that he\\u2019s doing the same thing in his team, he keeps trying to keep a part of his code base under 200 lines, even if they are adding new features.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"I used to be obsessed in writing small classes and small methods. Let me tell you, that\\u2019s just nothing compared to writing small modular applications.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"Also, small classes and short methods too often imply huge codebases: it\\u2019s hard to understand the intent of a system when its intent is scattered through hundred of files.\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Bounded Contexts\")), mdx(\"p\", null, \"We do use bounded contexts and this helps to keep the applications simple, easy to change, to rewrite when needed.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"It does allow us to use the right tool for the job (picking up node.js or clojure or plain ruby) for the task.\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Aggregation\")), mdx(\"p\", null, \"Talking with ziobrando after the conference I\\u2019ve realized that we implement in most of the projects \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"http://domaindrivendesign.org/node/88\",\n    \"target\": \"_blank\",\n    \"rel\": \"nofollow noopener noreferrer\"\n  }), \"aggregates\"), \", as DDD defines them:\"), mdx(\"blockquote\", null, mdx(\"p\", {\n    parentName: \"blockquote\"\n  }, \"Cluster the Entities and Value Objects into Aggregates and define boundaries around each. Choose one Entity to be the root of each Aggregate, and control all access to the objects inside the boundary through the root. Allow external objects to hold references to root only. Transient references to the internal members can be passed out for use within a single operation only.\")), mdx(\"p\", null, \"Using noSQL helps a lot. But we implement it also with mysql.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"The key is to throw away all the frameworks and the patterns that dominated the market of the last 5/6 years: we don\\u2019t use Sequel Models, we don\\u2019t use (rails) Active Records. Most of the time we don\\u2019t even write domain objects, we just use hashes.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"In functional programming this is definitely easier to achieve, however, in ruby you can obtain pretty good results as well.\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"Blue Green Deployment\")), mdx(\"p\", null, \"The way we deploy our code to production has been well explained by Martin Fowler in \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"http://martinfowler.com/bliki/BlueGreenDeployment.html\",\n    \"target\": \"_blank\",\n    \"rel\": \"nofollow noopener noreferrer\"\n  }), \"this blog post\"), \".\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"I admit I didn\\u2019t know the name of this technique, I was just using it. Thanks again to \", mdx(\"a\", _extends({\n    parentName: \"p\"\n  }, {\n    \"href\": \"http://twitter.com/ziobrando\",\n    \"target\": \"_blank\",\n    \"rel\": \"nofollow noopener noreferrer\"\n  }), \"ziobrando\"), \" for suggesting me the name!\"), mdx(\"p\", null, mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"DSLs preferred over Patterns\"), mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"As I said in the presentation I can\\u2019t remember the last time in the last six month that I did introduce or use a pattern in my code.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"We do use tiny frameworks and DSLs rather than patterns. I think that this is the way to go.\\xA0\", mdx(\"br\", {\n    parentName: \"p\"\n  }), \"\\n\", \"Sinatra is a brilliant dsl for writing web applications, haml is a lovely dsl for writing html, sass is a brilliant dsl to write css, capistrano, rake\\u2026 It\\u2019s all about dsls.\"));\n}\n;\nMDXContent.isMDXComponent = true;"},"allWebMentionEntry":{"nodes":[]}},"pageContext":{"id":"c96deab0-a126-5d5e-883b-3e904dc356ac","previous":{"id":"5f204d91-e682-5575-95ba-80e55dccbdc8","fields":{"slug":"/agiler-at-forward-and-successful-at-the-iad10/","published":true},"frontmatter":{"redirect_from":["/agiler-at-forward-and-successful-at-the-iad10-d0a2899dad2c"],"redirect_to":null,"title":"Agiler at forward and successful at the #IAD10"}},"next":{"id":"ba60f54c-7047-5b8a-87f7-2580eed08e1f","fields":{"slug":"/the-way-we-design-our-software-these-days/","published":true},"frontmatter":{"redirect_from":["/the-way-we-design-our-software-these-days-d3aa6179c02e"],"redirect_to":null,"title":"The way we design our software these days"}},"permalink":"https://javame.netlify.app/the-way-we-write-software-these-days/","themeOptions":{"plugins":[],"config":{"title":"Antonio Terreno","description":"Antonio Terreno's blog archive","shortBio":"","bio":"Principal Consultant at Equal Experts","author":"Antonio Terreno","githubUrl":"https://github.com/aterreno/blog","siteUrl":"https://javame.netlify.app/","social":{"twitter":"javame","medium":"","facebook":"","github":"aterreno","linkedin":"antonioterreno","instagram":"tritonitri"},"goatCounterCode":null}}}},"staticQueryHashes":["4131332129","645483741"]}