hyperoslo / iOS-playbook

Hyper's iOS playbook
Other
227 stars 28 forks source link

Drop suffix viewController for subclasses of UIViewController #130

Closed 3lvis closed 9 years ago

3lvis commented 9 years ago

I was thinking that we could just use controller. For example you have an HYPRecipesViewController, you would only name it HPYRecipesControlleror in Swift just RecipesController.

Is not that for subclasses of UITableViewController you do RecipesTableViewController, and even if you did that it's not a requirement since knowing the parent class isn't super difficult, meanwhile writing the super long name everywhere can be quite painful.


tl;dr HYPRecipesTableViewController => HYPRecipesController

What do you guys think @hyperoslo/ios?

attila-at-hyper commented 9 years ago

:+1:

kostiakoval commented 9 years ago

How about data controller, not a view controller, how would you name it?

kostiakoval commented 9 years ago

ImageController, FetchingController, etc

3lvis commented 9 years ago

What's a data controller?

3lvis commented 9 years ago

What would a ImageController do? Or a FetchingController? Do they subclass from UIViewController/UIPageViewController/UICollectionViewController/UITableViewController?

This issue refers to those subclasses.

kostiakoval commented 9 years ago

HYPRecipesController for example could download and validate In-APP Purchase receipts

kostiakoval commented 9 years ago

HYPRecipesController: NSObject - validate verecepts. Would use use controller suffix only for ViewControllers ?

3lvis commented 9 years ago

I wouldn't name something like that a HYPRecipesController. More something like HYPRecipeValidator

3lvis commented 9 years ago

Would use use controller suffix only for ViewControllers?

I had that in mind. Usually anything else called Controller is code smell.

kostiakoval commented 9 years ago

Ok

zenangst commented 9 years ago

Controller's and Manager's beware, you smell

RamonGilabert commented 9 years ago

I use Manager, it's bad? I agree with the Issue @3lvis! :)

vadymmarkov commented 9 years ago

Agree with @3lvis to drop ViewController suffix, but we could be in conflict with Apple's naming then. For example NSFetchedResultsController is not view controller, but has Controller suffix. As for managers I think Manager is too generic, I would name it something like DataFetcher instead of DataFetchManager, but it's another discussion I guess.

3lvis commented 9 years ago

The naming of NSFetchedResultsController is just unfortunate, wouldn't take it as an example of good naming. It could be called NSResultsFetcher or NSManagedObjectFetcher.

vadymmarkov commented 9 years ago

Yes, NSResultsFetcher is much better, but I mean that Apple did it for some reason and we can't change it :smile: .If you think that it's not very important to follow some Apple's name conventions, then we are Ok.

3lvis commented 9 years ago

They have been quite inconsistent too.

UITabBarController, UISearchController, UINavigationController, UIAlertController, MPMediaPickerController, EKCalendarChooser for example, all of them subclass UIViewController.

3lvis commented 9 years ago

@hyperoslo/ios guys => https://github.com/hyperoslo/iOS-playbook/pull/131