Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3337110
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:12:54+00:00 2026-05-18T00:12:54+00:00

How did it become convention that there is no whitespace in the declaration of

  • 0

How did it become convention that there is no whitespace in the declaration of a method?

-(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath

It seems like everyone does it, 90% of the examples I see, the generated templates, other people’s code, etc., etc. I suspect it’s just another vi/emacs ideological thing, but wondered if maybe there was a K&R kind of “root cause” to the behavior.

Me, I like lots of whitespace:

- (UITableViewCell*) tableView: (UITableView*) tableView
         cellForRowAtIndexPath: (NSIndexPath*) indexPath

This seems so much better to me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T00:12:55+00:00Added an answer on May 18, 2026 at 12:12 am

    I know a lot of code styles take getting used to to be more understandable. In this case I think that Apple’s syntax reflects a thought process more than a coding style, not just personal preference.

    When I first started using Objective-C I had the same concern. It can be confusing to look at no whitespace in a long line of code. However, once you get a better feel for the syntax, you will notice that even in your example there is whitespace. It’s used to separate the segments of the function names from the previous parameter. Once you’re there it becomes easier to pick out each segment of the function and it’s parameter. Function name segment on the left, param on the right, repeat.

    At first I did what you have listed — spaces after everything. However that ended up being almost as bad as no whitespace. Since there were spaces everywhere they became meaningless. I next tried putting spaces after the colon and after the param, but that didn’t seem right either — the function name and the parameters started to get confusing in some cases. I tried a few other whitespace styles and eventually came back to use apple’s standard almost exactly. The only thing I differ on now is the return type — I prefer to have a space after the + or – and a space after the return type. Even that isn’t that big of a deal, being mostly personal preference rather than any specific difficulty. (Having a heavy C/C++ background I like to be able to see the return type at a glance.)

    If you keep at it you’ll suddenly find yourself liking apple’s way over the other. =)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Did actually someone make already a tutorial that shows how to customize an UITableView?
Is there a way to know if the application did become active from a
Did not have luck with these examples: Javascript File remove Javascript FSO DeleteFile Method
Did defaultdict's become not marshal'able as of Python 2.6? The following works under 2.5,
As stated in, When did single quotes in HTML become so popular? and Jquery
I've recently become heavily involved in a few projects that are going to work
I was recently working on a windows program that would sometimes become unresponsive when
When Android 4.0 became available for Nexus S back in December 2011, we did
Did you used Dynamic websites before? you see its a good way for making
Did some searches here & on the 'net and haven't found a good answer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.