{"id":949,"date":"2010-06-18T14:35:12","date_gmt":"2010-06-18T21:35:12","guid":{"rendered":"https:\/\/simpleprogrammer.com\/?p=949"},"modified":"2018-04-12T22:27:45","modified_gmt":"2018-04-13T02:27:45","slug":"the-power-of-func","status":"publish","type":"post","link":"https:\/\/simpleprogrammer.com\/the-power-of-func\/","title":{"rendered":"The Power of Func<>"},"content":{"rendered":"<p><strong>I remember why I love C#.<\/strong><\/p>\n<p>After spending the last two years or so writing mainly Java code, getting back into Visual Studio felt a little awkward and painful.<\/p>\n<p>Where did all my keyboard shortcuts go?\u00a0 Why can\u2019t I navigate to members in a class?\u00a0 Oh, yes <strong>Resharper<\/strong>&#8230; ah that\u2019s better.<\/p>\n<p>But then it happened.<\/p>\n<p>I was minding my own business writing some code\u2026 la la la<\/p>\n<div class=\"wlWriterEditableSmartContent\" id=\"scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:757d2684-4b1c-4de7-a7dc-27c9ff9695f4\" style=\"display: inline; float: none; margin: 0; padding: 0;\">\n<p><script src=\"https:\/\/gist.github.com\/simpleprogrammer-shared\/ef92971dcda46221b880bf7696801542.js\"><\/script><\/p>\n<\/div>\n<p>Oh my, repeated code!\u00a0 What ever shall I do?<\/p>\n<p>Hmm\u2026 It varies by property names only.<\/p>\n<p>Surely I can refactor out the override loading code.\u00a0 Can\u2019t put it in the constructor, because the goal is to lazy load the overrides from the database.<\/p>\n<h2>Func&lt;&gt; to the rescue!<\/h2>\n<p>This is the power of Func.\u00a0 Of delegates really.\u00a0 You can\u2019t do this in Java folks\u2026 Hold on to your chair.\u00a0 Here we go\u2026. Whee\u2026..<\/p>\n<div class=\"wlWriterEditableSmartContent\" id=\"scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:7a0c67b7-3009-4e63-aade-40c1f1757c2d\" style=\"display: inline; float: none; margin: 0; padding: 0;\">\n<p><script src=\"https:\/\/gist.github.com\/simpleprogrammer-shared\/1d4b0c9008a692169abdaba558b9b4ab.js\"><\/script><\/p>\n<\/div>\n<p>Good has won\u2026<\/p>\n<p>Evil has been defeated\u2026<\/p>\n<p>Code has been <a href=\"http:\/\/elegantcode.com\/2010\/06\/06\/the-best-code-you-will-ever-write\/\">deleted<\/a>\u2026<\/p>\n<p>Thank you Func&lt;&gt;<\/p>\n<p>Don\u2019t forget the <a href=\"https:\/\/simpleprogrammer.com\/2010\/02\/25\/super-combo-map-function-pointer\/\">Super Combo<\/a>!<\/p>\n<p>Also, check out the <a href=\"https:\/\/simpleprogrammer.com\/how-to-build-agile-software\/\">new page<\/a> I created, a compilation of useful posts I have written about building software in an Agile way.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I remember why I love C#. After spending the last two years or so writing mainly Java code, getting back into Visual Studio felt a little awkward and painful. Where did all my keyboard shortcuts go?\u00a0 Why can\u2019t I navigate to members in a class?\u00a0 Oh, yes Resharper&#8230; ah that\u2019s better. But then it happened&#8230;.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[3378,2185,2426,336,172054,1934],"tags":[],"class_list":["post-949","post","type-post","status-publish","format-standard","hentry","category-algorithms","category-best-practices","category-c","category-cool-stuff","category-lambda","category-language"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The Power of Func<\/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:\/\/simpleprogrammer.com\/products\/careerguide\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Power of Func\" \/>\n<meta property=\"og:description\" content=\"I remember why I love C#. After spending the last two years or so writing mainly Java code, getting back into Visual Studio felt a little awkward and painful. Where did all my keyboard shortcuts go?\u00a0 Why can\u2019t I navigate to members in a class?\u00a0 Oh, yes Resharper&#8230; ah that\u2019s better. But then it happened....\" \/>\n<meta property=\"og:url\" content=\"https:\/\/simpleprogrammer.com\/products\/careerguide\" \/>\n<meta property=\"og:site_name\" content=\"Simple Programmer\" \/>\n<meta property=\"article:published_time\" content=\"2010-06-18T21:35:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-04-13T02:27:45+00:00\" \/>\n<meta name=\"author\" content=\"John Sonmez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Sonmez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/the-power-of-func\\\/\"},\"author\":{\"name\":\"John Sonmez\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"headline\":\"The Power of Func\",\"datePublished\":\"2010-06-18T21:35:12+00:00\",\"dateModified\":\"2018-04-13T02:27:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/the-power-of-func\\\/\"},\"wordCount\":194,\"commentCount\":7,\"articleSection\":[\"Algorithms\",\"Best Practices\",\"C#\",\"Cool Stuff\",\"Lambda\",\"Language\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/the-power-of-func\\\/\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide\",\"name\":\"The Power of Func\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\"},\"datePublished\":\"2010-06-18T21:35:12+00:00\",\"dateModified\":\"2018-04-13T02:27:45+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/products\\\/careerguide#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/simpleprogrammer.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The Power of Func\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/\",\"name\":\"Simple Programmer\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/simpleprogrammer.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\",\"name\":\"John Sonmez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"caption\":\"John Sonmez\"},\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/author\\\/jsonmez\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The Power of Func","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:\/\/simpleprogrammer.com\/products\/careerguide","og_locale":"en_US","og_type":"article","og_title":"The Power of Func","og_description":"I remember why I love C#. After spending the last two years or so writing mainly Java code, getting back into Visual Studio felt a little awkward and painful. Where did all my keyboard shortcuts go?\u00a0 Why can\u2019t I navigate to members in a class?\u00a0 Oh, yes Resharper&#8230; ah that\u2019s better. But then it happened....","og_url":"https:\/\/simpleprogrammer.com\/products\/careerguide","og_site_name":"Simple Programmer","article_published_time":"2010-06-18T21:35:12+00:00","article_modified_time":"2018-04-13T02:27:45+00:00","author":"John Sonmez","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Sonmez","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#article","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/the-power-of-func\/"},"author":{"name":"John Sonmez","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"headline":"The Power of Func","datePublished":"2010-06-18T21:35:12+00:00","dateModified":"2018-04-13T02:27:45+00:00","mainEntityOfPage":{"@id":"https:\/\/simpleprogrammer.com\/the-power-of-func\/"},"wordCount":194,"commentCount":7,"articleSection":["Algorithms","Best Practices","C#","Cool Stuff","Lambda","Language"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/simpleprogrammer.com\/products\/careerguide#respond"]}]},{"@type":"WebPage","@id":"https:\/\/simpleprogrammer.com\/the-power-of-func\/","url":"https:\/\/simpleprogrammer.com\/products\/careerguide","name":"The Power of Func","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/#website"},"datePublished":"2010-06-18T21:35:12+00:00","dateModified":"2018-04-13T02:27:45+00:00","author":{"@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"breadcrumb":{"@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/simpleprogrammer.com\/products\/careerguide"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/simpleprogrammer.com\/products\/careerguide#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/simpleprogrammer.com\/"},{"@type":"ListItem","position":2,"name":"The Power of Func"}]},{"@type":"WebSite","@id":"https:\/\/simpleprogrammer.com\/#website","url":"https:\/\/simpleprogrammer.com\/","name":"Simple Programmer","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/simpleprogrammer.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67","name":"John Sonmez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","caption":"John Sonmez"},"url":"https:\/\/simpleprogrammer.com\/author\/jsonmez\/"}]}},"_links":{"self":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/949","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/comments?post=949"}],"version-history":[{"count":0,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/949\/revisions"}],"wp:attachment":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media?parent=949"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/categories?post=949"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/tags?post=949"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}