{"id":292,"date":"2009-03-14T14:46:49","date_gmt":"2009-03-14T22:46:49","guid":{"rendered":"http:\/\/jaredrobinson.com\/blog\/?p=292"},"modified":"2009-03-14T14:46:49","modified_gmt":"2009-03-14T22:46:49","slug":"mwrc-jim-weirich-the-building-blocks-of-modularity","status":"publish","type":"post","link":"https:\/\/jaredrobinson.com\/blog\/mwrc-jim-weirich-the-building-blocks-of-modularity\/","title":{"rendered":"mwrc: Jim Weirich: The Building Blocks of Modularity"},"content":{"rendered":"<p>Jim Weirich: The Building Blocks of Modularity<\/p>\n<p>Interview questions:<\/p>\n<p>&#8211; What tech books have you read lately? To guage their interest in continued<br \/>\nlearning.<br \/>\n&#8211; How do you recognize a good design?<\/p>\n<p>Someone said they&#8217;d come and listen to him talk about oatmeal. So guess what?<br \/>\nHe&#8217;s going to talk about oatmeal.<\/p>\n<p>At one time, the thought was that matter was like a bowl of oatmeal, that it<br \/>\nwas fairly consistent all the way through with maybe a few lumps. Someone shot<br \/>\na particle emitter at a thin strip of gold, and found out that that wasn&#8217;t<br \/>\ntrue. Matter is like a bowl of oatmeal with rasins and apples in it. That&#8217;s<br \/>\nwhen scientists started developing their atomic theory. Several forces in the<br \/>\nuniverse: Gravity, Electromagnetism, Strong Nuclear, Weak Nuclear. Why should<br \/>\nthere be so many different forces? They tried to come up with Grand Unified<br \/>\nField Theory, and they&#8217;re still working on it.<\/p>\n<p>In computers, we have some principles we use to write software:<\/p>\n<p>&#8211; SOLID<br \/>\n&#8211; Law of Demeter<br \/>\n&#8211; DRY<br \/>\n&#8211; Small Methods<br \/>\n&#8211; Design by Contract<br \/>\n&#8211; etc.<\/p>\n<p>Is there a grand unified theory of software development? That&#8217;s what he wants<br \/>\nto think about and discuss today.<\/p>\n<p>Everyone should have a mentor when they get started in their careers. He did.<\/p>\n<p>Coupling &#038; Cohesion. The connection between modules, and how well a module<br \/>\nitself fits together. Less coupling is good. Too much coupling is bad. Seven<br \/>\ndifferent types of coupling, according to Meyers:<\/p>\n<p>&#8211; None<br \/>\n&#8211; Data<br \/>\n&#8211; Stamp<br \/>\n&#8211; Control &#8211; when you have do describe the func with the word &#8220;or&#8221; or &#8220;otherwise&#8221;<br \/>\n&#8211; External<br \/>\n&#8211; Common<br \/>\n&#8211; Content<\/p>\n<p>Which boil down to local data and global data, and whether it&#8217;s simple or<br \/>\nstructured data.<\/p>\n<p>A simpler way to thing about coupling: Connascence &#8211; things that are born together and change together. If two pieces of software are tied together so that changing one requires changing the other. Rule: As the distance between software increases, the conanascence between the two should be weaker.<\/p>\n<p>Connascence of Position (with parameters to methods) versus Connascence of Name<br \/>\n(using a hash to pass parameters). The latter is better when there&#8217;s a large<br \/>\nnumber of parameters.<\/p>\n<p>Connascence of meaning. I.E. Don&#8217;t use magic numbers in your code.<\/p>\n<p>Contra-nascence &#8211; when it doesn&#8217;t matter what magic number you assign to two<br \/>\ndifferent constants, as long as they aren&#8217;t the same.<\/p>\n<p>Connascence of Algorithm. If you change a checksum checking func, and you have<br \/>\nto also change the corresponding function that generates the checksum.<\/p>\n<p>Connascence of timing, of value, etc. This entire talk is on github: git:\/\/github.com\/jimweirich\/presentation_connascence.git<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Jim Weirich: The Building Blocks of Modularity Interview questions: &#8211; What tech books have you read lately? To guage their interest in continued learning. &#8211; How do you recognize a good design? Someone said they&#8217;d come and listen to him talk about oatmeal. So guess what? He&#8217;s going to talk about oatmeal. At one time, &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/jaredrobinson.com\/blog\/mwrc-jim-weirich-the-building-blocks-of-modularity\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;mwrc: Jim Weirich: The Building Blocks of Modularity&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[20,21],"class_list":["post-292","post","type-post","status-publish","format-standard","hentry","category-programming","tag-mtnwestrubyconf","tag-mwrc"],"_links":{"self":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/292","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/comments?post=292"}],"version-history":[{"count":1,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/292\/revisions"}],"predecessor-version":[{"id":293,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/posts\/292\/revisions\/293"}],"wp:attachment":[{"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/media?parent=292"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/categories?post=292"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jaredrobinson.com\/blog\/wp-json\/wp\/v2\/tags?post=292"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}