[{"data":1,"prerenderedAt":661},["ShallowReactive",2],{"guide-naming-conventions-guide":3},{"id":4,"title":5,"body":6,"date":653,"description":654,"extension":655,"meta":656,"navigation":485,"path":657,"readingTime":539,"seo":658,"stem":659,"__hash__":660},"guides\u002Fguides\u002Fnaming-conventions-guide.md","Naming Conventions Guide: Choosing the Right Case for Your Code",{"type":7,"value":8,"toc":633},"minimark",[9,14,18,30,34,37,42,45,108,115,119,122,139,144,147,150,178,183,186,189,213,218,222,225,361,365,368,377,410,432,436,439,443,446,454,457,461,464,498,501,505,508,543,547,550,556,559,563,585,589,592,609,613,629],[10,11,13],"h2",{"id":12},"why-naming-conventions-matter","Why Naming Conventions Matter",[15,16,17],"p",{},"Naming conventions are not cosmetic preferences. They affect how quickly you read code, how easily you spot bugs, and how smoothly your team collaborates. A consistent naming style lets your brain skip the \"decode\" step and focus on the logic.",[15,19,20,21,25,26,29],{},"Inconsistent naming wastes time. When one developer writes ",[22,23,24],"code",{},"user_name"," and another writes ",[22,27,28],{},"userName",", every reader pauses to check whether they refer to the same thing. Multiply that pause across thousands of variable reads per day, and the cost is real.",[10,31,33],{"id":32},"the-four-main-naming-styles","The Four Main Naming Styles",[15,35,36],{},"Most programming languages use one of four capitalization conventions. Each has a distinct look and common use cases.",[38,39,41],"h3",{"id":40},"camelcase","camelCase",[15,43,44],{},"Words are joined without separators, and every word after the first starts with an uppercase letter.",[46,47,52],"pre",{"className":48,"code":49,"language":50,"meta":51,"style":51},"language-javascript shiki shiki-themes github-light github-dark","let firstName = \"Alice\";\nfunction calculateTotal() {}\nconst maxRetryCount = 3;\n","javascript","",[22,53,54,77,90],{"__ignoreMap":51},[55,56,59,63,67,70,74],"span",{"class":57,"line":58},"line",1,[55,60,62],{"class":61},"szBVR","let",[55,64,66],{"class":65},"sVt8B"," firstName ",[55,68,69],{"class":61},"=",[55,71,73],{"class":72},"sZZnC"," \"Alice\"",[55,75,76],{"class":65},";\n",[55,78,80,83,87],{"class":57,"line":79},2,[55,81,82],{"class":61},"function",[55,84,86],{"class":85},"sScJk"," calculateTotal",[55,88,89],{"class":65},"() {}\n",[55,91,93,96,100,103,106],{"class":57,"line":92},3,[55,94,95],{"class":61},"const",[55,97,99],{"class":98},"sj4cs"," maxRetryCount",[55,101,102],{"class":61}," =",[55,104,105],{"class":98}," 3",[55,107,76],{"class":65},[15,109,110,114],{},[111,112,113],"strong",{},"Used by:"," JavaScript, TypeScript, Java, C#, Go (for private fields)",[38,116,118],{"id":117},"pascalcase","PascalCase",[15,120,121],{},"Every word starts with an uppercase letter, including the first one.",[46,123,127],{"className":124,"code":125,"language":126,"meta":51,"style":51},"language-csharp shiki shiki-themes github-light github-dark","public class UserProfile {}\npublic void ProcessOrder() {}\n","csharp",[22,128,129,134],{"__ignoreMap":51},[55,130,131],{"class":57,"line":58},[55,132,133],{},"public class UserProfile {}\n",[55,135,136],{"class":57,"line":79},[55,137,138],{},"public void ProcessOrder() {}\n",[15,140,141,143],{},[111,142,113],{}," C#, Java (classes), TypeScript (types, interfaces, components), Go (exported identifiers)",[38,145,146],{"id":146},"snake_case",[15,148,149],{},"Words are joined with underscores, all lowercase.",[46,151,155],{"className":152,"code":153,"language":154,"meta":51,"style":51},"language-python shiki shiki-themes github-light github-dark","first_name = \"Alice\"\ndef calculate_total():\n    pass\nMAX_RETRY_COUNT = 3\n","python",[22,156,157,162,167,172],{"__ignoreMap":51},[55,158,159],{"class":57,"line":58},[55,160,161],{},"first_name = \"Alice\"\n",[55,163,164],{"class":57,"line":79},[55,165,166],{},"def calculate_total():\n",[55,168,169],{"class":57,"line":92},[55,170,171],{},"    pass\n",[55,173,175],{"class":57,"line":174},4,[55,176,177],{},"MAX_RETRY_COUNT = 3\n",[15,179,180,182],{},[111,181,113],{}," Python, Ruby, Rust (snake_case for functions and variables), SQL",[38,184,185],{"id":185},"kebab-case",[15,187,188],{},"Words are joined with hyphens, all lowercase.",[46,190,194],{"className":191,"code":192,"language":193,"meta":51,"style":51},"language-css shiki shiki-themes github-light github-dark",".user-profile {}\nfont-size: 16px;\n","css",[22,195,196,204],{"__ignoreMap":51},[55,197,198,201],{"class":57,"line":58},[55,199,200],{"class":85},".user-profile",[55,202,203],{"class":65}," {}\n",[55,205,206,210],{"class":57,"line":79},[55,207,209],{"class":208},"s9eBZ","font-size",[55,211,212],{"class":65},": 16px;\n",[15,214,215,217],{},[111,216,113],{}," CSS class names, HTML attributes, URL slugs, file names in many JavaScript projects",[10,219,221],{"id":220},"language-by-language-recommendations","Language-by-Language Recommendations",[15,223,224],{},"Every language has community conventions. Following them makes your code feel natural to other developers in that ecosystem.",[226,227,228,250],"table",{},[229,230,231],"thead",{},[232,233,234,238,241,244,247],"tr",{},[235,236,237],"th",{},"Language",[235,239,240],{},"Variables & Functions",[235,242,243],{},"Classes & Types",[235,245,246],{},"Constants",[235,248,249],{},"Files",[251,252,253,268,281,294,309,322,335,348],"tbody",{},[232,254,255,259,261,263,266],{},[256,257,258],"td",{},"JavaScript",[256,260,41],{},[256,262,118],{},[256,264,265],{},"SCREAMING_SNAKE",[256,267,185],{},[232,269,270,273,275,277,279],{},[256,271,272],{},"TypeScript",[256,274,41],{},[256,276,118],{},[256,278,265],{},[256,280,185],{},[232,282,283,286,288,290,292],{},[256,284,285],{},"Python",[256,287,146],{},[256,289,118],{},[256,291,265],{},[256,293,146],{},[232,295,296,299,302,305,307],{},[256,297,298],{},"Go",[256,300,301],{},"camelCase (unexported)",[256,303,304],{},"PascalCase (exported)",[256,306,41],{},[256,308,146],{},[232,310,311,314,316,318,320],{},[256,312,313],{},"Rust",[256,315,146],{},[256,317,118],{},[256,319,265],{},[256,321,146],{},[232,323,324,327,329,331,333],{},[256,325,326],{},"Java",[256,328,41],{},[256,330,118],{},[256,332,265],{},[256,334,118],{},[232,336,337,340,342,344,346],{},[256,338,339],{},"C#",[256,341,41],{},[256,343,118],{},[256,345,118],{},[256,347,118],{},[232,349,350,353,355,357,359],{},[256,351,352],{},"Ruby",[256,354,146],{},[256,356,118],{},[256,358,265],{},[256,360,146],{},[10,362,364],{"id":363},"variables-vs-constants-vs-files","Variables vs Constants vs Files",[15,366,367],{},"The same language often uses different conventions for different categories of identifiers.",[15,369,370,373,374,376],{},[111,371,372],{},"Variables and functions"," follow the dominant style of the language (camelCase for JS, snake_case for Python). ",[111,375,246],{}," almost always use SCREAMING_SNAKE_CASE across all languages:",[46,378,380],{"className":48,"code":379,"language":50,"meta":51,"style":51},"const MAX_CONNECTIONS = 100;\nconst API_BASE_URL = \"https:\u002F\u002Fapi.example.com\";\n",[22,381,382,396],{"__ignoreMap":51},[55,383,384,386,389,391,394],{"class":57,"line":58},[55,385,95],{"class":61},[55,387,388],{"class":98}," MAX_CONNECTIONS",[55,390,102],{"class":61},[55,392,393],{"class":98}," 100",[55,395,76],{"class":65},[55,397,398,400,403,405,408],{"class":57,"line":79},[55,399,95],{"class":61},[55,401,402],{"class":98}," API_BASE_URL",[55,404,102],{"class":61},[55,406,407],{"class":72}," \"https:\u002F\u002Fapi.example.com\"",[55,409,76],{"class":65},[15,411,412,415,416,419,420,423,424,427,428,431],{},[111,413,414],{},"File names"," are a common source of confusion. JavaScript projects typically use kebab-case for files (",[22,417,418],{},"user-profile.vue",", ",[22,421,422],{},"api-client.ts","), even though the code inside uses camelCase or PascalCase. Python projects use snake_case (",[22,425,426],{},"user_profile.py","). Java and C# use PascalCase to match the class name (",[22,429,430],{},"UserProfile.java",").",[10,433,435],{"id":434},"mixed-conventions-in-practice","Mixed Conventions in Practice",[15,437,438],{},"Some frameworks require mixing conventions. Here are the most common scenarios.",[38,440,442],{"id":441},"react-component-files","React Component Files",[15,444,445],{},"React components use PascalCase for the component name but kebab-case for the file name:",[46,447,452],{"className":448,"code":450,"language":451},[449],"language-text","Components:\n  user-profile.tsx → exports UserProfile\n  navigation-bar.tsx → exports NavBar\n","text",[22,453,450],{"__ignoreMap":51},[15,455,456],{},"This feels contradictory, but each convention serves a purpose: kebab-case file names work well with URL-based tooling and case-insensitive file systems, while PascalCase component names follow JSX requirements.",[38,458,460],{"id":459},"go-visibility-rules","Go Visibility Rules",[15,462,463],{},"In Go, the capitalization of the first letter controls visibility:",[46,465,469],{"className":466,"code":467,"language":468,"meta":51,"style":51},"language-go shiki shiki-themes github-light github-dark","type User struct {}      \u002F\u002F exported (public)\ntype userSession struct {} \u002F\u002F unexported (private)\n\nfunc GetUserID() int {}   \u002F\u002F exported\nfunc validateInput() {}   \u002F\u002F unexported\n","go",[22,470,471,476,481,487,492],{"__ignoreMap":51},[55,472,473],{"class":57,"line":58},[55,474,475],{},"type User struct {}      \u002F\u002F exported (public)\n",[55,477,478],{"class":57,"line":79},[55,479,480],{},"type userSession struct {} \u002F\u002F unexported (private)\n",[55,482,483],{"class":57,"line":92},[55,484,486],{"emptyLinePlaceholder":485},true,"\n",[55,488,489],{"class":57,"line":174},[55,490,491],{},"func GetUserID() int {}   \u002F\u002F exported\n",[55,493,495],{"class":57,"line":494},5,[55,496,497],{},"func validateInput() {}   \u002F\u002F unexported\n",[15,499,500],{},"This is not a style choice — it is a language rule. The convention directly affects program behavior.",[38,502,504],{"id":503},"database-columns-vs-application-code","Database Columns vs Application Code",[15,506,507],{},"API responses often arrive in camelCase (from JSON), but database columns frequently use snake_case. You may need to transform names at the boundary:",[46,509,511],{"className":152,"code":510,"language":154,"meta":51,"style":51},"# JSON arrives with camelCase\n{\"firstName\": \"Alice\", \"lastName\": \"Smith\"}\n\n# Python model uses snake_case\nfirst_name = data[\"firstName\"]\nlast_name = data[\"lastName\"]\n",[22,512,513,518,523,527,532,537],{"__ignoreMap":51},[55,514,515],{"class":57,"line":58},[55,516,517],{},"# JSON arrives with camelCase\n",[55,519,520],{"class":57,"line":79},[55,521,522],{},"{\"firstName\": \"Alice\", \"lastName\": \"Smith\"}\n",[55,524,525],{"class":57,"line":92},[55,526,486],{"emptyLinePlaceholder":485},[55,528,529],{"class":57,"line":174},[55,530,531],{},"# Python model uses snake_case\n",[55,533,534],{"class":57,"line":494},[55,535,536],{},"first_name = data[\"firstName\"]\n",[55,538,540],{"class":57,"line":539},6,[55,541,542],{},"last_name = data[\"lastName\"]\n",[10,544,546],{"id":545},"the-importance-of-team-conventions","The Importance of Team Conventions",[15,548,549],{},"Community conventions provide a starting point, but team agreements override them. If your team decides on a style, document it and enforce it with tooling.",[15,551,552,555],{},[111,553,554],{},"Linters and formatters"," are the most effective way to maintain consistency. ESLint can enforce camelCase variables. Pylint can enforce snake_case in Python. Prettier can normalize file naming.",[15,557,558],{},"A naming rule that is automated is a rule that is followed. A rule that relies on memory and code review will drift within weeks.",[10,560,562],{"id":561},"key-takeaways","Key Takeaways",[564,565,566,570,573,576,579,582],"ul",{},[567,568,569],"li",{},"Consistent naming removes friction — your brain skips the decode step and reads logic directly.",[567,571,572],{},"Each language has dominant conventions; follow them unless your team agrees otherwise.",[567,574,575],{},"Constants use SCREAMING_SNAKE_CASE in nearly every language.",[567,577,578],{},"File names and code identifiers often follow different conventions — that is normal.",[567,580,581],{},"Mixed conventions (like React's kebab-case files + PascalCase components) are common and practical.",[567,583,584],{},"Automate enforcement with linters and formatters rather than relying on code review alone.",[10,586,588],{"id":587},"try-it-yourself","Try It Yourself",[15,590,591],{},"Need to convert naming styles quickly? These tools help:",[564,593,594,602],{},[567,595,596,601],{},[597,598,600],"a",{"href":599},"\u002Ftools\u002Fcase-converter","Case Converter"," — Switch between camelCase, snake_case, PascalCase, and kebab-case instantly",[567,603,604,608],{},[597,605,607],{"href":606},"\u002Ftools\u002Fslug-generator","Slug Generator"," — Create URL-friendly kebab-case slugs from any text",[10,610,612],{"id":611},"related-guides","Related Guides",[564,614,615,622],{},[567,616,617,621],{},[597,618,620],{"href":619},"\u002Fguides\u002Fcamelcase-vs-snake-case","camelCase vs snake_case"," — Deep comparison of the two most debated naming styles",[567,623,624,628],{},[597,625,627],{"href":626},"\u002Fguides\u002Fcode-readability-tips","Code Readability Tips"," — Practical techniques for writing code others can understand",[630,631,632],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s9eBZ, html code.shiki .s9eBZ{--shiki-default:#22863A;--shiki-dark:#85E89D}",{"title":51,"searchDepth":79,"depth":79,"links":634},[635,636,642,643,644,649,650,651,652],{"id":12,"depth":79,"text":13},{"id":32,"depth":79,"text":33,"children":637},[638,639,640,641],{"id":40,"depth":92,"text":41},{"id":117,"depth":92,"text":118},{"id":146,"depth":92,"text":146},{"id":185,"depth":92,"text":185},{"id":220,"depth":79,"text":221},{"id":363,"depth":79,"text":364},{"id":434,"depth":79,"text":435,"children":645},[646,647,648],{"id":441,"depth":92,"text":442},{"id":459,"depth":92,"text":460},{"id":503,"depth":92,"text":504},{"id":545,"depth":79,"text":546},{"id":561,"depth":79,"text":562},{"id":587,"depth":79,"text":588},{"id":611,"depth":79,"text":612},"2026-05-28","Learn when to use camelCase, PascalCase, snake_case, and kebab-case — a practical guide to naming conventions across languages.","md",{"immutable":485},"\u002Fguides\u002Fnaming-conventions-guide",{"title":5,"description":654},"guides\u002Fnaming-conventions-guide","39acaf2WcNSpg2rILPCPEUUeu2jWEFxpIQcn_vBdNWw",1780401326864]