Rust Wiki

Revision Difference

CSharp_Formatting#526558

<title>CSharp Formatting</title>⤶ ⤶ # Who cares about formatting? I understand my code!⤶ ⤶ Take a look around. All the code your are basing your mods on has been written by other people. ⤶ ⤶ The reason you were able to get to this point was by other people being considerate enough to write code other humans can understand.⤶ ⤶ **Code is made for humans. Assembly language is made for computers**⤶ ⤶ It doesn't matter how long or short your variable names are, how much white space you use, how long or short your code files are. All that matters is that other humans can understand what you have written down.⤶ ⤶ Don't be lazy and write poorly formatted code to save time in the short term only to lose 10x the amount of time later on trying to work around the mess you have created. Trust me: you are not saving time.⤶ ⤶ And as a last warning: that sucker who is navigating through your web of code, cursing your name while furiously writing comments to explain 300 line functions and complete lack of classes will likely be **you**. You will not remember why you wrote something 6 months, 1 year, or 3 years ago. ⤶ ⤶ So treat that future person like you would want to be treated because it very likely be you.⤶ ⤶ With that 'motivational' speech out of the way, what guidelines should you actually follow?⤶ ⤶ # Variables In Classes⤶ ⤶ TLDR: ⤶ ⤶ * Capitalized means publicly accessibly⤶ ⤶ * Lowercase means only accessible inside class⤶ ⤶ * Underscore means internal use and don't touch if you don't need to⤶ ⤶ That said, the various ⤶ ⤶ **Private:** _varibleName **or** variableName⤶ ⤶ Use camelCase. Underscores `_` are not needed though are valid formatting.⤶ ⤶ **Internal:** VariableName **or** variableName