[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
Which are you? Spaces or Tab?
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: 81
Thread images: 8
File: muh_whitespace.jpg (93 KB, 600x468) Image search: [Google]
muh_whitespace.jpg
93 KB, 600x468
Which are you?

Spaces or Tab?
>>
>>53088122
I'm tabs, but I use IDEs that interpret my tabs as 2 spaces.
>>
Nice /v/ meme,now go back therew
>>
>>53088141
>4 space tab master race
>>
File: Screenshot_2016-02-20-18-16-57.png (423 KB, 1440x2560) Image search: [Google]
Screenshot_2016-02-20-18-16-57.png
423 KB, 1440x2560
>>53088369
>mfw "South pi" was accepted as the answer
:^)
>>
>>53088369
>4 spaces
You're just as bad as the tab fags :|
>>
https://www.kernel.org/doc/Documentation/CodingStyle

/thread
>>
>back in my day it was the same goddamn thing
>don't even understand this fucking nuprogrammer shit non-problem
Fucking hellshit.
>>
Why should i use spaces over tabs?
>>
File: 1455746887296.jpg (148 KB, 600x468) Image search: [Google]
1455746887296.jpg
148 KB, 600x468
Get out of my consumer board
>>
>>53088141
this but 3 spaces
>>
Hey so what is more professional to use?
>>
>>53088585
>>53088433
the # of columns a tab uses can vary by environment. A space always takes up one column. For this reason, spaces are generally considered better as they will produce more consistent results.
>>
7.5 space tabs master race
>>
File: app.png (9 KB, 468x371) Image search: [Google]
app.png
9 KB, 468x371
>>53088122
I actually prefer to code in Allman style with no leading indentation. This allows me to see more code on the screen at once and have a better sense of what my app does.
>>
I don't have to care anymore thanks to go fmt.
>>
Tabs, without a doubt. People who use spaces can choke on a fucking cock.
>>
>>53088792
That's some real inane code
>>
>>53088423
8 spaces: pretty good.

Less spaces encourage bad practice anyway, you should have a lot of functions, not long functions.
>>
>>53088819
this

tabs for indentation, spaces for alignment
>>
>>53088864
john carmack argues otherwise
>>
Tabs
Spaces are annoying to navigate with the keyboard, even using Ctrl Arrow Keys or other kinds of jumping. And I don't get any weirdness from the IDE trying to align my shit an odd number of spaces
>>
>>53088894
Source?
>>
>>53088122
TABS

>>53088412
You can adjust tab size in any proper editor
>>
2 spaces
>>
File: image_1.jpg (74 KB, 810x810) Image search: [Google]
image_1.jpg
74 KB, 810x810
when I first started coding, I used spaces when writing because I didn't really know how to change tab lengths, and the textbooks I was copying it from had no indication of correct indentation.

It's years on now, but the habit just stuck, I even use different numbers of spaces depending on what type of function. It's really quite bad, but the work otherwise is pretty decent, and nobody has complained further than
>2015
>using spaces
since legibility isn't an issue, so I don't real feel need to change
>>
File: SIGH.png (348 KB, 600x468) Image search: [Google]
SIGH.png
348 KB, 600x468
>>53088122
>>
>>53088662
the # of columns a tab uses can vary by environment. A space always takes up one column. For this reason, tabs are generally considered better as they will allow people to read code at the indentation level they are most comfortable with.
>>
spaces. It's what python promotes aswell.
>>
One tab one space
>>
Tabs are objectively better but it won't stop nerds from arguing about it.
>>
>>53088122
tab master race. spaces piss me off. with a tab you can hit home and left or right to get to the beginning of the line or beginning of the code.

with spaces you have to hit the arrows an ass load of times nomatter what. also if you have the thing turned on the see special characters tabs look allot cleaner, spaces just makes everything look like a clusterfuck.
>>
Tabs are 8 spaces. This is the standard. If you want to indent 8 spaces, use tabs. Otherwise, use spaces.
>>
>>53093189
Use a real editor, and you can manipulate space indents as easily as tabs.
>>
>>53088122
3 spaces
>>
>>53092877
That's the whole goddamn reason for tabs. People should be able to choose the way things look, and if you're code is dependent on spacing to be legible, you're writing shit code
>>
6 spaces
>>
>>53093287
How can you align variable types and names without using spaces?
>>
>>53093189
>>>53088122 (OP)
>get to the beginning of the line
> 0

> or beginning of the code
> ^
or
> I

See how much less angry you would be about whitespace if you used Vim/Emacs?
>>
>>53093234
great....
>>
>>53093306
Put them on a new line
>>
>>53093224
I prefer kate on linux and notepad++ on windows.
idk what you would call a "real editor"
>>
>>53093383
Not sure if Kate can do it, but vim/emacs/others can
>>
>>53093383
vi, vim or emacs
>>
>>53093411
tried them. it didn't just werk.
I have no problem with command line editors, I use nano for allot of shit, even taking notes in class.. but whatever the fuck I was looking at, I just dont have the patience for.
>>
>>53088122
depends on the language
>>
>>53093440
ok, so you're a moron, nice to know
>>
if (something &&
otherthing) {
|-------do_something();
|-------andthis(arg1, arg2,
|------- arg3, arg4);
}
>>
>>53093453
how so
>>
>>53088122
I use spaces.
Nano is the best text editor, all my programs are written with nano. I have never used emacs nor vim.
>>
>>53093458
Looks like shit. Those two conditions would be more readable on one line and then you can get by with another tab. If you need more conditions than is practical on one line, you should be calculating it in pieces beforehand
>>
>>53093462
Sorry, I don't speak to computer illiterates.
>>
>>53093593
I'm not going to use some cli editor for projects that have in excess of 10k lines of code per file.

probably the closest thing to a language you know is python.
>>
Spaces because fuckers don't get to have preferences when it comes to MY code.
>>
>spaces for alignment

Funny, the only time I use tabs is when I want to align output. A couple \t's will essentially ensure the numbers will come out nicely aligned.
>>
Soft tabs
>>
>>53088792
What language is that?
>>
>>53094628
something /g/ hates
>>
>>53094643
Say it
>>
>>53094647
J
>>
>>53094655
S
>>
>>53088792
pretty sure you have a severe case of autism
>>
>>53088122
4 or 8-space tabs, usually 8 as per >>53088423
>>
>>53094670
>everything i don't like is autism
when will this mentality go away?
>>
>>53094680
when autism goes away
>>
>>53088792
you should use more nested ifs for maximum readability
>>
3 spaces, semicolon, space, code, couple of tabs, semicolon
>>
>>53088122
Tabs for indentation, spaces for alignment (after indenting to block).

This style preserves the appearance and alignment of code independent of tab size, and can be losslessly converted into spaces only with a simple find and replace.
>>
>The tab key was designed specifically for usage in applications like indenting your code.
>Tab uses less space than multiple spaces
>Tab size can be changed to match the coder's desired visual style
>Tabs match the indentation size of whatever code you're copying to

Thank fuck for space indentation converters. I always converted spaces to tabs whenever I can.
>>
>>53093703
>in excess of 10k lines of code per file
then you've already fucked up
start again
>>
>>53095016
>never had to deal with large projects
its ok kid, maybe after you graduate highschool and find a job somewhere you might actually do some real work.
>>
>>53088122
tabs for makefiles, spaces for everything else. tabs don't play well with the web.
>>
>>53095279
but I have to use tabs at work because my faggot co-workers prefer them
>>
>>53088122
I used to care about shit like this but nowadays I just use clang-format and give up on maintaining a personal style.
>>
File: 14145700897_d289e393b1_m.jpg (12 KB, 240x159) Image search: [Google]
14145700897_d289e393b1_m.jpg
12 KB, 240x159
>>53088122
I let gofmt worry about that shit
>>
>>53094655
>>53094666
I still don't get why /g/ hates JavaScript. It's a pretty good language.
>>
>>53088443
Found the autist
>>
>>53097140
It is not. It is a crude deranged dangerously-lax practically-untyped inconsistent piece of shit that was hacked together in 10 days by someone who never expected it to be used for anything serious. It is a terrible, terrible language.

However:
1) Strict use of modern tooling (gulp, hintjs, browserify, ES6 transpiler) allows one to avoid and automate away many pitfalls
2) It is very flexible and allows one to reach a wide audience (and be suitable for many jobs)
3) The libraries, support, and general infrastructure and spectacular

So I can't say I hate it, and I actually end up using it all the time. But that doesn't make it a "pretty good language".
>>
>>53097246
>it is not good
>however, it is good
>>
>>53097260
>it is good
That is not what I said.

I said the language is (very) bad, but the other benefits of using JS (tooling, libraries) can mean that it's still worth using in some cases.

(And of course, in front-end, you don't really have a choice. But you can at least make the best of it.)
>>
>>53097246
>yfw your description applies nearly equally well to C
Thread replies: 81
Thread images: 8

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.