Coder Social home page Coder Social logo

Improve Code quality about thorvg HOT 2 CLOSED

hermet avatar hermet commented on June 7, 2024
Improve Code quality

from thorvg.

Comments (2)

JSUYA avatar JSUYA commented on June 7, 2024

Apart from method's complexity, some of our codes have an ordering dependency on header include. (Transitive inclusions)
The google c++ style guide provides some concepts to solve this problem.
https://google.github.io/styleguide/cppguide.html#Include_What_You_Use
https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes

what do you think about it?

from thorvg.

hermet avatar hermet commented on June 7, 2024

@JSUYA Conceptually, each file should explicitly include headers if they depend on them. The problem is that somebody might forget to include a header, and it's not easy to detect this omission during the review stage because even reviewers may not notice it when transitive inclusions implicitly hide it. In my case, I'm not overly concerned about this, as any breakage can be promptly detected during testing. We can easily identify the missing header in the necessary file, allowing us to include it at that time.

The only header that truly matters for the transition is the client API header (thorvg.h/thorvg_capi.h) for us. And I believe it's well maintained.

from thorvg.

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.