Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 584
  • Last Modified:

How to plan, organize, and systematically build a complex PHP site

I have cobbled together and bumbled my way through my first PHP site to learn the ropes and do a practice run.  But the process has been haphazard and disorganized.  Is there some convention, model, or method I can use to systematically think through and build the site and database, etc, so that the whole process is less painful and efficient?   Additionally, any personal tips or insights would be greatly appreciated.
0
LB1234
Asked:
LB1234
  • 4
  • 4
  • 4
  • +1
6 Solutions
 
Ray PaseurCommented:
That's like asking for a college education!  You learn that with a bachelors degree in computer science.

The best single book on this subject is by Matt Zandstra.
http://www.amazon.com/Objects-Patterns-Practice-Experts-Source/dp/143022925X

The best beginner book is Welling/Thompson.
http://www.amazon.com/PHP-MySQL-Web-Development-Edition/dp/0321833899

In between those books there are years of study and practice.  To begin to understand why it takes years, please read this very thoughtful article by Peter Norvig, one of Google's chief scientists.
http://norvig.com/21-days.html
0
 
Dave BaldwinFixer of ProblemsCommented:
You should probably build and/or maintain another 100 sites.  You'll be much better informed at that point.  Maintaining and fixing code written by other people can be very educational.
0
 
LB1234Author Commented:
Ray, good stuff!  Do you know where I can find examples of PHP code with annotations?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LB1234Author Commented:
Lol, only 100 Dave?  Are you saying that the process just develops organically over time?
0
 
Ray PaseurCommented:
No, it doesn't develop organically, it develops from progressive challenges.  Norvig speaks to this.  And Dave's right - a hundred web sites will give you a breadth and depth of experience that will make the job easier.

Examples of PHP code with annotations are all around you, some good, some bad.  This article will point you to good learning resources and more importantly, help you avoid the many bad examples that litter the internet.  Unfortunately bad examples do not come with warning labels or expiration dates - they just lie there waiting for a novice to copy them and propagate bad programming practices.  So avoid random learning and choose structured learning instead.  You'll be better off for it, I promise.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/A_11769-And-by-the-way-I-am-new-to-PHP.html
0
 
Dave BaldwinFixer of ProblemsCommented:
Not organically but you will get frustrated at dealing with big messes and start imposing order on your self.  Then you will really see why we recommended sticking to only two levels of directories.  If you extend the levels of directories, you run into problems like you had in the previous question.

Outlines, lists, and a directory tree like we mentioned before are all good steps towards organization.  These come Before the code, the code is used to implement those things.
0
 
LB1234Author Commented:
Ray I did read Norvig's site.  It's good stuff.  I don't really love programming, but I see its usefulness and that enough for me.  And I'll take your advice to heart.

I've gotten my feet wet with PHP and feel like I have a novice's understanding of it.  Should I learn OOP PHP or just keep practicing and building on what I already know in the procedural style.   Also wondering if it's all right to dive into JavaScript, or should I fully master PHP first?
0
 
Marco GasiFreelancerCommented:
Lol, great article!
Personally, only as a small practical guideline, I can suggest to write a list of all you want your site does, offers and shows to your/its visitors/users.
Done this list, you can decide if the site has to be entirely or partially protected with  password; you can choose what is the best path a visitor can follow browsing your site and what has to be the experience you want to give him.

When you know what to do, you can choose how to do it: how many tables in the database? Do you need Javascript/Ajax or do you'll use Php only? Will have to be a responsive web site?

Question by question and answer by answer you'll reach a reasonable knowledge about what you want to can build it. One of the worst thing one can do is begin to write code and then stay to see what happens to make soem correction on the fly. If you plan carefully your work, the rest depends on your knowledge but this one can always grow up with you and with your experience :-). Nobody borns wise!
0
 
Dave BaldwinFixer of ProblemsCommented:
You will never fully master PHP.  Not even Ray has done that because there is always something new being added to it.  It's kind of a circular process.  You learn the next new (to you) piece in HTML, CSS, Javascript, PHP, HTTP methods, server functions, and whatever else and each time you go to the next thing on your list.  You will never run out of things to learn.

And by the way, I'm not so fond of programming.  It may be a good thing in that you won't get attracted to being excessively clever and obscure.  You'll just try to get things to work.

And after 100 sites, you will have a collection of code blocks that you know that work and you will be re-using them whenever you can.  I even have some special code that writes some otherwise tedious and repetitive code blocks.
0
 
LB1234Author Commented:
On a personal note, what keeps you guys, day in day out, helping people with annoying programming issues???  Why do you do it?
0
 
Ray PaseurCommented:
I believe that PHP has nearly 1,500 functions.  That's too many to learn and remember.  But I have done something that few other developers have done.  I have read all of php.net.  It took over a month, and I wasn't reading for comprehension - just for concepts.

The things you want to master come in two broad categories: Client and Server.  On the server side, we have the data model consisting of logic and data, and in this case we are talking about PHP scripts and MySQL data bases.  On the client side we have the presentation (the "view" and the "controller" parts).  Those are made from HTML5, CSS3 and JavaScript, usually in the form of jQuery.  You need to learn a little bit of JavaScript to learn jQuery, but not all of it.  jQuery is a language that implements the good parts of JavaScript.  In our web development courses at Boston University's Center for Digital Imaging Arts we taught these skills in this order:

HTML5 (one week)]
CSS3 (two weeks)
JavaScript (one week)
jQuery (two weeks)
PHP and MySQL (six weeks)

These were full-time students in class and lab eight hours a day, and it was my perception that this was too much information too fast.  The classes should have been half-days and twice as long.  You can't take a sip from a firehose, and the pace of the CDIA curriculum left many students in the dust.  Out of a room full of twenty or so, I usually had three dropouts, three stars and the rest "got it" at some level, but needed a lot more time to become proficient.
0
 
Ray PaseurCommented:
Why do you do it?
I was looking for help with a programming project in 2007 and found Experts-Exchange where I got some really good help - worth many times the modest annual fee.  When I realized that I could make a contribution to the PHP Zone, I decided I would make it a habit to answer one or two questions a day as I had my morning coffee.  Over the course of the last seven years I've handled all kinds of interesting question from the mundane to the extraordinary, and the process has helped me to build a teaching library of examples.  It's sharpened my skillsets a lot and I've gotten at least as much from answering the questions as the authors of the questions have gotten from my answers.  And I get consulting gigs when members of EE need a PHP developer.  So it's a win-win relationship all the way.
0
 
Dave BaldwinFixer of ProblemsCommented:
I do it both for the recognition (which you don't get much as an independent developer) and to learn things.  You can learn a Lot by trying to answer questions.  Other people don't do things the same way so working thru their code and methods teaches you things to do and Not to do.  I've gotten a few consulting gigs from members also.

While I focus on PHP here, I've always been a jack-of-all-trades because I've had to fix whatever it was that wasn't working.  I was an electronics tech and then designer before I starting programming and web design.  I read at least the title of every single question that is posted here to see if it's something I want to find out about.  If it peaks my curiosity, I read the whole question.  And if I think I know something about it, I try to help with an answer or comment.  Sometimes I just 'monitor' the question to see what answers they come up with.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 4
  • 4
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now