Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using an alias variable. #6193

Merged
merged 1 commit into from
Apr 7, 2018
Merged

Conversation

bangerth
Copy link
Member

@bangerth bangerth commented Apr 7, 2018

Looking into a function in FE_Q_Base, we initialize an array but do so by first
creating an alias (reference) variable for it and then writing into it.

I'm not a big fan of these alias variables. It makes it more difficult to read
code, and in particular to search code for where a variable is actually
initialized. (This is how I hit on this location.) I recognize that the variable
in question has a pretty long name, and that the lines become longer than we
usually like it, but IDEs typically show substantially more than 100 characters
per line these days, so I think the benefits outweigh the downsides.

This is ultimately a judgment call. The patch reflects my opinion,
but if others feel differently, then we can go that route as well.

@davydden
Copy link
Contributor

davydden commented Apr 7, 2018

/run-tests

Copy link
Member

@kronbichler kronbichler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case I'm certainly in favor of avoiding the alias.

@drwells drwells merged commit 40f2eb3 into dealii:master Apr 7, 2018
@bangerth bangerth deleted the avoid-alias branch April 8, 2018 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants