Hey everyone,
As a bit of a background I'm about to be a senior in Comp E and currently working on a project for my internship involving iPad development using Monotouch and C#. As a student with multiple projects at once during the semesters, code style is often completely ignored in order to get the final product working. I'm sure you all know what that's like.
Now that I have a lot more time to develop, plan out, and design my code I'm stuck between "the fast easy way" or the "complex tricky way". I'll outline my design (which is probably horrible to begin with) and welcome all suggestions.
I'm creating a simple iPad app where a user can select a make of car, then that selection populates images on the other side of the screen with different models. Now when a user selects that model, it brings them to another screen where I ask for more information such as price, year, etc, etc. On the second screen I have an image of the selected car model as a "reminder" of what you're searching for again as the screens changed. Populating that image now depends upon which make was selected and which model. These are all done based upon a 2D array of information. So Cars[0][3] would be an Acura-TSX model, Cars[1][0] - BMW 1 Series.
Now trying to get out of a college mindset of throwing everything into one giant MAIN, I know its not pretty but it works and college is about points not style, I've started breaking things down into functions and helper functions. When I call the function that will switch screens and eventually load up the image I have to pass it makeIndex and a modelIndex which are set after the make and models are selected previously so there is a bunch of call/returns and variable passing. In my head, the simple EASY way to solve this would be 2 Global Variables but I know this is bad practice and am trying to develop a better coding style.
What are your suggestions on how to do this? Would it be better to simply say "screw good practice" and go with what works fast? or should I take the time and work out the passing back in forth for multiple functions as many of them require knowing this information?
Thanks for taking the time to read this and thank you for your suggestions.
--Adam