{"id":76,"date":"2009-01-31T14:31:16","date_gmt":"2009-01-31T16:31:16","guid":{"rendered":"http:\/\/www.ragestorm.net\/blogs\/?p=76"},"modified":"2009-01-31T14:31:16","modified_gmt":"2009-01-31T16:31:16","slug":"cant-stand-it-when","status":"publish","type":"post","link":"https:\/\/www.ragestorm.net\/blogs\/?p=76","title":{"rendered":"Can&#8217;t Stand it When&#8230;"},"content":{"rendered":"<p>1) &#8230; when people say they write code in <em>Assembler<\/em>. Now, if that sentence didn&#8217;t vibe you, then probably you shouldn&#8217;t read any futher. It&#8217;s like I will tell someone that I know to <em>code<\/em> in <em>Compiler<\/em>. And that&#8217;s wrong, you don&#8217;t code in compiler, you use a compiler in order to compile your code in whatever language you really write in. So the proper word would be &#8220;Assembly&#8221;. And I encounter too many people, who knows some Assembly too, that say it incorrectly and it freaks me out. The next thing I reply is &#8220;you write in compiler, ohhh wow, very nice&#8221;, but they don&#8217;t get it.<\/p>\n<p>2) &#8230; when you think you&#8217;re cool and you don&#8217;t use goto&#8217;s because most people <em>think<\/em> it&#8217;s a bad habit and yet you do it <em>indirectly<\/em> and you are cooler now. I will just show some code snippet and say <em>no more<\/em> than &#8211; your code should be readable, not making you a cool haxor guy (well maybe that too), and using goto for cleaning resources is legitimate <strong>!!!!<\/strong><\/p>\n<p>status = success;<\/p>\n<p>do {<br \/>\n\u00a0 p = (char*)malloc(1000);<br \/>\n\u00a0\u00a0if (p == NULL) {<br \/>\n\u00a0 status = fail;<br \/>\n\u00a0\u00a0 break; \/\/ &lt;&#8212; oh yeah biatch.<br \/>\n\u00a0 }<br \/>\n\u00a0} while (FALSE); \/\/ &lt;&#8212; oh no, so lame.<br \/>\n\u00a0if (status != success) {<br \/>\n\u00a0 if (p) free(p);<br \/>\n\u00a0\u00a0if (bla) free(bla);<br \/>\n\u00a0\u00a0return status;<br \/>\n\u00a0}<\/p>\n<p>\u00a0status = do_more_stuff(&#8230;);<br \/>\n\u00a0return status;<br \/>\n}<\/p>\n<p>3) &#8230; when something wrong happens internally in some function and you don&#8217;t bubble up the return code up to the caller and you\u00a0pretend &#8220;business as usual&#8221; when something is seriously wrong. Then some guy like me needs to come in and debug the flow control to find out what went wrong.<\/p>\n<p>4) &#8230; when you cannot disassemble <em>any<\/em> address you want in Visual Studio debugger (under Platform Builder) and you need to change the PC (IP on ARM) to whatever value and go to &#8220;Show Current Statement&#8221; and <em>only then<\/em> set a breakpoint there and view the Assembly code and then fix back the PC to the original&#8217;s value.<\/p>\n<p>Got some more? Share them with us.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1) &#8230; when people say they write code in Assembler. Now, if that sentence didn&#8217;t vibe you, then probably you shouldn&#8217;t read any futher. It&#8217;s like I will tell someone that I know to code in Compiler. And that&#8217;s wrong, you don&#8217;t code in compiler, you use a compiler in order to compile your code [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":""},"categories":[1],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pbWKd-1e","_links":{"self":[{"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/76"}],"collection":[{"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76"}],"version-history":[{"count":0,"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/76\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ragestorm.net\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}