Giter VIP home page Giter VIP logo

Comments (17)

TrevorFSmith avatar TrevorFSmith commented on May 22, 2024

Looks pretty good to me. I was worried that I'd have to go back to using semicolons, but no!

from action-input.

TrevorFSmith avatar TrevorFSmith commented on May 22, 2024

Oh, wait. Semistandard does require semicolons. Hmmm, are you sure that you want those?

from action-input.

TrevorFSmith avatar TrevorFSmith commented on May 22, 2024

I'm fine with the rest of StandardJS, though.

from action-input.

TrevorFSmith avatar TrevorFSmith commented on May 22, 2024

Dang, I should have read through the whole thing. I know that tabs v spaces is religious, but I have a lot of muscle memory for tabs.

I'm for having a linter and I won't fight consensus decisions, but I don't personally care for semicolons and space indentation.

from action-input.

cvan avatar cvan commented on May 22, 2024

FWIW: I use two spaces, but I always press Tab key; I don’t ever press the space bar. Editors like Atom and Sublime have the Tab key convert to soft spaces.

from action-input.

fernandojsg avatar fernandojsg commented on May 22, 2024

I believe every single line of code I see and work with every day uses semicolons so I'm 100% for it. Regarding tabs vs spaces it's just up to us, but we should follow the one on the linter, and as @cvan said we could just config the editor to convert then to spaces or tabs without any problem.
Regarding semicolons, if we look also at most of the frameworks we're targeting: aframe, threejs, babylonjs, playcanvas, reactvr... are using semicolons so it could be handy for us while working with integrations and for framework's devs while contributing to it too

from action-input.

robertlong avatar robertlong commented on May 22, 2024

The Social MR team is using Prettier πŸ€·β€β™‚οΈ

I like both Standard and Prettier. Semistandard looks less maintained than Standard, but still compatible with the same tooling?

from action-input.

netpro2k avatar netpro2k commented on May 22, 2024

+1 for Prettier, it has largely eliminated any sort of thinking any of us have to do about style (apart from making sure everyone gets their environment set up correctly)

from action-input.

fernandojsg avatar fernandojsg commented on May 22, 2024

@robertlong @robertlong I didn't know prettier but it looks cool!, although regarding standard vs semistandard, from what I've seen from social you're still using semicolons anyway right?

from action-input.

cvan avatar cvan commented on May 22, 2024

Semistandard is just Standard with ;. There's not much to maintain there, heh.

And, yeah, Prettier (brought to you by former Mozillian, James Long) is a good way to end the style conversation and just write code.

From Prettier's docs:

By far the biggest reason for adopting Prettier is to stop all the ongoing [sic] debates over styles.

from action-input.

TrevorFSmith avatar TrevorFSmith commented on May 22, 2024

I hear you that lots of code uses semicolons, but lots of new code doesn't use semicolons. At the end of the day, like indentation, it's a personal preference.

So, how about we split the middle and go with two space indentation but no semicolons? I'll learn to live with spaces and you'll learn to live without semicolons?

Prettier seems nice and has the options we need. If I don't hear objections by end of day Weds I'll go ahead and integrate it into the project.

from action-input.

fernandojsg avatar fernandojsg commented on May 22, 2024

When I said lots of code uses semicolons I was refering also to the codebase generated and maintained by the team, I didn't see yet any code without semicolons.

If I need to choose between one of these two, I could go for tabs + semicolons :D

I know it's going to be a dead end road so what about just making a poll with everyone on the team and just vote! :)

my vote (basically semistandard):
indentation: spaces
semicolons: yes

from action-input.

cvan avatar cvan commented on May 22, 2024
  • tabs can be changed from an editor.
  • semicolons cannot be magically added or removed (unless there's some new voodoo, besides Prettier)

let's just be consistent with the other projects (including the ones being added to https://github.com/immersive-web).

can we just commit to following the Google style guide, if we're working with community folks who have similarly styled code.

for example with three.js, it makes me chuckle every time I see a contributor introduce a PR but have to make a ton of changes to meet Mr.doob Coding Style. I agree that's where things like Prettier come in, but IMO semistandard has been serving us well for years+ (and even Brendan Eich once said he likes semistandard too).

consistency over personal preference, can we agree to that?

from action-input.

fernandojsg avatar fernandojsg commented on May 22, 2024

@cvan Yeah that was my main point, I also remember when I started using semistandard to work with aframe that I didn't like many of the rules, and I completely agree with you that mrdoob coding style is one of the awful things you could deal with, but at the end we need to choose something that is widely used instead of a custom made standard (like mrdoob's). That's why based on our code base I believe we're more close to semistandard

from action-input.

TrevorFSmith avatar TrevorFSmith commented on May 22, 2024

@cvan From the docs, it looks like Prettier will add and remove end of line semicolons, so it's just a flag like indentation.

from action-input.

TrevorFSmith avatar TrevorFSmith commented on May 22, 2024

I'm πŸ’― on board with staying consistent when contributing to an existing code base. I'm also annoyed/amused when people submit PRs to a long-running project and don't stay in style, even when the style is as weird as three.js's. πŸ˜„ But, since this is a new code base, it's worth considering where we are as a coding community.

My personal story: After decades of writing old-school JS syntax, when I finally had a chance to create a project that used ES'15 it felt so completely different from old JS. Classes, modules, rest and spread syntax, getters and setters, string formatting, thin functions... it's like a completely different syntax!

So, at that point I also reconsidered a lot of my base assumptions like what editor to use, indentation, spacing, and semicolons. I landed on hard tabs because it's a single character per level of indentation. I stopped using semicolons because they serve no purpose for well written code and also for most poorly written code.

At the end of the day Prettier will sooth any muscle memory problems and I'll live with whatever consensus we reach, but I do ask you all to reconsider your base assumptions about why you believe what you believe and whether an emerging tech group like ours could lead the way toward more modern habits.

from action-input.

netpro2k avatar netpro2k commented on May 22, 2024

Yeah I vote for prettier and I also vote for not changing any of its defaults (I don't even know what they are, and that's the point).

from action-input.

Related Issues (7)

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.