[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]

Spaces or Tabs, /G/?

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: 56
Thread images: 4

File: hello world in C by Pcbots.png (285KB, 1600x900px) Image search: [Google]
hello world in C by Pcbots.png
285KB, 1600x900px
Spaces or Tabs, /G/?
>>
8-space tabs
>>
3 spaces
>>
>>60234723
8 is too much
>>
>>60234699
half tabs and half spaces
>>
Holy shit, kill yourself.
Literally setup your editor to insert 4 spaces for a tab. Who the fuck would really press space x times when they could just setup their shit to make tab insert x spaces.
>>
I go 8 spaces
>>
>comma after hello
>>
8-size tab or 4-size tab depending on language and size of the project
I prefer 4-size, 8 is too big to comfortably read for me

if you use spaces you are an idiot
and I'm not even talking about pressing space 4 times, for that you would have to be literally retarded
>>
>>60234756
it's the true unix(tm) way
>>
Tabs, with the tab NOT being spaces. If I want to remove the tab I don't wanna hit the fucking backspace button 4 times
>>
>>60234755
>>60234888
dubs and trips of truth
3-sized tabs, bitchez
depictured by yellow arrows
>>
>>60234905
ctrl+backspace
or shift+tab

but spaces are retarded still
>>
>>60234905
>If I want to remove the tab I don't wanna hit the fucking backspace button 4 times
You don't have to, in a sane editor/IDE, though.
>>
>>60234908
elaborate why 3 is better than 4
>>
>>60234905
>not 0dw<tab><tab> and v<
>>
>>60234928
it annoys both 4 and 8 space faggits
>>
2 as long as M-x whitespace-cleanup is available
>>
I like each of my code documents to have a healthy mix of tabs AND spaces. Sometimes on the same line.
>>
>>60234699
Mixed spaces and tabs.
>>
>>60234699
Spaces because tabs sizes are not consistent across machines and ides.
>>
tabs are spaces, I don't understand this "debate".
>>
spaces

ins 2017
>>
>>60234755
This guy gets it
>>
spaces are for real programmers
tabs are for numales
>>
>>60236938
Tabs, a key dedicated to alignment that in byte code are smaller than spaces
t. An intellect
>>
No spaces or tabs, just put it all on the same level.
>>
4 tabs
>>
\f
>>
>>60234699
Spaces? I write my programs all on one line.
>>
>>60234891
So K&R uses tabstop as 4 spaces.
Not sure if that is what they prefer in their code, or if they did that just for the textbook.
Linux kernel requires 8 character tabstops though.
>>
>>60235434
I think you're joking but this is actually fairly common if you're using tabs to indent, since you'd want to still use spaces for alignment (as the tabs can be set to any width).
>>
>>60234980
Why not pick something more normal with history behind it, like 5?
Tabstop used to be 5 on typewriters, then it was changed to 8 with computers because it was more efficient to use a power of 2 in binary.
>>
>>60234699
4 spaces mapped to the tab key is the only correct answer.
>>
>>60234699
>not encapsulating each single digit in a new class, then concatenating each character into a single string in the same fashion
>>
File: elastic.gif (526KB, 393x255px) Image search: [Google]
elastic.gif
526KB, 393x255px
elastic tabs, my man
>>
>>60239378
What editor?
>>
File: autism.png (52KB, 450x642px) Image search: [Google]
autism.png
52KB, 450x642px
>>60239397
>>60239378

>tfw not in editor yet

You'd think this would be a flashy new feature of VS by now.
>>
Spaces always

How many is determined by the language:

C gets 8
Java gets 4
JavaScript gets 2
Python gets 4
Tcl gets 3
Ruby gets 2
Haskell gets 4
Bash gets 5
Clojure gets 2

Why spaces? Because they're deterministic. You can make sure everyone is seeing the code in the same way and lining their columns up right. If you use tabs, there's always that one asshole who uses some crappy setup and delivers misaligned unreadable code.
>>
>>60239637
Tabs always, because presentation should be left up to each user. Set your tabstops appropriately and shut the fuck up.
>>
>>60239648
>presentation should be left up to each user
It really shouldn't. Does it really matter if you have to get used to looking at a different number of spaces for a project? No.

But does it matter if people keep delivering with fucked up formatting because they have to be a special snowflake? Yes, absolutely.
>>
Spaces

If you use tabs it fucks up alignment with other tab sizes and looks retarded
>>
File: 1466713508858.png (316KB, 637x476px) Image search: [Google]
1466713508858.png
316KB, 637x476px
>>60234699
>/G/
...
>>
Tabs don't work for alignment, so you have to use spaces for that:
int   n;
float x;
char c;


The OCD answer is to use tabs for indentation and spaces for alignment. The practical answer is to just use spaces for everything.
>>
>>60239742
Which is *exactly* what happens when you use spaces, because then every other faggot's stylistic choices are forced on you, where with tabs, they adapt to your preference transparently.

There is no good reason to use spaces instead of tabs. If you can force everyone on a project to use a certain number of spaces, you can by the same token force them to use tabs, write smaller source files, and then everybody gets to be happy.
>>
>>60238815
are you sure?
I remember it being 8 spaces
>>
tab to start a statement, spaces for the rest
>>
>>60239884
>The practical answer is to just use spaces for everything.
not really
the actual practical answer is to use whatever is agreed upon, and keep it consistent. which is usually tabs because that's often the default in IDEs

unless you're coding solo, in which case there isn't even anyone to give a fuck what you use
>>
>>60239220
typewriter fags btfo
>>
tabs for indentation, spaces for alignment
>>
>>60234699

tab indents, space alignments
>>
>>60234779
Tabs are for indentation spaces are for alignment. Don't replace tabs with spaces because whoever editing the file can set the tab width to their personal preference and the alignment will stay.
>>
>>60239637
> Tcl gets 3
I was sure it gets 4. Got any source or reason for that?
The basic guidelines I found were 4 spaces, 80 characters screen width.
>>
>>60239637

>You can make sure everyone is seeing the code in the same way and lining their columns up right.
protip: if you use tabs purely for indentation, this still happens
>>
Just use 4 space tabs; a good editor should only require one backspace to remove it
>>
>>60235857
>fuck you if you want to view my code differently!

Space fags needs to neck themselves.
Thread posts: 56
Thread images: 4


[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.