GithubHelp home page GithubHelp logo

Comments (6)

gregheo avatar gregheo commented on July 24, 2024

πŸ‘

I code with two-space indentation all the time so I'm in. My own personal preference aside though, I think our page width restrictions are a good practical reason.

from objective-c-style-guide.

hollance avatar hollance commented on July 24, 2024

I'm OK with 2 spaces for the book but I find 4 spaces reads much easier and on the website there's less concern for wrapping because you can scroll the code blocks.

That said, we should just use a tool to reformat code according to these guidelines before putting them into the tutorials. That way authors can simply write in the style they want and the tool will fix everything up.

from objective-c-style-guide.

funkyboy avatar funkyboy commented on July 24, 2024

I agree on this.
A script can take care of indentation.
Maybe we need one also for curly braces?

method {}
vs
method {
}

Cesare Rocchi
studiomagnolia.com

On Nov 7, 2013, at 7:07 PM, Matthijs Hollemans [email protected] wrote:

I'm OK with 2 spaces for the book but I find 4 spaces reads much easier and on the website there's less concern for wrapping because you can scroll the code blocks.

That said, we should just use a tool to reformat code according to these guidelines before putting them into the tutorials. That way authors can simply write in the style they want and the tool will fix everything up.

β€”
Reply to this email directly or view it on GitHub.

from objective-c-style-guide.

 avatar commented on July 24, 2024

There are tools that handle this already, so no need to write a script. But if you think 4 spaces is nicer than 2, well I have to rethink everything I've ever thought about you, hollance. ;)

from objective-c-style-guide.

hollance avatar hollance commented on July 24, 2024

I can't be held responsible for what other people think about me. :-)

And yes, I meant using one of the existing pretty printer tools.

from objective-c-style-guide.

rwenderlich avatar rwenderlich commented on July 24, 2024

+1 vote for 2 spaces, as I think it is better for our purposes on raywenderlich.com (conserving space in print/books so we have as little line wraps as possible, which waste space, don't look good, and are harder to read). I put a pull request for this, but if we decide to go forward with this a bunch of the examples in the guide will need to be switched from 4->2 as well.

from objective-c-style-guide.

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.