{"id":2147,"date":"2010-06-03T11:19:43","date_gmt":"2010-06-03T09:19:43","guid":{"rendered":"http:\/\/codeblab.com\/?p=2147"},"modified":"2010-06-03T11:20:16","modified_gmt":"2010-06-03T09:20:16","slug":"uber-flexible","status":"publish","type":"post","link":"https:\/\/codeblab.com\/2010\/06\/uber-flexible\/","title":{"rendered":"Uber Flexible"},"content":{"rendered":"<p>Newer languages like Java lack a preprocessor like C has. The <code  style=\"color:green\">#ifdef AAP<\/code> is replaced by <code style=\"color:blue\">if<span style=\"color:black\">(<\/span><span style=\"color:green\">aap<\/span><span style=\"color:black\">)<\/span><\/code> with <code style=\"color:green\">aap<\/code> declared <code style=\"color:blue\">final<\/code>. However, <code>cpp<\/code> <a href=\"http:\/\/stackoverflow.com\/questions\/1346391\/line-equivalent-in-java\">has more to offer<\/a> than <em>conditional code<\/em>. A preprocessor is a domain specific language for symbol manipulation that can also offer <em>meta programming<\/em> and <em>language alterations<\/em>. The <code style=\"color:green\">__LINE__<\/code> directive is an example of the former. Below an example of the latter:<br \/><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/codeblab.com\/wp-content\/uploads\/2010\/06\/locked.png\" alt=\"locked\" title=\"locked\" width=\"525\" height=\"128\" class=\"alignnone size-full wp-image-2166\" srcset=\"https:\/\/codeblab.com\/wp-content\/uploads\/2010\/06\/locked.png 525w, https:\/\/codeblab.com\/wp-content\/uploads\/2010\/06\/locked-400x97.png 400w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><br \/>To fully use a preprocessor, a coder needs to be uber-flexible. Only a few are. Hence the frustration with languages like <a href=\"http:\/\/en.wikipedia.org\/wiki\/M4_%28computer_language%29\">M4<\/a> or the expansion delay effect of <code style=\"color:blue\">&amp;&amp;<\/code> in the <a href='http:\/\/codeblab.com\/wp-content\/uploads\/2010\/06\/SAS-macros.pdf'>SAS macro language<\/a>. Some preprocessors were <a href=\"http:\/\/cm.bell-labs.com\/cm\/cs\/who\/dmr\/chist.html\">added out of necessity<\/a>. Just imagine writing 10 KLOC of assembler without using a preprocessor. To quote <a href=\"http:\/\/nl.wikipedia.org\/wiki\/Al_Bundy\">Al Bundy<\/a>, I&#8217;d rather bait a crocodile with my manhood.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Newer languages like Java lack a preprocessor like C has. The #ifdef AAP is replaced by if(aap) with aap declared final. However, cpp has more to offer than conditional code. A preprocessor is a domain specific language for symbol manipulation that can also offer meta programming and language alterations. The __LINE__ directive is an example [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-2147","post","type-post","status-publish","format-standard","hentry","category-codelanguage"],"_links":{"self":[{"href":"https:\/\/codeblab.com\/wp-json\/wp\/v2\/posts\/2147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeblab.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeblab.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeblab.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/codeblab.com\/wp-json\/wp\/v2\/comments?post=2147"}],"version-history":[{"count":31,"href":"https:\/\/codeblab.com\/wp-json\/wp\/v2\/posts\/2147\/revisions"}],"predecessor-version":[{"id":2181,"href":"https:\/\/codeblab.com\/wp-json\/wp\/v2\/posts\/2147\/revisions\/2181"}],"wp:attachment":[{"href":"https:\/\/codeblab.com\/wp-json\/wp\/v2\/media?parent=2147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeblab.com\/wp-json\/wp\/v2\/categories?post=2147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeblab.com\/wp-json\/wp\/v2\/tags?post=2147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}