AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Coteditor indentions3/16/2023 ![]() ![]() With 2, you can see the indentation, but lots of nesting doesn't push your code out to ridiculous lengths, as you can see in the following: In WebSanity's opinion, 8 is far too many, 4 is acceptable but a bit too large, & 2 is just right. The next question is, how many spaces get inserted when you press TAB? Basically, people either choose 2, 4, or 8 spaces. Note: If anyone knows of any others that I should add, let me know. Notepad++: Preferences > Language Menu/Tab Settings > Replace by space.Komodo Edit: Options/Preferences > Editor > Indentation > Prefer Tab characters over spaces.BBEdit: Preferences > Editor Defaults > Auto-expand tabs. ![]() Different text editors call that setting different things. Your text editor should let you choose what gets inserted when you press the TAB key: a tab or spaces. WebSanity uses spaces, for various reasons, so that is the right choice, clearly. Should you use spaces or tabs for indenting? A debate has raged on this topic for decades, with different developers insisting that theirs is the right choice. The trick is finding it in the editor's Preferences or Options. Auto-indentīBEdit, for instance, has a setting in its Preferences for "Auto-indent", which it defines as follows: "When this option is selected, pressing the Return key in new windows automatically inserts spaces or tabs to indent the new line to the same level as the previous line."Īny good text editor should have a setting like this somewhere. Fortunately, good text editors help you out when it comes to indenting. You could press tab or the space bar every single time you want to indent your code, but you shouldn't have to do that. Your text editor should make it easy to indent your code
0 Comments
Read More
Leave a Reply. |