this post was submitted on 10 Feb 2024
629 points (100.0% liked)

196

18151 readers
701 users here now

Be sure to follow the rule before you head out.


Rule: You must post before you leave.



Other rules

Behavior rules:

Posting rules:

NSFW: NSFW content is permitted but it must be tagged and have content warnings. Anything that doesn't adhere to this will be removed. Content warnings should be added like: [penis], [explicit description of sex]. Non-sexualized breasts of any gender are not considered inappropriate and therefore do not need to be blurred/tagged.

If you have any questions, feel free to contact us on our matrix channel or email.

Other 196's:

founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] ToastedPlanet@lemmy.blahaj.zone 5 points 2 years ago (1 children)

If prefer two spaces per indention instead of tabs, but otherwise I agree with the choice of style.

[–] BeigeAgenda@lemmy.ca 5 points 2 years ago (2 children)

Tabs has no place in code, just recently I started a project with four space indentation, that quickly got changed to two.

[–] zea_64@lemmy.blahaj.zone 12 points 2 years ago (1 children)

Change your tab width, but tabs are literally made for indentation.

[–] BeigeAgenda@lemmy.ca 3 points 2 years ago (1 children)

The reason I loathe tabs is that over time a codebase with tabs becomes mixed tabs and spaces and unless your editor shows tabs you can't see them.

In the end you have to choose either spaces or tabs, and enforce it with some lint tool.

[–] Luvon@beehaw.org 4 points 2 years ago

That last line is the solution though, choose a linter, enforce all style arguments, so they are just the way the code is. No arguments.

Every single project I work on is setup with prettier. With Java there is a maven plugin that runs it on compile. And with ts projects it is part of the built pipeline.

I wish I could use prettier for Abap, reminds me how much I like having an opinionated formatter. I don’t like wasting time formatting code manually.

Abap has one formatter that is not very opinionated, and lets way more to much wierd spacing through, especially for a language that is as verbose as abap.

[–] _cnt0@sh.itjust.works 9 points 2 years ago (1 children)

I love compromises, so I use 3 spaces for indentation.

[–] BeigeAgenda@lemmy.ca 4 points 2 years ago (1 children)

Some people just want to see the world burn 😁

[–] _cnt0@sh.itjust.works 3 points 2 years ago

It's warm and bright when everything burns.