Space vs. Tabs or are you using Vim over Emacs?

This could lead to a serious argument :rofl:

I am using:

  • Tabs and Vim
  • Spaces and Vim
  • Tabs and Emacs
  • Spaces and Emacs
  • None of the above

0 voters


The people have spoken!



There are polls and polls. It’s ok if people don’t like your polls. :laughing:

1 Like

Lol, I think the tabs vs spaces argument is just as dead as the vi vs emacs argument. :laughing:

In the former case, the standards have become pretty clear. In the latter, almost nobody cares anymore.

1 Like

Was wondering if that is still a thing. So are Tabs or Spaces standard to your opinion :rofl:

Just thought that clip from Silicon Valley is hilarious.

If you are talking about programming, spaces are overwhelming standard. Almost all coding standards/style guides specifies spaces.

On the other hand, if we are writing a document, tabs are much more common.

1 Like

I use micro for terminal text editing, vs-code for programming.
I use tabs in python for indenting code


Most of the dedicated Python editors will complain about this since it isn’t compliant with PEP.

Also, Python won’t let you mix tabs and spaces so if you ever work with anyone else they will probably hate you when they have to convert your code to use spaces every time they touch it.

How many space do you use for a Tab, four?

I usually use 4 by default but many editors will read the indent levels in the existing code and automatically match to whatever already exists.

1 Like

I have been coding in python for over a year and I write code mostly in jupyter notebooks. I am not super familiar with dedicated python editors.
Indenting with tabs was a practice I carried over from coding in matlab and makes my code more readable

Doesn’t Jupyter convert tabs to spaces when working with Python?

I mean, almost everyone uses the tab key when writing code. It is just that most editors convert them to spaces automatically. Code readability should be identical either way.

Then I’ve been doing it the right way all long?
If code editors convert tabs to spaces anyway, then what is this debate about?

You have to watch the video to understand… It’s not serious of course but some people seem to take it seriously.

Just saw the video, it’s hilarious.

Why do tabs use less space though?

1 Like

Because a tab is a single character. 4 spaces is 4 characters.

That being said, in the real world, that is an irrelevant amount of space.

Of course - the real world has changed a lot over the years. I remember coding back when, and had to use key-combo short forms for keywords to save the RAM while coding. Then, things moved on a little, and I could combine that with coding that way on a ‘more memory’ machine, and compile the result to make it fit…

Sorry for the C64 and C128 memories!

Most modern text editors have a setting to convert tabs into spaces, so I use that. I press Tab but the output is 2 or 4 spaces (depending on the programming language).

I like my code to fit into 80 columns, so I typically use small indentation. With C, I typically use 4 spaces per indentation level, because that makes the code look AESTHETIC :dolphin: but with C++ I only use 2 spaces per indentation level, because of all the verbosity, e.g. namespace::namespace.

When it comes to Vim vs. Emacs, I’m 100% in favour of Vim. I just don’t like Lisp.

1 Like

What do you do with Cobol? :grin:

I’ve never even tried to make stuff fit into 80 columns - one of the big advantages of today’s resolutions is that 120-160 columns is so easy! Mind you, C tends to end up fitting anyway…:face_with_open_eyes_and_hand_over_mouth:

As for editors - I’ve had to change so many times that it almost doesn’t matter anymore… I just avoid BOTH Vim and Emacs! The best I ever used was a little gem written in assembly on the Amiga: CygnusEd Professional. It could easily get over 3,000 search and replace ops/sec, allowing ‘shorthand’ coding - and the columnar ops were simple too, via mouse or keyboard.

How’s that for OT while on topic? :grin:

1 Like