{"id":4285,"date":"2021-07-01T16:14:52","date_gmt":"2021-07-01T10:44:52","guid":{"rendered":"https:\/\/www.suramya.com\/blog\/?p=4285"},"modified":"2021-07-01T16:14:52","modified_gmt":"2021-07-01T10:44:52","slug":"never-used-foo-bar-baz-as-variable-names-can-i-still-call-myself-a-programmer","status":"publish","type":"post","link":"https:\/\/www.suramya.com\/blog\/2021\/07\/never-used-foo-bar-baz-as-variable-names-can-i-still-call-myself-a-programmer\/","title":{"rendered":"Never used foo\/bar\/baz as variable names, can I still call myself a programmer?"},"content":{"rendered":"<p>Just realized today that in my 24+ years of programming I have never named a variable foo, bar or baz. These are the goto names for <a href=\"https:\/\/en.wikipedia.org\/wiki\/Foobar\">placeholders in code &#038; metaphysical variables <\/a> and have decades of history behind them. Most programmers use them for temporary variables or place holders. Since I have never used them, can I still call myself a programmer? \ud83d\ude00 <\/p>\n<p>Jokes aside, you should use good variable names in your code that are meaningful, easy to read and concise. Some guidelines on how to do that are below:<\/p>\n<ul>\n<li><a href='https:\/\/geo-python.github.io\/site\/notebooks\/L1\/gcp-1-variable-naming.html'>Good coding practices &#8211; Selecting \u201cgood\u201d variable names<\/a><\/li>\n<li><a href='https:\/\/www.freshconsulting.com\/insights\/blog\/development-principle-1-choose-appropriate-variable-names\/'>Dev Principle #1: Choose Appropriate Variable Names<\/a><\/li>\n<li><a href='https:\/\/wiki.c2.com\/?GoodVariableNames'>Good Variable Names<\/a><\/li>\n<\/ul>\n<p>Also, another point to keep in mind is to avoid acronyms that can have a different meaning in a different language or resemble rude words etc. See the screenshot below for an example of a &#8216;bad&#8217; variable name:<\/p>\n<p><center><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.suramya.com\/blog\/wp-content\/uploads\/2021\/07\/6fttplx5kbk21.jpg\" alt=\"Example of a bad variable name\" width=\"400\" height=\"265\" class=\"alignnone size-full wp-image-4287\" srcset=\"https:\/\/www.suramya.com\/blog\/wp-content\/uploads\/2021\/07\/6fttplx5kbk21.jpg 400w, https:\/\/www.suramya.com\/blog\/wp-content\/uploads\/2021\/07\/6fttplx5kbk21-300x199.jpg 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><br \/>\nExample of a bad variable name<\/center><\/p>\n<p>Well this is all for now. Will post more later.<\/p>\n<p>&#8211; Suramya<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just realized today that in my 24+ years of programming I have never named a variable foo, bar or baz. These are the goto names for placeholders in code &#038; metaphysical variables and have decades of history behind them. Most programmers use them for temporary variables or place holders. Since I have never used them, [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":""},"categories":[26,4,2],"tags":[],"class_list":["post-4285","post","type-post","status-publish","format-standard","hentry","category-humor","category-my-thoughts","category-techie-stuff"],"_links":{"self":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/4285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/comments?post=4285"}],"version-history":[{"count":3,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/4285\/revisions"}],"predecessor-version":[{"id":4289,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/posts\/4285\/revisions\/4289"}],"wp:attachment":[{"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/media?parent=4285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/categories?post=4285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.suramya.com\/blog\/wp-json\/wp\/v2\/tags?post=4285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}