[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Well?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 24
Thread images: 3

File: tabs-vs-spaces.jpg (126KB, 1440x679px) Image search: [Google]
tabs-vs-spaces.jpg
126KB, 1440x679px
Well?
>>
>>56064147
>Well?
Well what?
>>
>>56064159
Which is better?
>>
>>56064167
Tabs.
Now get out.
>>
Neither
Indentation is a meme
>>
>>56064167
You should conform to the standards that people using your programming language use.

If there are no standards, then you should use the standard that the project you're working on chose.

If it's your project, and there are no language standards, then you should choose whichever you want and state that this is a convention for the project.

It's not rocket surgery.
>>
>>56064147
https://www.kernel.org/doc/Documentation/CodingStyle
>Tabs are 8 characters, and thus indentations are also 8 characters.
There are heretic movements that try to make indentations 4 (or even 2!)
characters deep, and that is akin to trying to define the value of PI to
be 3.
>Rationale: The whole idea behind indentation is to clearly define where
a block of control starts and ends. Especially when you've been looking
at your screen for 20 straight hours, you'll find it a lot easier to see
how the indentation works if you have large indentations.
>Now, some people will claim that having 8-character indentations makes
the code move too far to the right, and makes it hard to read on a
80-character terminal screen. The answer to that is that if you need
more than 3 levels of indentation, you're screwed anyway, and should fix
your program.
>In short, 8-char indents make things easier to read, and have the added
benefit of warning you when you're nesting your functions too deep.
Heed that warning.
>>
>>56064291
8-char indentations are too fucking wide.
>>
>>56064302
>>Now, some people will claim that having 8-character indentations makes
>the code move too far to the right, and makes it hard to read on a
>80-character terminal screen. The answer to that is that if you need
>more than 3 levels of indentation, you're screwed anyway, and should fix
>your program.
>>
>>56064359
8-char indentations are too fucking wide.
>>
>>56064291
>Linux lecturing people on code quality

wew
>>
I use 4-column wide tabs for indentation and spaces for aligning within a line, crontab/fstab for example, so it maintains alignment on machines where tabs have different columns widths.
>>
>>56064269
This
What a fucking pointless thread. { Fuck you op
}
>>
>>56064395
This is how I do it too.

Like if I have a large if statement that I want to break into multiple lines I try to fit each line in the same width.
>>
>>56064359

Default for general code is 1 indent, anything inside of a function. Add a for i, then a for j, then throw in an if statement and you're already at 4.

If you don't think looping across a 2-dimensional array is a valid coding option, well... you're confirmed for a poorfag that doesn't make money off of programming.
>>
Tabs for indentation. Spaces for manual alignment.
>>
>2-space soft tabs master race
>>
I use 2 spaces per indentation level, and I even considered to switch to one space. I don't like tabs at all.
>>
4 width tabs. Spaces make it annoying to move with arrows.
>>
I use 3 space tabs, odd primes are more secure.
>>
File: whiskey.png (11KB, 429x410px) Image search: [Google]
whiskey.png
11KB, 429x410px
>>56064536
>>
>>56064302
If you use tabs then you can set the display width to whatever you want.
>>
>>56064536
I use 3-space tabs because they look better.
>>
>>56064167
Whatever the company or group decides. Keep your shit consistent.
Thread posts: 24
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.