this post was submitted on 03 Jul 2025
23 points (100.0% liked)
Programming
21417 readers
338 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 [email protected]
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
BTW, my personal note about the tabstops for indentation is, I wish everyone would use it over spaces. Because it would make it much easier to display the file differently without changing it. Also parsing it would make it easier too probably. But since spaces are the standard, I exclusively use space for indentation.
I actually think the argument for mixing tabs and spaces makes a lot of sense. Use tabs for indentation, coupled with spaces for alignment (e.g. of function arguments). It eliminates the downsides of using tabs resp. spaces exclusively. But since nobody uses it, I never have either. Following the style of the project at hand is the way.
You mean alignment of arguments or multiline strings in example? If they are not on their own line, then it does not matter to me. If they start on their own line, then mixing spaces and tabs isn't a good idea to me. In example for function calls with a bit more complex calls and multiple arguments, I put them in their own line each. They are indented and therefore indentation level plays. If they are on the same line, I never align them and if I would, it would be spaces. In general:
I am very rarely working in other people's stuff because I am too rudimentary but of course I try to follow their rules when I do.
For my own purposes, I would do it in one of the below ways. I made the case more complicated by changing the lengths. I mostly choose consistent levels of indentation using tabs over per-character alignment but not always.
[--]
= tab,~
= single space (and double space = double space in front of comments for legibility here)Kate has a great feature called "insert smart newline" which I shortcut to
shift
+enter
. If you are typing for example on the penultimate line above and "insert smart newline" it'll automatically fill the line with[--][--]~~~~~ #:
and put the cursor at the end. This feature really enables a lot of these habits for better or worse.When I write output to terminal I really like being able to use
tabs
to modify the length of tabs according to what is the content. Sometimes I wish I could settabs
in my editor (like a word processor), it would make things simpler. But then there's portability issues for non standard features like that so.