Solved

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

Posted on 2014-01-24
13
524 Views
Last Modified: 2014-01-24
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
Comment
Question by:LB1234
  • 4
  • 4
  • 4
  • +1
13 Comments
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 200 total points
ID: 39807676
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
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 200 total points
ID: 39807693
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
 
LVL 1

Author Comment

by:LB1234
ID: 39807703
Ray, good stuff!  Do you know where I can find examples of PHP code with annotations?
0
 
LVL 1

Author Comment

by:LB1234
ID: 39807705
Lol, only 100 Dave?  Are you saying that the process just develops organically over time?
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39807713
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
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 200 total points
ID: 39807718
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 1

Author Comment

by:LB1234
ID: 39807723
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
 
LVL 30

Assisted Solution

by:Marco Gasi
Marco Gasi earned 100 total points
ID: 39807726
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
 
LVL 82

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 200 total points
ID: 39807736
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
 
LVL 1

Author Comment

by:LB1234
ID: 39807792
On a personal note, what keeps you guys, day in day out, helping people with annoying programming issues???  Why do you do it?
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 200 total points
ID: 39807803
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
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39807815
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
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 39807891
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now