What is the ideal indent size? Also should tabs or spaces be used?

What is the ideal indent size? Also should tabs or spaces be used?

Attached: tabs-vs-spaces.jpg (1440x679, 126K)

Other urls found in this thread:

ukupat.github.io/tabs-or-spaces/
twitter.com/NSFWRedditVideo

Why the fuck would anyone use spaces over tabs?

I always use tabs because I have to press it fewer times, and it's much neater when you have the space/tab icons turned on. It's just better.

A tab width of at least 4 is ideal. A lot of my lecturers use 2 spaces for indentation in the code they give us and I find it hard to read.

Easiest to convert tabs to spaces in the file if not everyone uses the same editors. You can still work with tab in your editor.

Tabs for indentation, spaces for alignment. This is elementary.

>tabs
>I prefer 4 spaces width!
>That's cool, I prefer 8 myself
>How about 2?
>I'm so glad we can each have it our own way without interfering with each others' preference!
>spaces
>YOU DO IT MY WAY OR FUCK OFF

I prefer tabs: for one, they take up less memory.
Alas, visual studio enforces spaces and I can't be arsed to change the settings.

Soft tabs are clearly superior
I use 2 spaces because of shitty low monitor res, but 4 is acceptable

I use 2 spaces for html and 1 tab of 4 for Python

Spaces. The only control characters you should ever use are line feed and carriage return.

>tabbing
we were never allowed to tab when I learned how to program
same for writing papers, we were always told to space five, absolutely no tabbing, idk why

I only use tab now to cycle through items/links but not in typing work

ugh I just shit my pants holy fuck

Attached: bitmoji-20180408105125.png (398x398, 60K)

Found the windows babby

The same answer to every style question, depends on the code style of your workplace. If you’re working by yourself just do what you enjoy the most. All editors can convert tabs to spaces anyway

Indentation is 8 characters. If you think that is too much and worry about running out of screen space, then you've probably already fucked up and no indentation style in the world is going to save you and your shitty code.

Attached: 1512970547858.png (817x443, 34K)

A lot of professors will tell you to do things without even knowing why and if you ask them they’ll give you some bullshit reason. I hate to meme but it’s the current year, editors are customizable enough that it doesn’t even matter.

Indentation is user/company policy defined. We’re not in the 80s anymore. You can define tab to be two spaces if you want, it’s a trivial stupid issue that only an autist would care about in this year

>itt retards who don't make any money

Attached: spaces.png (851x587, 204K)

All depends on the language.
Generally 4 spaces, but for things like Clojure and HTML markup I prefer 2 spaces.

Also always spaces, esp. for Clojure this is important for alignment

fuck you, you're the reason people shit their pants

I'll grant this, in languages that use their own conventions for indentation like Lisp or Haskell spaces are the only way to make it not look completely fucked up when someone else views your code in their editor

For languages with conventional block-structure indentation is pointless autism to declare that historical convention is indisputable fact

The old fashioned way: tab, which is 8 spaces long.

I'm actually surprised that numales itt have advanced to the point of using TWO spaces.

This is only because Google mandates the use of spaces. Get rid of them and we'd be seeing a happier, more readable world full of tabs.

Spaces sound like you're doing more work and take up more room on a HDD. So Spaces are better.

>

>both
>tfw I indent with 4 tabs

>he types his spaces manually one by one
please tell me you're joking

Do you have autism? What the fuck is your problem? Monkey brain fungus? What? Yeah, that's what I thought, fucktard.

i do a tab and two spaces so it creates a channel on the side of the screen that i can move the cursor quickly up and down the document with

>What is the ideal indentation character / width / bracing style / naming convention / line width limit?
The one specified in the style guide of the company/project you're working for/on.

>What if I'm a NEET / single developer?
Pick whatever convention you like and stick with it.

>Some conventions must be objectively better than others, though?
No.

>B-but I find convention A slower to read and uglier than B.
Human brain likes patterns. If you conditioned yours to recognize pattern B, pattern A will make it go "wait, what?" until you get used to it. Consistency is the only important thing.

You can set any editor that's worth using to convert tabs to spaces and custom tab width, so that's on you for abandoning the superior tabbing style because you were to dumb to edit configs.

You can enter spaces by pressing tab button, so who gives a fuck
You can also define any number of spaces on your tab button

What kind of retarded thread is this?
What's next? Keyboard comparisons and "ideal" desktop orientations?

It obviously has to be looking at a window. Who would orient his desk to a wall?

bhg
fuck you, I can't believe someone is so fucking retarded they don't understand the point of the thread. eat my shit, fucktard

I meant monitor. Portrait vs Landscape

I prefer tabs but I use 4 spaces because that's the default in most text editors and IDEs and I'm a conformist

this is actually genius

Attached: 1518196035725.gif (219x186, 1.76M)

>copy code from stackoverflow
>it uses spaces instead of tabs

Attached: 1481790478231.jpg (638x547, 23K)

4 spaces is optimal indent

Attached: tabs_vs_spaces.png (851x587, 190K)

1 tab + 1 space

ukupat.github.io/tabs-or-spaces/

only pajeet retards uses tabs.

luckily you just copy more code that replaces all spaces with tabs

I use one space lmao. Why would you use up so much screen space for indentation?

>ruby
>2 spaces
>100%
Truly patrician tier.

Should choose depending on (in this order)
>project
>language convention/standard/
>preferred code style
>personal taste

He has ascended human conciousness.

Left: programmer
right: nu-programmer