{"id":11515,"date":"2021-06-16T18:21:00","date_gmt":"2021-06-16T18:21:00","guid":{"rendered":"https:\/\/www.directimpactsolutions.com\/?p=11515"},"modified":"2023-05-18T16:47:41","modified_gmt":"2023-05-18T16:47:41","slug":"the-impact-of-naming-conventions-on-code-readability","status":"publish","type":"post","link":"https:\/\/www.directimpactsolutions.com\/en\/the-impact-of-naming-conventions-on-code-readability\/","title":{"rendered":"The Impact of Naming Conventions on Code Readability"},"content":{"rendered":"<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions-1024x580.jpg\" alt=\"naming conventions\" class=\"wp-image-11746\" width=\"597\" height=\"338\" srcset=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions-1024x580.jpg 1024w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions-300x170.jpg 300w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions-768x435.jpg 768w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions-600x340.jpg 600w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions.jpg 1500w\" sizes=\"auto, (max-width: 597px) 100vw, 597px\" \/><\/figure><h3 class=\"wp-block-heading\" style=\"padding-top:var(--wp--preset--spacing--40)\">Naming Conventions in FileMaker<\/h3><p>Implementing reliable naming conventions in FileMaker has the potential to save developers both time and frustration. This is the second installation in our blog series on&nbsp;<a href=\"https:\/\/directimpactsolutions.com\/en\/the-importance-of-code-readability\/\">code readability<\/a>.&nbsp;<\/p><p>According to Wikipedia, a naming convention is \u201ca set of coding rules for choosing software identifiers (names of program elements) in source code and documentation. The reasons for using a naming convention [\u2026] are as follows:<\/p><ul class=\"wp-block-list\"><li>To make the source code easier to read and understand with less effort;<\/li>\n\n<li>To improve the appearance of the source code (for example, by avoiding long names or abbreviations)\u201d<\/li><\/ul><p>However, naming conventions can be controversial. Everyone has their own style when it comes to naming fields, variables, scripts, objects, and even documentation. Additionally, there is no standard way to name parts of code.&nbsp;<\/p><p>We recommend having teams of developers agree upon a set of clear naming conventions in order to establish expectations. Naming conventions should be logical and follow the principles below to the fullest extent possible.<\/p><p>Ideally, the chosen naming convention can be applied not only in FileMaker, but also other languages, because FileMaker can be integrated with other systems or modules, such as those created in JavaScript. Proper naming conventions are simple and can be applied everywhere; they also tend to be the most intuitive.<\/p><h3 class=\"wp-block-heading\"><strong>Basic Principles of Naming Conventions<\/strong><\/h3><ol class=\"wp-block-list\"><li class=\"has-medium-font-size\"><strong>Be consistent<\/strong><\/li><\/ol><p style=\"padding-right:0;padding-left:var(--wp--preset--spacing--60)\">Try to find a standard way to name things, being as consistent as possible with word choice. Try to use the same words to say the same things.<\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">For example, we\u2019ll use a \u201clower camelCase\u201d nomenclature and the underscore to separate words or groups of words.<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions.jpg\" alt=\"\" class=\"wp-image-11519\" width=\"520\" height=\"203\" srcset=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions.jpg 640w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions-300x117.jpg 300w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions-600x234.jpg 600w\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" \/><\/figure><p class=\"has-medium-font-size\" style=\"padding-top:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--50)\">2. <strong>Avoid abbreviations &amp; acronyms<\/strong><\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">The meanings of abbreviations and acronyms aren\u2019t always apparent. At worst, other developers may need to run Google searches to try to understand the meanings of unclear abbreviations and acronyms. It is also difficult to remember these meanings and look them up in code.<\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">On the other hand, some abbreviations and acronyms are part of the IT\/Computer\/Coding common language and are sometimes better known than the non-abbreviated version. For example, \u201cid\u201d for \u201cidentification\u201d, \u201cMB\u201d for \u201cmegabyte\u201d, \u201cGUI\u201d for \u201cGraphic User Interface\u201d, \u201cAPI\u201d for \u201cApplication programming interface\u201d, and others such as \u201cSQL\u201d, \u201cHTML\u201d, \u201cREST\u201d, \u201cCMS\u201d, \u201cERP\u201d, etc. These abbreviations and acronyms may be acceptable. The real goal is to avoid non-standard abbreviations and acronyms.<\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">It may seem counterproductive to use longer names, especially since today\u2019s development environments all offer auto-completion features and text expander programs. Comprehension is often better using full names.<\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">However, having names that are too long can also be an issue. Some development environments, such as FileMaker, can truncate these names, making them difficult to read. The ultimate goal is to find a happy medium, prioritizing understandable code over shortened names.<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_Acronyms.jpg\" alt=\"\" class=\"wp-image-11521\" width=\"528\" height=\"313\" srcset=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_Acronyms.jpg 640w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_Acronyms-300x178.jpg 300w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_Acronyms-600x355.jpg 600w\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" \/><\/figure><p class=\"has-medium-font-size\" style=\"padding-top:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--50)\">3.<strong> Be meaningful<\/strong><\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">Avoid arbitrary series and words that can create confusion. It is important to keep solution context in mind when naming things. For example, a completely arbitrary variable name that has no connection to the solution is not desirable.<\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">One possible exception to this rule is that the variables i and j are often used for loop counts. We recommend adding meaning to your code by mentioning what type of count it is, such as userList_loopCount, or by mentioning it in a comment.<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_Meaningful.jpg\" alt=\"\" class=\"wp-image-11523\" width=\"530\" height=\"219\" srcset=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_Meaningful.jpg 640w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_Meaningful-300x124.jpg 300w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_Meaningful-600x248.jpg 600w\" sizes=\"auto, (max-width: 530px) 100vw, 530px\" \/><\/figure><p class=\"has-medium-font-size\" style=\"padding-top:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--50)\">4.<strong> Avoid data type encoding<\/strong><\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">This may sound like a useful practice, but for better flexibility\/extensibility, this ambiguity may be awkward and difficult to maintain. The name should be a higher level of abstraction from the implementation details of the actual field or variable type.<\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">One possible exception: In FileMaker, when we add a gl_ or g_ prefix or suffix to a field name, for example gUsername. In these cases, it is not the data type that is specified, but the scope\/visibility of the field, much like the $ and $$ in a variable name.<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_DataTypeEncoding.jpg\" alt=\"\" class=\"wp-image-11525\" width=\"532\" height=\"190\" srcset=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_DataTypeEncoding.jpg 640w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_DataTypeEncoding-300x107.jpg 300w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_DataTypeEncoding-600x215.jpg 600w\" sizes=\"auto, (max-width: 532px) 100vw, 532px\" \/><\/figure><p class=\"has-medium-font-size\" style=\"padding-top:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--50)\">5.<strong> Use a generic &amp; professional vocabulary<\/strong><\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">Some projects change developer teams several times during their lifetime; others are cross-cultural. The name you choose in your code will be read by a variety of people, and can be interpreted differently by different people.<\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">The naming convention should be generic and as professional as possible, and should not include expressions in a common language. It should also not be offensive or too cute.<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_Vocabulary.jpg\" alt=\"\" class=\"wp-image-11527\" width=\"535\" height=\"135\" srcset=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_Vocabulary.jpg 640w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_Vocabulary-300x76.jpg 300w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_Vocabulary-600x152.jpg 600w\" sizes=\"auto, (max-width: 535px) 100vw, 535px\" \/><\/figure><p class=\"has-medium-font-size\" style=\"padding-top:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--50)\">6.<strong> Be positive<\/strong><\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">It is easier to understand what is expressed positively. For example, \u201cI\u2019m happy\u201d is easier to understand than a phrase with a similar sentiment, \u201cI am not unhappy.\u201d Try to name positively by using prefixes like \u201cis\u201d, \u201chas\u201d, \u201ccan\u201d.<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_BePositive.jpg\" alt=\"\" class=\"wp-image-11529\" width=\"537\" height=\"149\" srcset=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_BePositive.jpg 640w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_BePositive-300x83.jpg 300w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_BePositive-600x167.jpg 600w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/figure><p class=\"has-medium-font-size\" style=\"padding-top:var(--wp--preset--spacing--40);padding-left:var(--wp--preset--spacing--50)\">7.<strong> Avoid spelling mistakes<\/strong><\/p><p style=\"padding-left:var(--wp--preset--spacing--60)\">This rule should apply everywhere in our communications with others, not just in our code. Spelling mistakes and grammatical errors can make our code harder to read. This highlights the importance of proofreading code.<\/p><figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_SpellingMistakes.jpg\" alt=\"\" class=\"wp-image-11531\" width=\"539\" height=\"178\" srcset=\"https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_SpellingMistakes.jpg 640w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_SpellingMistakes-300x99.jpg 300w, https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2023\/05\/Naming_Conventions_SpellingMistakes-600x198.jpg 600w\" sizes=\"auto, (max-width: 539px) 100vw, 539px\" \/><\/figure><p style=\"padding-top:var(--wp--preset--spacing--60)\">We hope that this article has been informative and is something you can immediately apply to your development practices. Check out the <a href=\"https:\/\/www.youtube.com\/watch?v=5a79RITwNUY&amp;t=4s\" target=\"_blank\" rel=\"noreferrer noopener\">video<\/a> below for a tongue-in-cheek guide as to why proper naming conventions are critically important.<\/p><h4 class=\"wp-block-heading has-medium-font-size\" style=\"padding-top:var(--wp--preset--spacing--50)\"><strong>FileMaker Best Practices: Guarantee Lifetime Employment with the Magic of Naming<\/strong><\/h4><figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"ast-oembed-container\" style=\"height: 100%;\"><iframe loading=\"lazy\" title=\"FileMaker Best Practices: Guarantee Lifetime Employment with the Magic of Naming\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/5a79RITwNUY?start=4&#038;feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure><hr class=\"wp-block-separator aligncenter has-alpha-channel-opacity\" style=\"margin-top:var(--wp--preset--spacing--70);margin-bottom:var(--wp--preset--spacing--70)\"\/><p class=\"has-small-font-size\"><em>*This article was originally written for AppWorks, which has since joined Direct Impact Solutions. This article is intended for informative purposes only. To the best of our knowledge, this information is accurate as of the date of publication.<\/em><\/p>","protected":false},"excerpt":{"rendered":"<p>Naming Conventions in FileMaker Implementing reliable naming conventions in FileMaker has the potential to save developers both time and frustration. This is the second installation in our blog series on&nbsp;code readability.&nbsp; According to Wikipedia, a naming convention is \u201ca set of coding rules for choosing software identifiers (names of program elements) in source code and &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.directimpactsolutions.com\/en\/the-impact-of-naming-conventions-on-code-readability\/\"> <span class=\"screen-reader-text\">The Impact of Naming Conventions on Code Readability<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":11,"featured_media":11746,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","footnotes":""},"categories":[29],"tags":[207,39,208],"class_list":["post-11515","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-low-code","tag-code-readability","tag-filemaker","tag-naming-conventions"],"uagb_featured_image_src":{"full":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions.jpg",1500,850,false],"thumbnail":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions-150x150.jpg",150,150,true],"medium":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions-300x170.jpg",300,170,true],"medium_large":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions-768x435.jpg",768,435,true],"large":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions-1024x580.jpg",1024,580,true],"1536x1536":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions.jpg",1500,850,false],"2048x2048":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions.jpg",1500,850,false],"woocommerce_thumbnail":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions-300x300.jpg",300,300,true],"woocommerce_single":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions-600x340.jpg",600,340,true],"woocommerce_gallery_thumbnail":["https:\/\/www.directimpactsolutions.com\/wp-content\/uploads\/2021\/06\/Naming-Conventions-100x100.jpg",100,100,true]},"uagb_author_info":{"display_name":"Weihao Ding","author_link":"https:\/\/www.directimpactsolutions.com\/en\/author\/weihao-dingdirectimpactsolutions-com\/"},"uagb_comment_info":0,"uagb_excerpt":"Naming Conventions in FileMaker Implementing reliable naming conventions in FileMaker has the potential to save developers both time and frustration. This is the second installation in our blog series on&nbsp;code readability.&nbsp; According to Wikipedia, a naming convention is \u201ca set of coding rules for choosing software identifiers (names of program elements) in source code and&hellip;","_links":{"self":[{"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/posts\/11515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/comments?post=11515"}],"version-history":[{"count":8,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/posts\/11515\/revisions"}],"predecessor-version":[{"id":21015,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/posts\/11515\/revisions\/21015"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/media\/11746"}],"wp:attachment":[{"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/media?parent=11515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/categories?post=11515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.directimpactsolutions.com\/en\/wp-json\/wp\/v2\/tags?post=11515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}