{"id":163,"date":"2025-08-15T14:05:20","date_gmt":"2025-08-15T14:05:20","guid":{"rendered":"https:\/\/sites.tntech.edu\/acrockett\/?p=163"},"modified":"2025-08-15T14:05:20","modified_gmt":"2025-08-15T14:05:20","slug":"why-is-whiletrue-or-while1-bad-programming-practice","status":"publish","type":"post","link":"https:\/\/sites.tntech.edu\/acrockett\/2025\/08\/15\/why-is-whiletrue-or-while1-bad-programming-practice\/","title":{"rendered":"Why is while(true) or while(1) Bad Programming Practice?"},"content":{"rendered":"\n<p>When you can write your code in the form<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>while (condition) {<\/code><\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>while (!condition) { <\/code><\/pre>\n\n\n\n<p>without having to put ways to exit the loop (<strong>break<\/strong>, <strong>continue<\/strong>, or <strong>goto<\/strong>) in the body of the loop then a person reading your code can immediately understand what condition is going to terminate your loop just by looking at the header.<\/p>\n\n\n\n<p>In a world where a software engineer&#8217;s job is to modify existing code and where professionals code together as a team, it is extremely important to make your code as readable and understandable as possible.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1024\" style=\"aspect-ratio: 576 \/ 1024;\" width=\"576\" autoplay controls loop muted src=\"http:\/\/sites.tntech.edu\/acrockett\/wp-content\/uploads\/sites\/108\/2025\/08\/0ksnbo1ak0za1.mp4\" playsinline><\/video><\/figure>\n\n\n\n<p>Video taken from: <a href=\"https:\/\/www.reddit.com\/r\/ProgrammerHumor\/comments\/13ds8jx\/whiletrue\/#lightbox\">https:\/\/www.reddit.com\/r\/ProgrammerHumor\/comments\/13ds8jx\/whiletrue\/#lightbox<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you can write your code in the form or without having to put ways to exit the loop (break, continue, or goto) in the body of the loop then a person reading your code can immediately understand what condition is going to terminate your loop just by looking at the header. In a world [&hellip;]<\/p>\n","protected":false},"author":119,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":{"0":"post-163","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-c","7":"czr-hentry"},"_links":{"self":[{"href":"https:\/\/sites.tntech.edu\/acrockett\/wp-json\/wp\/v2\/posts\/163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.tntech.edu\/acrockett\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sites.tntech.edu\/acrockett\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sites.tntech.edu\/acrockett\/wp-json\/wp\/v2\/users\/119"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.tntech.edu\/acrockett\/wp-json\/wp\/v2\/comments?post=163"}],"version-history":[{"count":1,"href":"https:\/\/sites.tntech.edu\/acrockett\/wp-json\/wp\/v2\/posts\/163\/revisions"}],"predecessor-version":[{"id":165,"href":"https:\/\/sites.tntech.edu\/acrockett\/wp-json\/wp\/v2\/posts\/163\/revisions\/165"}],"wp:attachment":[{"href":"https:\/\/sites.tntech.edu\/acrockett\/wp-json\/wp\/v2\/media?parent=163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sites.tntech.edu\/acrockett\/wp-json\/wp\/v2\/categories?post=163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sites.tntech.edu\/acrockett\/wp-json\/wp\/v2\/tags?post=163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}