#indentation

2025-05-29

I'm researching for a rewrite of our OData tutorials in our SAP Developer Centre and came across this example of an Atom feed (you know the connection, right?). I cannot unsee the absolute randomness of indentation here, so I thought it only right that I share it here. #XML #Indentation #Atom #OData

An example of an Atom feed from https://www.ibm.com/docs/en/baw/22.0.x?topic=formats-atom-feed-format where the indentation to denote the nesting of XML elements is sometimes 1, 2, 3, 4 or 8 whitespace chars.
2025-05-26

What's a command-line tool to hard-wrap a file but preserve #indentation ?

(No, I'd never hard-wrap anything willingly, but sometimes you have to bow to evil in order to achieve greater good.)

#wrapping #linux #opensource #terminal

Dominik Leipolddpl@muenchen.social
2025-04-11

I have #legacyCode with #indentation switching arbitrarily between 1 and 2 spaces
I shit you not

I do not love my job every single day.

Gary "grim" Kramlichgrimmy
2025-01-03

This is what I imagine people's code looks like when they complain about the forced indentation in .

And yes, this code is correct.

A very messy implementation of fizzbuzz mixing tabs and spaces, unaligned braces, inconsistent spaces around operators and semi colons and even more grossness.

The full code follows if you would like to try it out.

#include <stdio.h>
void main(void)
  {
  	for (int i = 0 ; i <100;i++)
{
		if(i% 15 == 0 ) {
			printf("fizzbuzz ");
		  }
	else   if(i % 3==0 )
	{
		printf("fizz " );
	 }
	 	else if ( i %5==0) {
	 		printf("buzz ")  ;
	 	}
	  else
	  	printf( "%d " ,  i);
  }
}

Judging a programming #language based on whether it uses #braces or #indentation for block scoping is like judging a dinner course by the shape of the pot it was cooked in.

#python #dinner #dish #course #block #scope #syntax #programming

Inautiloinautilo
2024-10-17


Lessons from plain text Β· β€œPlain text might not always be as straightforward as it appears.” ilo.im/160erg

_____

Frost, glow wolf 🐺:therian:IceWolf@masto.brightfur.net
2024-10-16

Periodic reminder that fuck YAML

Do not try to mandate what indentation we use. Last I checked this config file is OURS, not yours, YAML spec writers.

#YAML #indentation

Kevin Karhan :verified:kkarhan@infosec.space
2024-10-10

@krutonium also #Tabs don't fuck with other peoples' #IDE and correlate with #indentation depth easily.
youtube.com/watch?v=V7PLxL8jIl

  • In fact, I always insisted on #TabsNotSpaces for formatting and also use #TSV over #CSV because one may want to use #comma in a field for like correct decimal designation.
Stephane L Rolland-Brabant β‚β§–βšstphrolland@mathstodon.xyz
2024-08-31

@tth

There is an ongoing underground global war where you have chose a side: either TAB or SPACE

I was on the TABS side, for many years

I cannot tell you how i have been caught, I have no memories left, no trace of my former life where TABS was my default indentation key, whatever the language

I assure you the <Space> people are really friendly. They have not hurt me. I just no longer use the TAB key, that is the only difference

#python #indentation

Now, I have been told there is a growing schism between 2-space indentation and the 4-space indentation

Given the galactically-known wisdom of the bipedal cousins of the chimpanzees, we can be sure they will bury the axes of war

PEP8 advises to stand with space-4 as the prefered pythonic way of indenting

2023-12-23

Coding indentation styles. I'm a K&R man, myself.

en.wikipedia.org/wiki/Indentat

If you are a Horstmann person, please unfollow.

#developers #programming #coding #dev #indentation #format #coders

Kagan MacTane (he/him)kagan@wandering.shop
2023-12-08

Spicy take: If your software development team is using Prettier, you should set it to indent with tabs, not spaces.

That makes it easy for everyone to set whatever indentation depth they want, and even adjust it if they feel the need. Someone who can pick out a 4-column indent better than 2 will have trouble reading that "indented with 2 spaces" stuff, but tabs let everyone coexist.

#SoftwareDevelopment #coding #programming #webdev #code #Prettier #indentation

2023-09-22

Googled "#vim heuristic #indentation", wasn't disappointed. 🀯

2023-08-17

Dynamic Tabbing For Automatic Indentation With The Layout Rule
(1998) : Lapalme, Guy
DOI: doi.org/10.1017/s0956796898003

Technotramptechnotramp
2023-08-02

@Catweazle

That's very . To me the are complete after and the works for me too. Can I have a ? Can you please tell me what you are using? Ideally and operating or at least one of the above. I'd be happy to it, but I can't bring up the . I've tried two readers at the same and it's been ok..

George Ztypeable
2023-07-11

Historic question: I remember that more than a decade ago everyone (i know of) exclusively used four spaces for . Now I see almost-exclusively two spaces for indentation. When did this switch start? What's the trend?

Can someone scrape dotfiles repos on github and their histories and plot that change in people's vim/emacs configs?

I suspect that it's correlated with the popularity of modern webdev brought by its Mariana-deep <div> nesting.

Nataniel Farzannatanielf@floss.social
2023-07-06

If you could only indent your code with either tabs or spaces from now on, which would you prefer to use?

Without considering the norms/preferences in specific languages, which one do you personally prefer to work with?

Reply with your reasoning if you'd like - please keep the discussion civil though πŸ˜…

#tabs #spaces #indentation #formatting #code

2023-05-29

@mattwilcox Oof, this hits hard, because my interest in #accessibility completely agrees with you, but this is such an unpopular opinion that making such a transition will be a long and tricky process (not to say it's not worthwhile), and I'll have to work out how to configure various linters and code formatters to do the right thing.
Have you found code formatters can usually be configured to use tabs without too much trouble?
(In particular, I've not yet worked out if I can make autopep8 or similar go against its grain and *not* just do 4-space indents.)
#indentation #tabs #spaces #tabsOverSpaces

Michael Zeevimaze@fosstodon.org
2023-03-19

Do you prefer your #YAML lists indented or not?

```
a:
- foo
- bar
b:
- foo
- bar
```

(please boost to gather more replies to the poll!)

#syntax #indentation #prettify #code

Sham πŸ³οΈβ€πŸŒˆshammers@mastodon.coffee
2023-01-03

I was once a strong believer in spaces over tabs for indentation. I'd map my tab key to 4 spaces. I had vim auto-convert tab characters to 4 spaces, etc.

Then it was brought to my attention how awful spaces are when it comes to accessibility for those with visual impairments: adamtuttle.codes/blog/2021/tab

I now prefer tab indentation over spaces with the exception of languages that require spaces for indents.

#Disabilities #Programming #Indentation #Accessibility

2022-12-21

@tojosan Adopt PEP8 formatting early and if you post online asking for questions make sure your formatting works. #indentation #4spaces

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst