{"id":871,"date":"2022-08-30T15:08:34","date_gmt":"2022-08-30T15:08:34","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/problem-about-language-features-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:08:34","modified_gmt":"2022-08-30T15:08:34","slug":"problem-about-language-features-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-language-features-collection-of-common-programming-errors\/","title":{"rendered":"problem about language-features-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1d329f562180503bd1e91997f57fcaff?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nfinnw<br \/>\nc++ arrays language-design language-features array-initialization<br \/>\nWhen we initialize an array like this int a[5] = {0}, the compiler makes all 5 elements 0. That is really good, compact-initialization and useful feature. But I wonder why the compiler doesn&#8217;t initialize int a[5]={1} similarly? Why does it not make all 5 elements 1? Why the Standard doesn&#8217;t mandate i<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/aa705a09f888ce9f4712be2177f57bc8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nVirtuosiMedia<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/8b4c4af1174b9df8fec8b52a9325ac2f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\n7 revs, 3 users 87%Alexey<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/73b25499d3e9e38f2ad41171ea77d912?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nThere is nothing we can do<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/59c53bdf5e62482fc3840352c0015c47?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJason Bunting<br \/>\njavascript language-features language-design<br \/>\nI just came across an interesting situation in Javascript. I have a class with a method that defines several objects using object-literal notation. Inside those objects, the this pointer is being used. From the behavior of the prog<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2c9194fb955c93dac6aab8f8bef32cc8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nnone<br \/>\nrefactoring language-features language-design automated-refactoring<br \/>\nWhat are common traits\/properties of programming languages that facilitate (simplify) the development of widely automated source code analysis and re-engineering (transformation) tools?I am mostly thinking in terms of programming language features that make it easier to develop static analysis and refactoring tools (i.e. compare Java vs. C++, the former of which has better support for refactoring).In other words, a programming language that would be explicitly designed to provide support for automated static analysis and refactoring right from the beginnin<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9e9bb40f93094055bd09193eb3bccbb8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmizipzor<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ae15c48f686a0ecb39848f980b296611?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\n5 revs, 3 users 53%Shog9<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1a59747eee12a892dc9ef6c201e9044e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nORM<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/df93bdbaaf88550ea285080c3091a3c1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmikez302<br \/>\njavascript language-features<br \/>\nIn php, if you have the following code:$map = array(&#8220;first&#8221; =&gt; 1,&#8221;second&#8221; =&gt; 2 );$map[&#8220;third&#8221;] = 3;foreach($map<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c9b164acd0a80b6eb5cf503196d46dd9?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJonas S\u00f6derstr\u00f6m<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/graph.facebook.com\/100000530820249\/picture?type=large\" \/><br \/>\nClaudiu<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/GUjAm.png?s=32&amp;g=1\" \/><br \/>\nSchnizel1337<br \/>\nc++ language-features<br \/>\nI just found this strange anomaly of the type bool and I want to know, why is this possible?!test application: bool test = false; \/\/ == 0 printf(&#8220;value of test: \\n&#8221;, test<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1c8b7981c2cf5d0d0ab05343904fbc7d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nChristoph<br \/>\njavascript null language-features undefined<br \/>\nIn JavaScript, there are two values which basically say &#8216;I don&#8217;t exist&#8217; &#8211; undefined and null.A property to which a programmer has not assigned anything will be undefined, but in order for a property to become null, null must be explicitly assigned to it.I once thought that there was a need for null because undefined is a primitive value and null an object. It&#8217;s not, even if typeof null will yield &#8216;object&#8217;: Actually, both are primitive values &#8211; which means nei<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fc763c6ff6c160ddad05741e87e517b6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBill the Lizard<br \/>\njavascript language-features<br \/>\nI saw this thread, but I didn&#8217;t see<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bc10c7edd7524e1a05de670a3f0399a4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nWill<br \/>\njavascript language-features<br \/>\nThe Spider-Monkey JavaScript engine implements the noSuchMethod callback function for JavaScript Objects.This function is called whenever JavaScript tries to execute an undefined method of an Object.I would<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/91bc60829aafcbe8563d9aa6ac8fbe50?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nlillq<br \/>\nc macros preprocessor language-features language-design<br \/>\nI have written a little bit of C, and I can read it well enough to get a general idea of what it is doing, but every time I have encountered a macro it has thrown me completely. I end up having to remember what the macro is a and substitute it in my head as I read. The ones that I have encountered that were intuitive and easy to understand were always like little mini functions, so I always wondered why they werent<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bc392b9e725e03c5404c736197a606b1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\n5 revs, 2 users 100%eyelidlessness<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-11-09 22:50:22. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>finnw c++ arrays language-design language-features array-initialization When we initialize an array like this int a[5] = {0}, the compiler makes all 5 elements 0. That is really good, compact-initialization and useful feature. But I wonder why the compiler doesn&#8217;t initialize int a[5]={1} similarly? Why does it not make all 5 elements 1? Why the Standard [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-871","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=871"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/871\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}