Giter Club home page Giter Club logo

Comments (5)

Qix- avatar Qix- commented on June 28, 2024

// @sindresorhus @iankronquist @polyg0n

from arua-meta.

corbin-r avatar corbin-r commented on June 28, 2024

I feel like there should be at least a minimal style guide for anybody that writes code for the main arua packages/libraries/etc. What they want to do with arua-lang code for their own packages? I could care less.

As far as having the style in your example? You'd want to make sure users write all params on a single line, unlike what some C++ programmers do:

 bool getNode(
        bool hasPriorityLoad,
        long nodeUID,
        char nodeName,
        unsigned int loadOrder,
        node_loc_t nodeLocation
     );

Due to your language being a whitespace/carriage return based language (like python) you wouldn't want to do this for obvious reasons.

As far as comments.. Putting a space after the comment token helps with readability.
Tabbing and spacing? I would impose a 4-space ruling in the language, it's a pretty well used standard in programming, and really makes the language more readable. And spacing, no tabs... Because hard tabs break the spacing when you push it to github (Believe me I've tried it).

And if you have an option to disable it? I'd just impose the style standard by default. Especially if someone is uploading their code to a main arua-lang repo, just so everyone is using the same styling.

from arua-meta.

Qix- avatar Qix- commented on June 28, 2024

I'm about to add a placeholder for a scoping RFC, but ultimately indentation is tabs first, then spaces (no interleaving) - and the tuple of those counts becomes the indent. Tabs take precedence.

row <=> col 1 space 1 tab 1 tab, 1 space 1 tab, 2 spaces 2 tabs, 1 space 2 tabs, 2 spaces
1 space = < < < < <
1 tab > = < < < <
1 tab, 1 space > > = < < <
1 tab, 2 spaces > > > = < <
2 tabs, 1 space > > > > = <
2 tabs, 2 spaces > > > > > =

Tabs are to be disallowed anywhere outside indentation, following the dogma of tabs for indentation, spaces for alignment. As a side effect, this allows users that prefer space indentation and absolutely no tabs at all to do just that, without conflict.

Everyone wins.


You're right about newlines in argument lists. They make no sense in Arua and frankly they're ugly in languages that allow them (purely opinion). @sindresorhus has pointed out a few times we're not in a time where IDE widths are a problem anymore, so it makes a bit of sense from a functional standpoint, too.


The space after # in comments should be a stylistic error, which leads me to want to have a specific standards about what types of errors there are (errors, warnings, and style notices, etc.) and differentiate between them in the compiler output.

from arua-meta.

sindresorhus avatar sindresorhus commented on June 28, 2024

A language should make you more productive. Bikeshedding about style inflicts productivity. I've personally experienced this. If I ever were to design a language, I would be very strict about style.

from arua-meta.

corbin-r avatar corbin-r commented on June 28, 2024

@Qix-
I agree with @sindresorhus. I would really think about enforcing a strict style to maintain clean code.

from arua-meta.

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.