csdojo-defaang / defaang

A website that will curate recently-asked interview questions from FAANG+. Currently inactive. Check out: https://github.com/ykdojo/OpenStream
MIT License
509 stars 120 forks source link

style: use tabs in place of spaces #80

Closed iShibi closed 2 years ago

iShibi commented 2 years ago

👨‍💻 Changes proposed

This change reverts the following PR:

Tabs are much more fitted for indentation (opinion and open for discussion). It also allows users to customize the indentation width on GitHub which spaces can't do. The default render width of tabs on GitHub is 8 but can be changed by the user for themselves from settings > appearance > Tab size preference or temporarily by using ?ts=<size> at the end of the url.

Since, we had used tabs originally but converting them to spaces created merge conflicts in old PRs. This PR will fix that too.

vercel[bot] commented 2 years ago

Someone is attempting to deploy a commit to a Personal Account owned by @ykdojo on Vercel.

@ykdojo first needs to authorize it.

ykdojo commented 2 years ago

@iShibi thank you for explaining that.

When you put it that way, it makes sense to use tabs.

I would like to wait for other reviewers to see what they think though.

@subhoghoshX @rohitdasu?

ykdojo commented 2 years ago

and @mark-omarov in case you want to give your two cents on this

mark-omarov commented 2 years ago

Thanks. I don't think it's a big deal that worth a big discussion, both are viable choices, and with configured environment it comes down to simply choosing one over the other and sticking to it. I feel like if @iShibi has an opinion on it - I don't see any reasons not going his way, and configuring tabs as the main way of indentation for the project.

rohitdasu commented 2 years ago

I agree with @mark-omarov 👍

subhoghoshX commented 2 years ago

I see your point. I'm not too much against it either. But prettier uses spaces by default. I don't understand why the custom option was added in the config file in the first place. I don't usually see tabs enabled in any big project. Could you suggest a few big projects where it's enabled?

Adding ?ts=<size> is tiresome. And not many people are aware of changing it in settings, and even if some do, I don't think anyone would do it, as it affects the appearance of all the repos.

The only option is to set the tab indentation size for this particular repo only in an editorconfig file which I think PR #79 already addresses.

It's waste of time to argue whether tabs or spaces are better. There have been long discussions before, some of them spanning 2-3 years, with no resolution so far :laughing: So I'm going to just approve it. Feel free to merge it.