![]() |
| |||||||
| View Poll Results: How do you indent? | |||
| Tabs | | 19 | 55.88% |
| 1 space per level | | 0 | 0% |
| 2 or 3 spaces per level | | 6 | 17.65% |
| 4 through 6 spaces per level | | 7 | 20.59% |
| 7+ spaces per level | | 2 | 5.88% |
| Voters: 34. You may not vote on this poll | |||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #31 | |
| Jaxom's & Imriel's Dad Join Date: Aug 2006 Location: Alabama
Posts: 866
| Quote:
Someone coding with two spaces should be taken out an horse whipped. just kidding. | |
| Kennedy is offline | |
| | #32 | |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,754
| Quote:
Here, since we do not specify specific tab width, we therefore leave line length unspecified as well.
__________________ "Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot | |
| brewbuck is offline | |
| | #33 |
| Code Goddess Join Date: Sep 2001
Posts: 9,664
| >then I started writing real code and it got sooooo ugly >and unreadable that I just couldn't do it anymore Real code gets out of hand quickly, not because of stylistic choices (assuming those choices are reasonable), but because real code is complicated and always evolving. It takes more work to keep it clean and readable, regardless of how much you indent.
__________________ My best code is written with the delete key. |
| Prelude is offline | |
| | #34 | |
| Jaxom's & Imriel's Dad Join Date: Aug 2006 Location: Alabama
Posts: 866
| Quote:
I've tried my very best to adhere to what Linus wrote -- his was a morph of the K&R style -- which they didn't teach at JSU -- we were just kinda left to our own devices about the style of our code. | |
| Kennedy is offline | |
| | #35 |
| MENTAL DETECTOR Join Date: Apr 2006 Location: United States
Posts: 3,280
| I'm pretty sure my editor uses tabs, so I use tabs, still, and always. In fact I expect my code indented whenever I type a brace and press enter. The length usually looks like 4 spaces but it's actually 8 spaces.
__________________ <Niggawatts> Writing is both mechanical and organic <Niggawatts> It's like a cyborg dragon. <Niggawatts> Writing is like a cyborg dragon. |
| whiteflags is offline | |
| | #36 | ||
| mastering the obvious Join Date: Jul 2008 Location: SE Queens
Posts: 5,092
| Quote:
I use tabs set to 4 characters but I don't care much, 2, 4, or 8 is fine. I switched from 8 to 4 because a block nested 6 or 7 levels deep is so far inset that you must start scrolling horizontally for long lines. I didn't vote because the poll seems flawed to me, insofar as it contrasts "a tab" with any number of spaces. I'll draw the line at one, tho. 1 character is not indentation. Last edited by MK27; 09-22-2009 at 03:09 PM. | ||
| MK27 is offline | |
| | #37 | |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,754
| Quote:
__________________ "Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot | |
| brewbuck is offline | |
| | #38 | |
| Unregistered User Join Date: Jul 2007
Posts: 980
| Does no one use 3 spaces? 2 is too few because everything looks more flush than it should. My code tends to have deep nests, and I abhor the horizontal scroll bar, so anything more is overboard. Like, 8. Seriously? I'll often use the tab key, but only if I've set the IDE to print 3 spaces instead. Quote:
__________________ May the Source be with you. | |
| Yarin is offline | |
| | #39 |
| Senior software engineer Join Date: Mar 2007 Location: Portland, OR
Posts: 5,754
| I used 3 spaces for ten years then switched to 4 spaces for murky reasons.
__________________ "Congratulations on your purchase. To begin using your quantum computer, set the power switch to both off and on simultaneously." -- raftpeople@slashdot |
| brewbuck is offline | |
| | #40 |
| mastering the obvious Join Date: Jul 2008 Location: SE Queens
Posts: 5,092
| Yes. I wasn't criticizing Kennedy, I was criticizing Mr. Torvalds. However, the part of the kernel source that I have looked at does seem to be mostly short functions and the nesting never gets past 3 or 4 levels, so maybe he is trying light the way down a certain path, I dunno. Last edited by MK27; 09-22-2009 at 07:12 PM. |
| MK27 is offline | |
| | #41 |
| Unregistered User Join Date: Jul 2007
Posts: 980
| Please, elaborate.
__________________ May the Source be with you. |
| Yarin is offline | |
| | #42 |
| Cat without Hat Join Date: Apr 2003
Posts: 8,492
| Seriously, what do I use? I use everything. The whole point of styles is that you stay consistent with existing code. Single tab for work. Four spaces for Boost. Two spaces for Clang. I've even used the evil GNU indentation style when working on GCC (I still have nightmares about that). What am I supposed to do with this little single-choice poll?
__________________ All the buzzt! CornedBee"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code." - Flon's Law |
| CornedBee is offline | |
| | #43 | |
| Mysterious C++ User Join Date: Oct 2007
Posts: 14,767
|
__________________ Using: Microsoft Windows™ 7 Professional (x64), Microsoft Visual Studio™ 2008 Team System I dedicated my life to helping others. This is only a small sample of what they said: "Thanks Elysia. You're a programming master! How the hell do you know every thing?" Quoted... at least once. Quote:
| |
| Elysia is offline | |
| | #44 |
| Confused Join Date: Sep 2001 Location: Sweden
Posts: 3,125
| Tabs, with equivalent size of 3 spaces. I don't code crazy stuff like: Code: void Func(int X,
int Y,
int Z);
__________________ MagosX.com Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime. |
| Magos is offline | |
| | #45 |
| Woof, woof! Join Date: Mar 2007 Location: Australia
Posts: 3,288
| 3 spaces, since I'm hardcore. And using non-even indent levels seems to have it's advantages (I'll get back to you when I work out what they are ).Plus, for vim I highlight all the trailing spaces and hard tabs so I know if some tool has mixed them up. Yes amazing... For those of you who want to unlock my magic Code: set list listchars=tab:\|_,trail:. EDIT: I'm disappointed Linus has popped up in this thread too! What is it with him? Last edited by zacs7; 09-23-2009 at 05:57 AM. |
| zacs7 is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Changing 3 spaces to tabs | dnguyen1022 | C Programming | 2 | 12-22-2008 12:51 AM |
| Tabs or Spaces | DavidP | General Discussions | 46 | 04-08-2007 11:45 AM |
| Visual C++ | Golffor1 | C++ Programming | 1 | 08-04-2003 04:30 PM |
| tabs to spaces with dev c++ v.4 | stallion | Windows Programming | 2 | 01-28-2003 02:07 PM |
| Tab Controls - API | -KEN- | Windows Programming | 7 | 06-02-2002 09:44 AM |