Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,745 members, 7,817,056 topics. Date: Saturday, 04 May 2024 at 01:55 AM

How Do I Read Through Huge PHP Code Samples? - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / How Do I Read Through Huge PHP Code Samples? (774 Views)

Pls Help Me With This Php Code / Help On Php Code For A Dice Game / Help With This Php Code. (2) (3) (4)

(1) (Reply) (Go Down)

How Do I Read Through Huge PHP Code Samples? by Ajistotle(m): 8:25pm On Jul 20, 2014
I am a beginner programmer. I am interested in developing web applications and so I am learning PHP. I have read 2 books, an introduction to the the language and a more advanced one treating a little more advanced concepts like object oriented programming, serialization etc.

I am trying to become proficient at the language and at programming in general and so I have decided to read through open source codes. For starters, I have downloaded Elgg, an open source social networking script written in PHP.

The sheer number and amount of code however makes me wonder, where do I start? Do I just open each and every file and prod through it continually until I know what it does, or are there tools that can enable sorting through and making sense of huge amounts of code written by other people?

I am sure this is something every beginner programmer can relate to. The examples in books are usually small and compact and in no way prepare anyone for the real thing.

Pros, please kindly share your thoughts, ideas and suggestions on how to make it through this weaning stage. Thank you
Re: How Do I Read Through Huge PHP Code Samples? by dhtml(m): 9:31pm On Jul 20, 2014
You want to become an advanced copy-paster at this rate and not a programmer. I am sorry but i cannot help you - that your approach cannot help you learn programming.
Did you read the documentation of the social networking script BTW? If you did, you will understand that a beginner programmer cannot manipulate the codes as easily as you think. Even a professional will have to work with documentation otherwise the entire code may become a liability rather than an asset.
Re: How Do I Read Through Huge PHP Code Samples? by GodMode: 10:03pm On Jul 20, 2014
the guy above me was once like you... Do not be discouraged by his cruel words.

Learn php/mysqli for now and u'll be good to go.

1 Like

Re: How Do I Read Through Huge PHP Code Samples? by dhtml(m): 11:11pm On Jul 20, 2014
You do not presume to know me, speak for yourself. @op, he is not my brother.
Re: How Do I Read Through Huge PHP Code Samples? by okeyxyz(m): 11:28pm On Jul 20, 2014
OP
The best (and I think only way) to master PHP is to build an app first. Build with raw PHP codes that you write yourself(don't use a framework), that way you get to experience & understand how webapp components work because your build them yourself & from scratch. Components such as: Menus & links, sessions, cookies, emails, SQL data input & output, user registration & logon management, pagination, templates, etc .

After this, then reading/using huge libraries of major open source applications/frameworks/CMS becomes easier to understand and to implement. You are able to use them in a flexible manner, choosing what parts of such libraries to use for your project rather than just following instructions without knowing what's happening "under the hood".
Re: How Do I Read Through Huge PHP Code Samples? by dhtml(m): 11:34pm On Jul 20, 2014
Thank you o, that is the only way i know too. Meanwhile, i am assuming the OP has already gone through HTML,CSS and possible a little javascript (not compulsorily), because building a real-life application is going to involve all these and not just PHP.
@op, i am sorry if my initial post was a bit harsh. I was just rather upset that you called yourself a beginner and you just wanted to JUMP like THAT? You needed some flogging to get your head straight - what were you thinking? You wanna blow your head?
Ooops, i did it again! sorry. . . .
Re: How Do I Read Through Huge PHP Code Samples? by Nobody: 9:27pm On Jul 21, 2014
dhtml: Thank you o, that is the only way i know too. Meanwhile, i am assuming the OP has already gone through HTML,CSS and possible a little javascript (not compulsorily), because building a real-life application is going to involve all these and not just PHP.
@op, i am sorry if my initial post was a bit harsh. I was just rather upset that you called yourself a beginner and you just wanted to JUMP like THAT? You needed some flogging to get your head straight - what were you thinking? You wanna blow your head?
Ooops, i did it again! sorry. . . .
This is my Oga talking grin
Re: How Do I Read Through Huge PHP Code Samples? by Nobody: 9:27pm On Jul 21, 2014
dhtml: Thank you o, that is the only way i know too. Meanwhile, i am assuming the OP has already gone through HTML,CSS and possible a little javascript (not compulsorily), because building a real-life application is going to involve all these and not just PHP.
@op, i am sorry if my initial post was a bit harsh. I was just rather upset that you called yourself a beginner and you just wanted to JUMP like THAT? You needed some flogging to get your head straight - what were you thinking? You wanna blow your head?
Ooops, i did it again! sorry. . . .
Re: How Do I Read Through Huge PHP Code Samples? by sarutobi: 10:21pm On Jul 22, 2014
Ajistotle: I am a beginner programmer. I am interested in developing web applications and so I am learning PHP. I have read 2 books, an introduction to the the language and a more advanced one treating a little more advanced concepts like object oriented programming, serialization etc.

I am trying to become proficient at the language and at programming in general and so I have decided to read through open source codes. For starters, I have downloaded Elgg, an open source social networking script written in PHP.

The sheer number and amount of code however makes me wonder, where do I start? Do I just open each and every file and prod through it continually until I know what it does, or are there tools that can enable sorting through and making sense of huge amounts of code written by other people?

I am sure this is something every beginner programmer can relate to. The examples in books are usually small and compact and in no way prepare anyone for the real thing.

Pros, please kindly share your thoughts, ideas and suggestions on how to make it through this weaning stage. Thank you

I totally understand how you feel. Everybody who calls themselves pro have been where you are.

This is what you should do:

Every code has a start point. As in the case of php, the start script is often called the index.php file. This file includes core libraries and bootstraps them. These core libraries correspondingly loads related classes and instantiates them. These goes on an on until the the php process exits. Think of it like a call profile from the most general to the most specific. You must have a perfect understanding of oop and design patterns else everything will look like magic to you. Also try installing the xdebug module for your php version. Xdebug will show you what function called what other function etc.

If you are using eclipse as your IDE, please take a look at the call stack for each page load. This technique is a shortcut and i strongly recommend you go with my first option.

(1) (Reply)

Semina Topic: Etichkal Hacking / Is Programming A Dead End Job? What Are Your Thoughts? / A Novice In Java Programming

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 24
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.