Giter Site home page Giter Site logo

Formatting about opendarkengine HOT 5 CLOSED

volca02 avatar volca02 commented on July 22, 2024
Formatting

from opendarkengine.

Comments (5)

ktalik avatar ktalik commented on July 22, 2024

I think we can get rid of the leading whitespace in namespaces.

Do you mean indentations resulting from namespace brackets? I agree.

I'd also like to replace tabs with spaces.

I think 4 spaces will be good.

Multi-line arguments in function headers/constructors should mean the curly brace on separate line.

Moreover, it is good to treat every brackets as curly brackets (aesthetically). In other words I think about something like this:

void Root::addResourceLocation(
    const std::string& name,
    // all other arguments
) {
    // method contents
}

I also have a suggestion to write no more than 79 characters in one line. It helps in many circumstances, for example viewing two files on screen at the same time.

from opendarkengine.

volca02 avatar volca02 commented on July 22, 2024

Although it is nicely consistent, I find the round bracket after newline somewhat displeasing.

Good idea with the line limit.

from opendarkengine.

ktalik avatar ktalik commented on July 22, 2024

This approach is acctually a convenience. When placing any bracket after a newline of some set of lines, it is then easier to add new line between the last line and the bracket. In other words, you don't need to navigate your cursor to a position placed before a bracket, but you simply navigate it to the end of the line (f.e. End key) and press Enter.

That's why we are placing { brackets in an usual code.

I find the round bracket after newline somewhat displeasing

While placing parameters in separate lines -- why not to separate a bracket too?

In case of definition bracket could also be not alone:
) {

I just used this style while programming with someone so I am disscussing it that much. However since there is a lot of code, there is no problem for me to follow its rules :)

from opendarkengine.

volca02 avatar volca02 commented on July 22, 2024

Yea, I am hesitating to enforce new coding standard precisely because of the amount of code already in place. It would break git history on files, so for now am doing it lazily, just replacing tabs with spaces as I encounter them. Not a good solution either, but at least it does not cause so much headache when viewing history on files.

from opendarkengine.

volca02 avatar volca02 commented on July 22, 2024

Transitioned to a more or less fitting clang-format rule file that is in the root of the repository. Reformatted most of the files correctly. Will continue working on this.

from opendarkengine.

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.