Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sirxavier

macrumors newbie
Original poster
Oct 4, 2008
27
0
Hi!

Thanks for your attention.

I am learning Objective-C from scratch(however I do know some C). I am using the Programming in Objective-C book and so far all is good, but there's something that has puzzled me since I started learning programming.... and it is.... what should I use for indenting?

The examples in the book show 4 spaces indentation, so at first I thought... isn't pressing just tab easier? But then the indentations where too big... then I checked wikipedia and it says that using spaces or tab is a thing of preference?

So far I have been pressing space 3 times for each indentation following the examples in the book... am I doing it right, isn't pressing space 3 times more cumbersome than pressing tab once? Should I stop worrying about this? :p

Thanks again!
 
Hi!

Thanks for your attention.

I am learning Objective-C from scratch(however I do know some C). I am using the Programming in Objective-C book and so far all is good, but there's something that has puzzled me since I started learning programming.... and it is.... what should I use for indenting?

The examples in the book show 4 spaces indentation, so at first I thought... isn't pressing just tab easier? But then the indentations where too big... then I checked wikipedia and it says that using spaces or tab is a thing of preference?

So far I have been pressing space 3 times for each indentation following the examples in the book... am I doing it right, isn't pressing space 3 times more cumbersome than pressing tab once? Should I stop worrying about this? :p

Thanks again!

Did you check XCode preferences / Indentation?
Just set tab width = 4.
 
If you're using Xcode, let it auto-indent for you: Preferences > Indentation > Syntax-aware indenting
 
I am using vim in terminal at the moment, but I will move to XCode soon enough... but now I know how to solve my problem to make it look like the book with only one key press! :)

Thanks again!
 
Hi Friends, I am Cine and I have read your site in a very deep and I would like to appreciate you on this brilliant effort. You have provided some thing so much different that I can't have words for thanks.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.