Giter Site home page Giter Site logo

Coding Standards? about gwen HOT 5 OPEN

garrynewman avatar garrynewman commented on August 26, 2024
Coding Standards?

from gwen.

Comments (5)

jeremieroy avatar jeremieroy commented on August 26, 2024

That may comes from me.
I agree that a coding standard would be great.
Also a bit of doc about some of the design philosophy would help as well. (Mostly about layouting)
What about activating the wiki ?

from gwen.

billyquith avatar billyquith commented on August 26, 2024

Coding standards would be good to set the formatting in stone. But could we please have formatting that looks like other C++. If GWEN is going to be constantly reformatted, I may just fork it, or find another solution.

I work on a laptop a lot (13" screen) so I like space saving "narrower" code. Line length max 100?

Can we please avoid idomatic formatting (which also confuses editors because the brackets don't match):

if ( foo == 7 )
{ doSomething(); }

One of:

if ( foo == 7 ) { doSomething(); }

if ( foo == 7 ) {
    doSomething();
}

if ( foo == 7 )
{
    doSomething();
}

And there is nothing wrong with:

if ( foo == 7 )
    doSomething();

or:

switch ( test )   // This is easier to read on a 13" laptop, and easier to see all values
{
    case A: value = 1; break;
    case B: value = 2; break;
    case C: value = 3; break;
    case D: value = 4; break;
}

not:

switch ( test )  
{
    case A:
        value = 1;
        break;


    case B:
        value = 2;
        break;


    case C:
        value = 3;
        break;


    case D:
        value = 4;
        break;
}

from gwen.

billyquith avatar billyquith commented on August 26, 2024

Also, there seem to be quite a few warnings in the code (signed/unsigned, _s etc). I think these are priority over fixing the formatting.

from gwen.

jeremieroy avatar jeremieroy commented on August 26, 2024

Well, at this stage, it would be great to have a feedback from Garry :)
We should try not to be emotional about decision and keep it friendly.
But we need to have decision ... (Hi Garry !)

from gwen.

garrynewman avatar garrynewman commented on August 26, 2024

I thought the code formatting was pretty obvious from looking at all of the other existing code. ie lots of spacing, no Egyption bracketing etc.

from gwen.

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.