{"id":91,"date":"2014-09-10T02:01:06","date_gmt":"2014-09-10T02:01:06","guid":{"rendered":"http:\/\/justinwiegand.com\/blog\/?p=91"},"modified":"2015-09-12T09:22:41","modified_gmt":"2015-09-12T14:22:41","slug":"camelcase","status":"publish","type":"post","link":"https:\/\/justinwiegand.com\/blog\/?p=91","title":{"rendered":"camelCase"},"content":{"rendered":"<p>As Apple released\u00a0yet another iPhone today, I would like to commemorate with\u00a0a discussion of camelCase (of which iPhone is an example)\u00a0and resolve its primary problem as a naming convention&#8211;acronyms.<\/p>\n<p>camelCase is a naming convention for programming (although it is used more broadly). \u00a0The idea is quite simple, you capitalize every first letter of multiple words in a file name (or variable, etc.) except for the first word (just keep it simple and leave it lowercase; if you capitalize it you have CamelCaps).<\/p>\n<p>I am a fan because it takes less space than using underscores (_) between words (snake case) or spaces (which introduce problems in many coding languages). \u00a0It is easier to type than adding underscores to variable names and syntax as well.<\/p>\n<p>But what about using acronyms together or at the start of a name? \u00a0For example, my naming a variable based on the terms &#8220;SES&#8221;, &#8220;VICAT&#8221;, and &#8220;males&#8221; would result in the following:<\/p>\n<p style=\"text-align: center;\">sESVICATMales<\/p>\n<p>This is confusing&#8211;first\u00a0for distinguishing the first acronym as an acronym.\u00a0 Second (and most obviously), it is confusing because one cannot distinguish between SES and VICAT as two separate acronyms.<\/p>\n<p>The solution to both of these problems is to treat acronyms as a word. \u00a0This yields:<\/p>\n<p style=\"text-align: center;\">sesVicatMales<\/p>\n<p>The distinction between the two acronyms is now clear.<\/p>\n<p>Enjoy camelCase!<\/p>\n<p><a href=\"http:\/\/en.wikipedia.org\/wiki\/CamelCase\">http:\/\/en.wikipedia.org\/wiki\/CamelCase<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>As Apple released\u00a0yet another iPhone today, I would like to commemorate with\u00a0a discussion of camelCase (of which iPhone is an example)\u00a0and resolve its primary problem as a naming convention&#8211;acronyms. camelCase is a naming convention for programming (although it is used more broadly). \u00a0The idea is quite simple, you capitalize every&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[27],"tags":[28,29,30,31],"class_list":["post-91","post","type-post","status-publish","format-standard","hentry","category-syntaxprogramming","tag-apple","tag-camelcase","tag-naming-conventions","tag-ocd"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p51adQ-1t","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/91","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=91"}],"version-history":[{"count":5,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":328,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions\/328"}],"wp:attachment":[{"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/justinwiegand.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}