Git Product home page Git Product logo

coding-styles's Introduction

coding-styles's People

Contributors

amiel avatar andreafrost avatar antca avatar elierotenberg avatar grant avatar hugeen avatar kculafic avatar timwhite47 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kculafic

coding-styles's Issues

Discussion: string style

There's one more decision to make in the ruby style guide.

This section has two options, and the style guide recommends picking one: https://github.com/ActionSprout/coding-styles/blob/master/ruby.md#consistent-string-literals

I would be happy either way. I'd even be ok with removing this section of the style guide, as I don't think we are very consistent right now anyway.

This debate has been going for quite a while. Usually the arguments are like this:

  • For single quotes:

    There's a slight performance improvement, since ruby doesn't have to scan the string for possible interpolations.

  • For double quotes:

    It's likely that you will end up interpolating some strings and it's annoying to change them. The performance improvement is negligible.

To be honest, I'm not very consistent about this. Sometimes I feel like following the spirit of both rules and using single quotes for things that really are not likely to be interpolated, like strings that are identifiers (which would be a good case for using a ruby symbol, but sometimes that just doesn't end up being the case), and then double quotes for strings of text like copy or whatever, which seem to have a higher likely-hood of being interpolated in the future. However, these guidelines are too subjective to be in a style-guide. Hence the idea of just removing this section and not worrying about it.

Other notes: Our javascript (es6) style-guide requires using single quotes.

Thoughts?

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.