Why can tab spacing not be set in gists?

This is a follow up request to What's the deal with tab sizes on GitHub Gists?

There is an ‘Accepted Solution’ to an unresolved and ongoing issue.

I cannot paste code in spaces: 2 tab style, into gists and with it picking up the correct spacing, or at least rendering the correct spacing and it typically comes back out incorrect and inconsistent.

Furthermore why can’t I specify the rendering of tabs to be something actually reasonable for each gist depending on the best option for the application?. 8 char tabs is excessive.

<<Seems related: Configurable tab-size for project/repo UI (#26768) · Issues · GitLab.org / GitLab · GitLab

Seems

This below should all look great copy-pasta from vscode spaces:2 and here is the result. Brutal formatting

The image above should have at least pasted correctly as below which I had to manually correct after copy-pasta

Which should not be an issue, in addition to the underlying one of not being able to specify tab spacing to your liking (or within reason) in a gist eight auto detect on paste or set by user.

This has been in the pipleine litterally for years, any way to speed this up?

You have to admit that tabs:8 is excessive generally; tabs:4 is ok but bit dunce; and tabs:2 or spaces:2 is for the win all cases of tabbing, which is debatable but I think we can all agree tabs:8 || spaces:8 is no beuno.

There are outstanding questions in the open tickets as to the demand for this, which is there as this has been on going for years and not resolved.

There are also unanswered questions from the community, willing to help solve this issue, but no responses yet? Is there some administrative or high level issue here that is not easily fixed? How hard can it be to save the character formatting in a a gist or other project space via web UI or any other means? This seems like a reasonably easily ‘solved’ problem, why the long wait time?

If the .editorconfig ids needed why no file or account level file for gists?

This has literally been an issue for years, what’s the path to push this forward?

3 Likes

This is the reason to prefer spaces over tabs: no need to somehow configure every presentation outlet.

Spaces can make mess in indentations that’s why some developers hates them.
GitHub has a solution for one page (using a parameter in URL) but doesn’t want to make this as an option for all pages of a profile in settings.
It’s nearly impossible to read code on a phone.

1 Like

Sorry, I don’t understand? How can spaces make a mess of indentation? One space is always displayed as one space. You know exactly what it will look like.

1 Like

nope, it depends on the machine, we are not always sure of that,

Use tabs to indent the start of the line, one tab per indent level, and let everyone pick how wide they want that to be.

Use spaces if you’re lining up characters within a line, so they always line up regardless of tab size.

And find and punch all the early software authors who let this stupid thing become an issue in the first place.
(Seriously, why is this even something that’s discussed? Next you’ll be telling me you also want to use multiple characters for line breaks!)

coding style - Tabs versus spaces—what is the proper indentation character for everything, in every situation, ever? - Software Engineering Stack Exchange.

I’m not sure what you are saying? That the width of a space depends on the machine? That would only be true if you were picking non-monospace fonts, but you’ve recommended spaces for lining up characters within a line, so you can’t be using monospace fonts, so I still don’t know what you mean.

let everyone pick how wide they want that to be.

This is the problem: letting people pick means that every presentation outlet needs a control for the tab width so that people can pick. This thread is about Gists not having that control. If GitHub does provide that control, there will still be other places you put your code that still won’t have it, and you’ll complain to them about it. It’s playing whack-a-mole, and it will never end.

“Spaces,” reads one argument. “A tab could be a different number of columns depending on your environment, but a space is always one column.”

“Tabs,” reads the counter argument. “They’re a character specifically meant for indentation. They allow developers with different preferences in indentation size to change how the code looks without changing the code”

So there!

But the tabs part of the page ultimately strikes a conciliatory note. “Of course, consistency matters more than either one, and a good IDE makes the differences negligible.” But why spoil a good argument? “That said, the point of this thread is to be a holy war, so…”

And Jeff Atwood himself seems to agree — to a point. Back in 2009, he wrote “It doesn’t actually matter which coding styles you pick. What does matter is that you, and everyone else on your team, sticks with those conventions and uses them consistently.” But he couldn’t resist adding one more sentence.

“That said, only a moron would use tabs to format their code.”

I’m just sharing ideas here, I’m neutral to the topic because that’s not an issue for me, so I’m wondering why it’s really a big deal for others, stick to what you are using and that’s it

My main concern is not around spaces vs tab, they are both a character as mentioned earlier so I cannot see any reason for not getting the indentation correct when pasted regardless which is used.

My primary concern is there is no way to say hey gist display the tab width as anything other than width 8, which is far too large, 4 would be far more reasonable and really the sweet spot would be a ‘tab’ width of 2 regardless of the chars used or how tabs are represented.

Having the indentation spacing of width 8 make the code hard to read, especially if you are more than 1 or 2 indents in.

1 Like

Let’s not let “8col tabs are dumb” become the argument here versus “the user should be able to be change this here”. 8cols are the standard in xterm and most other terminal emulators as well as a ton of historical applications; while they’re not so common nowadays they’re a sane default.