what do you prefer?
1:
Code: Select all
int main(){
}
2:
Code: Select all
int main()
{
}
Moderator: General Mods
Code: Select all
int main(){
}
Code: Select all
int main()
{
}
Code: Select all
void func()
{
<code block>
}
Code: Select all
if (test) { <single line> }
Code: Select all
while (huge_test || line && (here > kthx))
{ <or maybe that single line is a bit fat> }
Code: Select all
do
{
if (formula[i] == last) { times++; }
else
{
sprintf(workbuf, "%s%u*%u", (*buffer) ? " + " : "", bases[last], times);
if (times == 1) { workbuf[strcspn(workbuf, "*")] = 0; }
last = formula[i];
times = 1;
strcat(buffer, workbuf);
}
} while (formula[i++]);
total -= RANGE_MIN;
if ((!strlen(best[total])) || (strlen(buffer) <= strlen(best[total])))
{ memcpy(best[total], buffer, 1024); }
Code: Select all
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Code: Select all
void func() {
ftw();
}
Which IIRC is just 2 bytes, if that.byuu wrote: No sense wasting an extra line
Code: Select all
getName() { return name; }
Code: Select all
//code comment here
do {
} while TRUE;
//comment for the next block of code
if (0 > 1) {
//meh
meh(1);
} else {
//not so meh
neh(0);
};
Code: Select all
if( x == 3 )
{
//do something
}
else if( x == 4 )
{
//do something else
}
else
{
//shouldn't get here - it means somethings screwy elsewhere
}
Code folding is a good IDE feature you might want to use further, if you haven't already.byuu wrote:I said "no sense wasting an extra line", and not "no sense wasting another two bytes of disk space". With my text editor, I see about 25-30 lines onscreen at once. With my functions, generally 5-8 of those lines contain opening brackets. Therefore, I can see more of my code at one time, which for large functions, is a good thing (tm).
That would be a killer for me. 4 spaces tops. Much more comnfortable for my reading. Same goes for xHTML/xml.creaothceann wrote:Tabs, default size of 8 chars. No, I haven't run out of horz. space yet.
I think you want soft tabs or something. Crimson editor lets you convert between spaces and tabs at any time.creaothceann wrote:<rant>
The problem with tabs is that they are inserted into the files just like you entered them. Editors should just use the TAB key to goto the next column, and insert tabs when the file is saved.
</rant>
Define display. if by that you just mean a place where the column number is displayed, any decent editor should havce one. If you mean a "show column number", I don't think it exists, probably because of vwfs.Btw. are there editors that display the columns? Haven't ecountered one yet, afaik.
editors that save tabs as spaces suck major ass. get you a better editor ma friend. and codeblocks has a show indentation option that puts vertical lines where columns are.creaothceann wrote:Tabs, default size of 8 chars. No, I haven't run out of horz. space yet.
<rant>
The problem with tabs is that they are inserted into the files just like you entered them. Editors should just use the TAB key to goto the next column, and insert tabs when the file is saved.
</rant>
Btw. are there editors that display the columns? Haven't ecountered one yet, afaik.
Code: Select all
void foo () {
if (bar) {
//do stuff
} else {
//do other stuff
}
}
Alright, I'll check it out.MisterJones wrote:I think you want soft tabs or something. Crimson editor lets you convert between spaces and tabs at any time.creaothceann wrote:<rant>
The problem with tabs is that they are inserted into the files just like you entered them. Editors should just use the TAB key to goto the next column, and insert tabs when the file is saved.
</rant>
No, not the column number. I mean the columns, as in colored vertical bars behind the code (or single colored lines between the columns).MisterJones wrote:Define display. If by that you just mean a place where the column number is displayed, any decent editor should havce one. If you mean a "show column number", I don't think it exists, probably because of vwfs.Btw. are there editors that display the columns? Haven't ecountered one yet, afaik.
I can save tabs as spaces. The problem is, during loading a file, converting from spaces to tabs. And I want them because tabs drastically speed up the cursor scrolling and help with the code formatting.OutrightOwnage wrote:editors that save tabs as spaces suck major ass. get you a better editor ma friend. and codeblocks has a show indentation option that puts vertical lines where columns are.
I think no editor has support for that.creaothceann wrote: No, not the column number. I mean the columns, as in colored vertical bars behind the code (or single colored lines between the columns).
While the second point is valid, by ctrl scrolling (ctrl+left or right) your first point is mootcreaothceann wrote:And I want them because tabs drastically speed up the cursor scrolling and help with the code formatting.