Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am an iPhone developer. I am quite confident on developing iPhone application with some minimal feature. I would consider myself as a fair application developer but the code I write is not so much structured. I make very little use of MVC because I don't seem to find places to impose MVC. Most of the time, I create application with viewcontrollers and very few models only. How could I improve the skill for making my code more reusable, standard, easy and maintainable. I have seen few books on design patterns and tried few chapters myself but I don't seem to skip my habit. I know few of them but I am not being able to apply those patterns into my app.

What is the best way to learn the design patterns and coding habit. Any kind of suggestion is warmly welcomed.

share|improve this question

closed as not a real question by gnat, Walter, Mark Trapp, ChrisF Oct 15 '12 at 12:21

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

This just smells like what could be called the 'solo developer rut'. One developer especially a junior will generally not generate a system large enough to have trouble maintaining it, especially since they created the whole thing themselves so the threshold for maintainability is much higher. As soon as you have worked on a large system or had to have your systems comprehensible to others, the value of clean practices become rapidly apparent. Some people suggest working on open source projects as a cure for this known common problem, seems like a reasonable approach to me. – Jimmy Hoffa Oct 12 '12 at 20:10
The apps you've written so far, what are they doing, apart from presenting a view? Almost any class reference has samples, have you tried some of the bigger ones? – ott-- Oct 12 '12 at 20:14
Well it does many things. It is done somehow in random and un managed way. It connects the remote service and signs in to the server using oauth, uses facebook or linked account, fetches your friends and connection, stores in local core data stack, presents them in tableview. You could view profile for each specific person, send message and then some other functions like such. It has gone pretty far now and I am not quite satisfied with the approach. – GeneratorOfOne Oct 12 '12 at 20:19

I'd suggest you that if you really master the Objective-C language and the fundamentals of the Cocoa Touch API, you should get yourself to start a larger project. If you have to manage, say, an app with several tabs exposing some completely different functionality, with recursively embedding content presentation inside (think of the official Twitter client!) plus you have to build up some moderately (or less moderately) complicated business logic, you'll eventually find yourself using MVC, OO patterns and whatever good practice you wish to be in posession of.

share|improve this answer

Usually a lack of design patterns is either a lack of knowledge of the names for the patterns or a codebase that lacks unit tests and is very tightly coupled to its libraries. Unit tests in many languages demand at the very minimum use of Factories and make the use of singletons very painful. Look at your code base, do you repeat yourself? How painful would it be to switch a library out to a different one?

MVC is a good pattern for dealing with change. Views that are decoupled, from their controllers and models, can easily be changed, which will happen if you focus on UX. For example: Your client tells you your management screen is too complicated, and would like a wizard instead or perhaps in several more focused screens.

The software architecture can be changed from a mobile application to a console application to a GUI application to a web service very quickly. If it is encapsulated well, parts can be broken into different systems.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.