[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Tabs or Spaces - what's superior and why?
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 37
Thread images: 1
Tabs or Spaces - what's superior and why?
>>
>>51796338
tabs - you can use them in Makefile
>>
spaces in an editor that vertically aligns text to the next mod4 column
see https://www.jwz.org/doc/tabs-vs-spaces.html
>>
tabs for indentation and spaces for alignment
>>
Why not both?
>>
>>51796338
depends
>>
Tab = n(space)

I prefer 4 spaces per tab press personally. Guarantees uniformity across editors. Fuck word wrap ever
>>
>>
>>51796338
it makes no difference when you print it out, so it doesn't matter.
>>
4 spaces no word warp
>>
>>51797053
>no word warp
>i enjoy scrolling my text editor all the way to the right every time i have to write a large ass print statement
>>
>>51796338
Tabs because fewer keystrokes
>>
>>51797068
You can usually break up lines/statements trivially in most languages to keep a clean 80 character limit.
>>
>>51797100
80 characters is only good for assembly, you can go 150 easy
>>
I feel like you are all stupid.

The question is do you put the mentally retarded '\t' character in with your tab key or do you put x spaces in with your tab key.
>>
>>51797100
You can, and most style guides require you to do that, but word wrapping helps you do that a whole lot faster.
>>
>>51797068
you can break up lines pretty easily in any half decent language

and it just fucks with your perception of your code when youre scrolling through it after some time after writing it
>>
>>51796338
>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.
>>
Tabs
>>
>>51796338
Who is that jizz genie?
>>
>>51796338
Who is the cum commando?
>>
I never use the tab key, just about every programming editor that exists will do automatic indent for you. The tab key is taking valuable space that should be used for something else, I prefer to remap the tab key with the alt key. So tab is right next to the tab bar should I ever need it.
>>
>>51796366
fucking makefiles
>>
>>51796338
Tabs.
If you use spaces, kill yourself.
>>
>>51797218
this

tabs are litterally a holdover from what programming was done on teletypes and there was no way to do auto-indent like any visual editor would do
>>
what's the difference, isn't a tab 4 spaces. Do you prefer tabs because of consistency
>>
So the answer to OPs question is unclear. (?)

My thoughts:

- tabs may be helpful for reading the code and change indentation by software to the users likes

- are spaces helpful in any situation?
>>
>>51796338
Whoa, those are some gigantic tits
>>
>>51796338
Whatever standard your company specifies.
>>
>>51797218
>tabs are human defined
>pi is a universal constant likely caused by our base ten system
>tabs can be whatever size humans say
>pi must be 3.14159265... Whilst we use a base ten system
OCD amongst programmers... Not even once.
>>
tabs
hate it when an IDE turns my tab button into spaces
>>
>>51799784
What IDE does that?
>>
>>51796338
spaces

a good editor will handle things automatically though
>>
>>51797218
>more than 3 levels of indentation means that your program is screwed
I understand that it wouldn't be good for efficiency, but what if it's the first time someone was writing a program to do something like that?
>>
>>51799165
No.spacesaretotalyuseless.thereisnopointinusingthem.
>>
>>51797218
>sizeof is a function
>>
>>51801149
when I load someone else's project into Visual Studio Code

"we noticed that this is using spaces kek"
Thread replies: 37
Thread images: 1

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.