Giter Site home page Giter Site logo

Do not chain up-front declarations about styleguides HOT 6 OPEN

sap avatar sap commented on June 5, 2024 2
Do not chain up-front declarations

from styleguides.

Comments (6)

hapejot avatar hapejot commented on June 5, 2024 5

You have to do it manually then. Which includes much more work to keep it up to date. Thats why every styleguide for other languages recommends not to align commands.

But using chaining enables the AUTO-Align feature of the ABAP-Editor.

from styleguides.

rdibbern avatar rdibbern commented on June 5, 2024 1

I think this section should also be reconsidered due to the fact that the up-front chaining will also be applied by ADT when using the quick assist functionality for not declared variables.

from styleguides.

 avatar commented on June 5, 2024

The main reason imho is the refactoring issue: it requires a lot more changes to cut&paste chained variables for refactoring than one-line-data-definitions. The most trouble you have when the you need to cut out the first or the last definition in a chained declaration.

from styleguides.

hapejot avatar hapejot commented on June 5, 2024

I agree. I am just thinking, that you lose more than you gain:
You gain the benefit of copying a complete line when refactoring manually.
But you lose any alignment, in the data sections, which usually helps me a lot to quickly see the data types of the variables.

from styleguides.

 avatar commented on June 5, 2024

Not using colons and aligning does not exclude each other... ;)

from styleguides.

sandraros avatar sandraros commented on June 5, 2024

I don't understand why there should be a Clean Code rule for chaining DATA declarations or not.

The reason is, I don't read the declarations, I read the rest of the code. Clicking F2 gives me information on the variables I need to see, and I just need to see one declaration at a time. I don't bother how the DATA lines are aligned, chained or not.

My personal opinion is that this DATA block is often short because the procedure has to be short and inline variables are to be preferred, and so it doesn't harm my eyes a lot if the variable typing is not aligned. But generally speaking, my eyes really prefer to see them aligned (automatically of course, via the pretty printer). Moreover, the ADT Quick Assists converts inline variables into local variables or attributes by chaining them, so I don't want to spend time to "unchain" them!

So, I would love a lot that this section is removed. Same thing for the section "Don't align type clauses". Or the only thing worth saying is "do NOT spend time in aligning manually" and "do NOT spend time in removing the alignment manually". Even a mix of chained and "unchained" DATA doesn't bother me.

from styleguides.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.