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

How to deal with unused function parameters #422

Open
bugrahantemur opened this issue May 4, 2023 · 2 comments
Open

How to deal with unused function parameters #422

bugrahantemur opened this issue May 4, 2023 · 2 comments
Labels
software design Issue or pull request dealing with aspects of code design

Comments

@bugrahantemur
Copy link
Contributor

bugrahantemur commented May 4, 2023

Something I want to point out is how we deal with unused function parameters:

  • Sometimes we use the (void) variable style, and in some places, we even specify a default value for an unused variable, which does not make much sense. I know that using default parameters in virtual functions is generally not a good idea, but if the base class from deal.II already has it, there is nothing we can do about it,

  • and sometimes we comment out the variable name like unsigned int /*variable*/.

Originally posted by @btemuer in #421 (comment)

@nfehn
Copy link
Member

nfehn commented May 4, 2023

I personally like the (void) variable style more than just leaving out the parameter. The comment-style is a mixture in the sense that one can still see the name of the variable but does not need to write an additional line of code (void) variable.

@richardschu
Copy link
Contributor

I vote for the (void) variable style, providing a default value in such a case is useful in case one wants to call the function completely omitting the (anyways not needed) variable ... so I can see the point of doing that. Is it pretty? - guess not 🥲

@nfehn nfehn added the software design Issue or pull request dealing with aspects of code design label May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
software design Issue or pull request dealing with aspects of code design
Projects
None yet
Development

No branches or pull requests

3 participants