# Interface implementations should have the same parameter names as the interface

**URL:** <https://forum.soliditylang.org/t/interface-implementations-should-have-the-same-parameter-names-as-the-interface/1725>\
**Category:** Language Design\
**Created:** [July 13, 2023, 9:41pm UTC](https://forum.soliditylang.org/t/interface-implementations-should-have-the-same-parameter-names-as-the-interface/1725 "2023-07-13T21:41:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![capu](https://avatars.discourse-cdn.com/v4/letter/c/7ab992/32.png) [@capu](https://forum.soliditylang.org/u/capu)\
**Post date:** [July 13, 2023, 9:41pm UTC](https://forum.soliditylang.org/t/interface-implementations-should-have-the-same-parameter-names-as-the-interface/1725/1 "2023-07-13T21:41:33Z")

</div>

Hello everyone! this is my first time posting to this community, so please  
excuse me if I get any part of the netiquette wrong.

Recently I’ve been working on a [linter  
rule](https://github.com/solhint-community/solhint-community/pull/25) to  
disallow use of positional arguments when a function has more than a few  
parameters, requiring usage of named parameters instead.

However, I realized that currently Solidity doesn’t consider the parameter names  
part of the interface definition (which of course makes sense from an ABI point  
of view), but it can be confusing when using named parameters to invoke  
functions. Let me illustrate:

given an interface

```
interface IFoo {
    function foo(uint256 a, uint256 b) external returns (uint256);
}

```

it should not be a valid override to use different names for the parameters.

Valid:

```
contract Foo is IFoo {
    function foo(uint256 a, uint256 b) external returns (uint256);
}

```

Currently valid, proposed invalid:

```
contract Foo is IFoo {
    function foo(uint256 other, uint256 name) external returns (uint256);
}

```

Allowing the latter causes confusion when using named parameters to invoke  
functions, since types implementing the same interface would have different ways  
of invoking the same function

I created a small repo with an example of this behaviour:

> **[GitHub - juanpcapurro/interface-inconsistency](https://github.com/juanpcapurro/interface-inconsistency)**
>
> Contribute to juanpcapurro/interface-inconsistency development by creating an account on GitHub.

What do you think?

---

<div class="post-metadata">

**Author:** ![cameel](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.soliditylang.org/cameel/32/34_2.png) [@cameel](https://forum.soliditylang.org/u/cameel)\
**Post date:** [July 14, 2023, 10:00am UTC](https://forum.soliditylang.org/t/interface-implementations-should-have-the-same-parameter-names-as-the-interface/1725/2 "2023-07-14T10:00:54Z")

</div>

I think this is something that might make sense being enforced by a linter, but not necessarily by the compiler.

It’s a bit too opinionated and I’d expect there to be many people who just don’t care. The fact that argument names are not a part of function signature and therefore do not matter in inheritance is pretty well established practice in C-like languages.

Some people might even actively dislike it because it would disallow even trivial adjustments, like for example changing the original name to match your coding style (e.g. `aValue` → `a_value`). Or sometimes replacing a cryptic name chosen by the library with something more readable. Or changing a generic name to something that better matches how the function interprets it.

On top of that it’s a breaking change, which would be annoying if you’re doing it all over your code base. Having linter do that would allow people who do want it to have it without others being forced to.

---

<div class="post-metadata">

**Author:** ![Worthy](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.soliditylang.org/worthy/32/1034_2.png) [@Worthy](https://forum.soliditylang.org/u/Worthy)\
**Post date:** [July 31, 2023, 3:03pm UTC](https://forum.soliditylang.org/t/interface-implementations-should-have-the-same-parameter-names-as-the-interface/1725/3 "2023-07-31T15:03:56Z")

</div>

How about sharing your findings on the Solidity GitHub repository to gather feedback
