Giter Club home page Giter Club logo

Comments (2)

NoahZinsmeister avatar NoahZinsmeister commented on May 15, 2024

spoke with @haydenadams about this, we're leaning towards not doing it to avoid having inter-interface dependencies (e.g. IUniswapV2Factory would need to rely on IUniswapV2), as well as for enhanced clarity on the data types of variables (as opposed to their function). going to leave the issue open though for further thought!

from v2-core.

MicahZoltu avatar MicahZoltu commented on May 15, 2024

avoid having inter-interface dependencies

The following is valid Solidity:

interface IApple {
    function color() external returns (address);
}
interface IColor { }
contract Apple is IApple {
    IColor public color;
}

You could follow a pattern like this to avoid inter-interface dependencies.


enhanced clarity on the data types of variables (as opposed to their function).

Opinion: The most "clear" code in terms of what it actually does is assembly, but such code is also the most unreadable. In my experience, readable code will result in fewer bugs than "clear" code, so should be preferred unless there is a strong argument against readability. In this case, the code is more readable if the type information expresses what exactly is being mapped, and it gives you the added benefit of giving additional compiler checks (another great reducer of bugs).

from v2-core.

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.