tobiashofmann / sap-dev-tech-radar

Tech radar for SAP Devs. Visualizing the SAP developer technology choices.
https://tobiashofmann.github.io/sap-dev-tech-radar/
Apache License 2.0
28 stars 4 forks source link

ABAP Cleaner #13

Closed tobiashofmann closed 2 weeks ago

tobiashofmann commented 4 months ago

Commit: df3473da762e78cf049833306952c60793fe2fd7

larshp commented 4 months ago

"Align ABAP coding with best practices" thats typically handed with Code Inspector/linting, I see it as a pretty printer, so it doesnt align everything or get an overview of whats following best practices

tobiashofmann commented 4 months ago

It does not do magic, but brings coding closer to the best practices by applying rules. That's what I understand as aligning coding with best practices. The rules it uses are best practice, right?

From the GH page: "The ABAP cleaner tool does a lot of this work for you by automating as many of these rules as possible". "Obviously, automation is only possible for a subset of the clean code rules - but for a significant one, including formatting, alignment, replacing obsolete commands, and even reducing some nesting depth."

larshp commented 4 months ago

"brings coding closer" by rewriting everything automatically, not providing feedback to the developer, why not use Code Inspector quick fixes instead? Its centrally managed and governed, and works in all editors that SAP provides

I see it as a worst-practice approach, I spending time asking developers to revert their changes because they rewrote 1000s lines of code unintentionally

(I don't like Code Inspector/ATC, but its a different story)

Jelena-P commented 4 months ago

With all due respect for ABAP Cleaner, it looked neat at first but after spending some time with it, I'm not impressed. To Lars's point, it does look like Pretty Printer. Clean ABAP is not about making sure your type declarations are properly indented.

I focused on two use cases. (1) Terrible program from 20 years ago (well, it was OK 20 years ago but by modern standard is bad). ABAP Cleaner was like "this is fine" meme. Literally 0 suggestions. (2) Writing a new program - again, most of the suggestions were about formatting. Maybe I just write awesome code right away, I don't know. After re-watching some demos more closely, I came to conclusion that the scenarios that it was demoed with are actually not that common or not where most of the problems are.

To be fair, a lot of "cleaning" really need some human input (e.g. confusing method naming). I didn't really expect ABAP Cleaner to fix that but didn't expect "this is fine" either. It had no suggestions even, just nothing. I don't see much value in it, personally, and have not been recommending it anymore. Maybe I missed something though.

tobiashofmann commented 2 weeks ago

Added in SDTR 2024.6