{"id":645,"date":"2014-06-28T20:30:29","date_gmt":"2014-06-29T01:30:29","guid":{"rendered":"http:\/\/tiemensfamily.com\/TimOnCS\/?p=645"},"modified":"2014-06-28T20:30:29","modified_gmt":"2014-06-29T01:30:29","slug":"computer-science-hard-things","status":"publish","type":"post","link":"https:\/\/tiemensfamily.com\/timoncs\/2014\/06\/28\/computer-science-hard-things\/","title":{"rendered":"Computer Science Hard Things"},"content":{"rendered":"<p>There is a popular saying about Computer Science (see <a href=\"http:\/\/skeptics.stackexchange.com\/questions\/19836\/has-phil-karlton-ever-said-there-are-only-two-hard-things-in-computer-science\">here<\/a> and <a href=\"http:\/\/martinfowler.com\/bliki\/TwoHardThings.html\">here<\/a>):<\/p>\n<blockquote><p>There are only two hard things in Computer Science: cache invalidation and naming things.<\/p>\n<p>    &#8212; Phil Karlton<\/p><\/blockquote>\n<p>There is a funny variation that makes it &#8220;There are only two hard problems in Computer Science: cache invalidation, naming things, and off-by-one errors.&#8221;<\/p>\n<p>I propose there are actually three hard things:<\/p>\n<ol>\n<li>Naming things<\/li>\n<li>Cache invalidation<\/li>\n<li>Dependency resolution<\/li>\n<\/ol>\n<p>My criteria for being a &#8220;hard thing&#8221;:<\/p>\n<ol type=\"A\" style=\"list-style-type:upper-latin\">\n<li>Must be applicable to multiple scopes<\/li>\n<li>Must not be fully solved<\/li>\n<\/ol>\n<p>Examined this way, it is interesting to see why these are the three deserve to be on the list:<\/p>\n<ol>\n<li>Naming things\n<ol>\n<li>Applicable to every area in computer science &#8211; variable names, class names, machine names, network names, security policy names, <a href=\"http:\/\/en.wikipedia.org\/wiki\/Uniform_resource_identifier\">URIs<\/a>, etc.  It even applies to this list: think of the difference between naming the first item &#8220;cache invalidation&#8221; versus just &#8220;caching&#8221;.<\/li>\n<li>Not at all solved.  You can barely say we have good heuristics for this.<\/li>\n<\/ol>\n<\/li>\n<li>Cache invalidation\n<ol>\n<li>Applicable to multiple layers of computer hierarchy: CPU registers, L1, L2, L3, etc., disk caches, network resource caches, DNS caches, etc.<\/li>\n<li>Solved in the sense we know it is a balancing act between efficiency and correctness.  Not solved for the general case, however.  If there even is a &#8220;general case&#8221; at all.<\/li>\n<\/ol>\n<\/li>\n<li>Dependency resolution\n<ol>\n<li>Applicable to multiple domains: run-time (think Dependency Injection), build time (think Apache Ivy and Maven), hardware-software, distributed systems, and probably more<\/li>\n<li>Solved in the sense we know about <a href=\"http:\/\/en.wikipedia.org\/wiki\/Topological_sorting\">topological sorting<\/a> to help with transitive dependencies.<br \/>\n       For run-time, the entire sub-field of dependency injection has multiple solutions:  <a href=\"http:\/\/springframework.org\/\">Spring Framework<\/a>, <a href=\"http:\/\/code.google.com\/p\/google-guice\/\">Guice<\/a>, <a href=\"http:\/\/picocontainer.codehaus.org\/\">PicoContainer<\/a>.  Does anybody remember  <a href=\"http:\/\/en.wikipedia.org\/wiki\/DLL_Hell\">DLL Hell<\/a>?  That shows that &#8220;API definition&#8221; (which is a candidate for its own &#8220;Hard Thing&#8221; entry) is a sub-problem of dependency resolution.<br \/>\n       For build time, the better build systems make it easy to specify your dependencies and add <a href=\"http:\/\/nofluffjuststuff.com\/blog\/baruch_sadogursky\/2011\/06\/banning_transitive_dependencies_with_maven2_3_gradle_and_ivy\">global exclusions<\/a> to get you out of transitive dependency issues.<br \/>\n       For hardware-software, think about the hardware requirements for running a particular application or installing a particular driver.<br \/>\n       For distributed systems, think about (for example) your application requires which version of which database.  For provisioning, has been partially solved by <a href=\"http:\/\/docs.opscode.com\/chef_overview.html\">Chef<\/a> and <a href=\"http:\/\/puppetlabs.com\/puppet\/puppet-open-source\">Puppet<\/a> and others.  For detection, still very much roll-your-own.\n           <\/ol>\n<\/li>\n<\/ol>\n<p>So, did I create any converts?  Do you agree there are 3 Hard Things in Computer Science?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is a popular saying about Computer Science (see here and here): There are only two hard things in Computer Science: cache invalidation and naming things. &#8212; Phil Karlton There is a funny variation that makes it &#8220;There are only &hellip; <a href=\"https:\/\/tiemensfamily.com\/timoncs\/2014\/06\/28\/computer-science-hard-things\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"_links":{"self":[{"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/posts\/645"}],"collection":[{"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/comments?post=645"}],"version-history":[{"count":0,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/posts\/645\/revisions"}],"wp:attachment":[{"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/media?parent=645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/categories?post=645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tiemensfamily.com\/timoncs\/wp-json\/wp\/v2\/tags?post=645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}