The tag has no wiki summary.

learn more… | top users | synonyms

7
votes
5answers
320 views

Keep indentation level low [duplicate]

I hear a lot that you should not write functions larger than one screen size, that you should extract things into functions if you call things very often and all these coding guidelines. One of them ...
7
votes
4answers
465 views

How strict should you be about indentation/white space? [closed]

Our development process is as follows code the task -> someone else QAs code and documentation -> task is merged into trunk. Recently a colleague is refusing to pass the code QA due to issues with ...
15
votes
7answers
852 views

Should I write compact code or code with lots of spaces? [duplicate]

I have two friends that have completely different schools of thought on how to lay out their code. The first says that code should be well-indented and use lots of spaces and to name variables ...
9
votes
5answers
824 views

What are the downsides of mixing tabs and spaces? [duplicate]

The advantage of using tabs for indentation is that people can configure their editor to use the tab width they are comfortable with. The only argument against this seems to be that people don't want ...
0
votes
2answers
249 views

Indenting/formatting brackets like { } and [ ] [closed]

Is there an application that can easily align/format brackets such as [ ] { and } ? e.g. change { { } } into { { } }
0
votes
0answers
281 views

Heredoc or an external template file in my bash script - how it affects readibility/maintanance?

I realise that this question may be down to personal preference but I'm pretty new to bash/shell scripting so thought it'd be worth some research to see if there's some sort of standard/best practise ...
7
votes
6answers
953 views

Indentation: is there any evidence to show whether 2 or 4 spaces is more readable? [closed]

At the company I work for, we're trying to standardize our development practices, and we want to make the right call regarding indentation. Is there any empirical evidence (preferably research ...
12
votes
5answers
533 views

Reformatting and version control

Code formatting matters. Even indentation matters. And consistency is more important than minor improvements. But projects usually don't have a clear, complete, verifiable and enforced style guide ...
1
vote
4answers
522 views

Indenting labels in C

I noticed that in the Vim automatically indents labels in a rather unintuitive way (IMHO). int main(void) { goto end; end: return 0 } Are there any style guidelines for labels? For the ...
3
votes
3answers
226 views

Eliminating tab characters in a new language

I'm working on a new programming language, which determines structure with indentation instead of braces in the manner of Python and CoffeeScript. Obviously placing lines indented with spaces next to ...
59
votes
11answers
3k views

What are the drawbacks of elastic tabstops?

Look here: a typical holy war on tabs vs spaces. Now look here: elastic tabstops. All problems solved, and a bunch of very useful new behaviours added. Are elastic tabstops even mentioned in that ...
9
votes
5answers
718 views

Why do some languages recommend using spaces rather than tabs?

Maybe I'm alone in this, but few things annoy me like people indenting using spaces rather than tabs. How is typing SpaceSpaceSpaceSpace easier and more intuitive than typing Tab? Sure, tab width is ...
8
votes
7answers
5k views

C/C++ Best indentation length? [closed]

I was reading a Vim tutorial ( http://www.oualline.com/vim-cook.html#drawing ), and came across this: This is very useful if you use a 4 space indentation for your C or C++ programs. (Studies at ...
2
votes
2answers
923 views

Why do XSLT editors insert tab or space characters into XSLT to format it?

All XSLT editors I've tried till now add tab or space characters to the XSLT to indent it for formatting. This is done even in places within the XSLT where these characters are significant to the XSLT ...
14
votes
2answers
9k views

What is the difference between K&R and One True Brace Style (1TBS) styles?

I have read the Wikipedia article on Indent Styles, but I still don't understand. What is the difference between K&R and 1TBS?
205
votes
15answers
22k views

How can a code editor effectively hint at code nesting level - without using indentation?

I've written an XML text editor that provides 2 view options for the same XML text, one indented (virtually), the other left-justified. The motivation for the left-justified view is to help users ...
13
votes
8answers
313 views

Styling compound AND / OR if statements

How do you style complex compound AND / OR if statements for maximum readability? How do you indent and where do you place the line breaks? My particular situation is something like the following. ...
1
vote
2answers
189 views

“Functional” php indentation

I'm a big fan of 1tbs when it comes to c-like languages. Now that php got decent lambdas and closures, though, I'm not sure the style I'm using for them (fundamentally made up, has something to do ...
4
votes
4answers
294 views

Correct alignment when outcommenting code

Suppose I have some code void some_block(void) { some_statement_1(); some_statement_2(); some_statement_3(); } Now I wish to out-comment statement #2, but here I never can find a way ...
12
votes
9answers
906 views

How to prevent deep indentations?

What steps and measures can I take to prevent deep indentations in my code?
4
votes
2answers
387 views

Writing a style guide, what are the best examples for breaking long lines?

You are writing a style guide and you are at the chapter about breaking long lines. What would be the best examples of long lines to demonstrate your rules of breaking long lines. The examples ...