December 30th, 2012, 07:51 PM
Tools for good programming organization
I am faced to a problem generated for my coding of complex scripts. I use to write the code based simply on my head. But, although I organize each and every file in the most self-explanatory way, I find that complex scripts as, for example, the system to sell theater tickets on-line I am producing now, requests me to generate a written pseudo-code or diagram to avoid to be lost when I go a system of 100 scripts and growing. I ask, what kind of system I should use to help me?
(Hope I have explained what I need... sorry for my limited written English).
December 31st, 2012, 05:37 PM
Are you intending to post this in the PHP section? There are very many PHP development environments out there (like Eclipse PDT and Zend Studio) which will organize your files for you.
You seem to be suffering from a proliferation of files and functionality. Using a class system with auto-loaders may help, though I don't know your exact problem.
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.
December 31st, 2012, 06:10 PM
Thank you. I mean, prior to coding, should I design a flow diagram like this
Originally Posted by ManiacDan
or a pseudo-code like this
or an alternate way.
My only goal is to have a good documentation of my script.
Thank you and have a happy 2013!
December 31st, 2012, 06:29 PM
If you need those to help you keep it all straight in your head (a skill you will learn, I assure you) or if you want to be able to talk with others who are unfamiliar with your design then yes, those are good. It also helps to be able to write things down, step away, and come back to them with a clear mind - you'll spot problems much sooner.
Also learn to break up functionality into discrete segments. If you think of it in terms of building software to sell tickets then it can be overwhelming, but if you plan out discrete requirements - user registration, user profile management, ticket searching, ticket purchasing... - then you'll find it much easier to work with. Even more so if you can focus on one area at a time, hammer it out really well, and then apply what you've made in the construction of the next piece.
And then it starts moving into the subject of project design. I'm a firm believer that it's much better to spend some time thinking and some time developing than it is to jump right into the code and discover you keep having to refactor and rewrite code because things just keep coming up.
Blah blah blah, moral of the story is to enjoy working by yourself while you can and do whatever you need to make the project as fun and productive as possible. If flowcharts help you then make flowcharts. If an exact algorithm makes it easier then write an exact algorithm.
December 31st, 2012, 06:45 PM
Thank you for your advise! And you are right... I use to start by coding and afterwards I realize a new idea comes to my head suggesting me to rewrite parts (or all) the code. Or sometimes the customer changes his idea ...
So, again, I thank you for your proposal and probably I will mix everything to make it easily upgradeable including database description.
Have a happy year 2013 !
December 31st, 2012, 09:13 PM
i use a combo of flow diagrams and pseudo code for anything with a degree of complexity. The main reason I do is so that I have an overview in my head of how the whole project fits together in my head before I write any code.
I used to just jump in and write code, but you typically end up re-writing things as you go through because you think of a better way for it to work etc. Doing (even a quick) flow diagram first gets you thinking about all that before you start.
if anyone else is ever going to need to use the code then good commenting and good documentation is a must IMO. I hate nothing more then getting someone's code with 0 comments etc... I can see what the code does, but i have no idea what their intention was.