this post was submitted on 05 Sep 2023
156 points (79.3% liked)

Programming

17511 readers
358 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 1 year ago
MODERATORS
(page 4) 33 comments
sorted by: hot top controversial new old
[–] dukk@programming.dev 1 points 1 year ago

Honestly, my editor (Neovim) just picks between tabs and spaces for me, so I just end up using whatever's already there. The only language where I'll explicitly use one is Haskell, just because spaces there allow me to keep everything nice and lined up.

[–] ono@lemmy.ca 1 points 1 year ago
[–] insomniac_lemon@kbin.social 0 points 1 year ago* (last edited 1 year ago)

I'm tinkering with a whitespace language and prefer using 1-space rather than 2. I don't really like the double character for 1 level. Is that weird?

Tabs are forbidden though I could use tabs with a (1-line) per-file code filter for the compiler to turn 1 tab into 2 spaces, and that might be easier when working with others (though I don't know how it would be seen, especially needing to change editor tab behavior).

[–] SleveMcDichael@programming.dev -1 points 1 year ago (2 children)

Tabs let you define how big you want each indent to be, and spaces do not.

Spaces can too: Simply use more or less of them, to taste.

I have ADHD. Two spaces per indent makes it damn near impossible for me to scan code.

Then use four, or six, or eight, or 20. Hell, most code I've seen uses four spaces per indent anyway.

[Re: braille]

Surely there's an editor out there that will automatically display indent spaces as a tab character. Or failing that it seems like it would be rather trivial create a program to convert n spaces to tabs, and vice versa.

load more comments (2 replies)
[–] ck_@discuss.tchncs.de -1 points 1 year ago (1 children)

The choice of having tabs over spaces is essentially the same as putting up wheelchair ramp / elevators, tactile pavement, etc. or not.

You either care to make life easier for people with disabilities to participate in this particular form of social interaction or you don't give a fuck because "you don't like it".

[–] vzq@lemmy.blahaj.zone -2 points 1 year ago (5 children)

That’s all well and good if everyone uses editors you can configure to a certain standard all the time. Then tabs all the way.

Unfortunately that’s not reality for everyone.

load more comments
view more: ‹ prev next ›