Comments (6)
π
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.
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.
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.
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.
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.
+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)
- Init section contradicts Golden path section HOT 2
- Can we lint to enforce some of this style guide? HOT 6
- Symbol prefix: 2 vs. 3 characters HOT 26
- English should be used, really? HOT 7
- What's the point on using properties instead of instance variables? HOT 8
- Direct access to properties. HOT 5
- License for this guide? HOT 1
- Not linking to Official Apple Style Guide HOT 1
- RWT prefix typo in constant definition HOT 1
- What is the recommended line width for Objective-C?
- Use style guide principles in examples
- arrayCount should be named something else HOT 4
- Contradiction between Init Methods and Golden Path
- Error handling
- I want make new branch for Korean ver.
- Google style guide URL is broken HOT 2
- Should self keyword should be used in init methods ?
- How do I indent something like this??? HOT 3
- Xcode behavior regarding indenting block
- ε ³δΊζδΈΎ(Enumerated Types)ηζ³ζ³
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from objective-c-style-guide.