![]() |
How do you plan your programs?
Whats your method for planning a script/program that you work on. (Trying to learn a new way to create/plan for stuff I create and actually finish from head to toe)
|
Brainstorming!
What does it need and what do you want it to look like First thing I question myself always. How do I want the outcome to look like? And what functions does it need. For example if I'm creating a user system. How do I want it to look like? Do I want it to be with classes? Do I want user profiles, user PM's, etc etc.. How would I achieve this I start by coding the base. For example, a database handler. If I'm doing classes, a DB class could come handy. Next, how would I code the user system. Let's first go back and look at what functions it needs. Then I code each function. Putting together and error testing Creating the object from the class for example, and use the functions, and see if it works. If it doesn't, why? Try possible solutions, if the editing doesn't work, then try figure out a way to solve this with another function(s). Something like that :-) |
heh i do a search for some open source code already written that fits almost what i want then mod the hell outta it. That gets about 50% of all my projects done.
|
In this order (each one expanding on the last)
1. What is the project 2. In English, what are the functions this site would do 2.1 Database design (done at the same time) 3. What files would be used and what would they do 4. How much time with expected debugging would this take That gives me an accurate quote and a guideline to go by. Quote:
|
In extension to Village Idiot's list:
2.2, Draw up a UML diagram to describe the project to the other programmers. |
Quote:
|
Quote:
|
i tend to give this part of the process a lot of attention, so for a guy with many programs/windows/things going on in the pc i like to get away from the computer and sit quietly to plan my programs, usually grab a pen and a clean page and start thinking/taking notes going from global to more detailed stuff, making relation charts, thinking my tables etc, that works for me. I think Village Idiot put down the order nicely, i would only add to create a to-do list from all of that just to keep track of everything and be sure i dont leave nothing behind. On the other hand, I never reached as far as creating an UML diagram, but i do consider it as a great practice, i hope to have time soon to give a deeper look on that subject and hopefully incorporate it to my workflow.
|
Well, I'm a truck driver so I get a lot of time to sit and think nearly every part of my project out before I begin. Of course, you have to either remember everything that popped into your head or keep notes. My memory works pretty well most of the time. When it doesn't, I usually remember again when I come to the issue I had given so much thought about so I'm okay. For example, on a current project, I had worked out how I wanted to salt and check passwords in my database for user authorization but that was before I got to that point in the project. When I was ready for that, I could remember exactly what I decided to do but once I started to work on it, I was able to code it quickly because I had already determined the logic I wanted to follow.
So that is how I brain storm and work through problems I encounter. For me, the planning and logic is the easy part. I have trouble finding the time to write the code. Usually, the code flows very quickly once I get going but it is hard to find time to get started! :-( When working on a simple script, I usually just start writing and work the logic out as I go. Since the script is so simple, coding it in the procedural style is generally okay. However when I tackle a complex script or system, I usually break the entire think into parts and work on the most important part first. My current project, I am working on a system that will provide employees with specific details about any job that they might be required to perform. So the most important part of the system is the database interface. That is the backbone of the rest of the system. This is true of most PHP based systems these days... Once I have a good MySQL class ready to go, I can start on the organization of data. This isn't really a programming thing exactly but you have to know how you want to organize the data before you write a database dependent system. Will each task have all of its own data in it or will some data be shared between tasks. For example, every one has to clock in and out and take a break. The database would save room if that wasn't included in every task record. Instead, have detail records that the task record can reference... I always try and consider places in my code that would allow for an add-on feature or code optimization at a later date. OOP usually offers the best opportunities for such future modifications since each object should be capable of being modified without the need to rewrite large sections of the rest of the system. I don't do diagrams but and outline of features is handy. If you keep the list nearby while working on the system, you should be able to anticipate places in the code you are currently working on as potential problems with a feature you'll be working on later. For example, if you plan to use pagination in your system, then it would be a good idea to consider that when you are writing the database queries used to populate your display with content. Otherwise, you'll probably need to go back and rewrite a bunch of code to make the queries and code work with pagination. I also always use place holders. As I said before, I work on the most important part of the system first then the next important part and so on a so forth so I always plan out my place holders. This is just sample or test code or data that holds the place for the actual code to come later. This way you don't have to plan and write all of the specific features first. For example, I don't start with content, I start with framework but I have to have something in there as content or there will be errors in the script up until I finish the whole thing... Finally, think BIG! Plan your system to be more than what you need. If you plan it for a bunch of features that you later don't need, then you can probably add those features later without much need to modify the entire system because you planned for it ahead of time. Remember, you can plan of a very complex method for storing and check passwords but if you then decide on something less extreme, it should be easy to accomplish. I think many programmers think small and as a result, they develop limited scripts. Later they have to abandon their work and start from scratch because it is easier than rewriting their previous work. So I suggest using a lot of functions and classes and make the system modular for optimal usage. Basically, I think everyone should design and develop their own base system to build all of their project on. Kind of like a CMS. vujsa |
| All times are GMT. The time now is 06:42 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0