Jump to content

how to read ('analyse') scripts??


abdus

Recommended Posts

hi,

Im learning PHP since ~6 months now (and still can't write a pretty simple application :-[)

Anyway this is not the problem.

my problem is ... I can't read code !!

I mean when I try to view some of the scripts spread around the net I could'nt understand them .. where to start.. what this var, func or class is used for, what is it's role and effect in the script especially when it comes to big applications that contain page includes ,numerous classes , enormous variable and functions  names (like vbulletin application for example) although I know the syntax and understand what this certain function or class does alone

but cant figure out what it does in the context of the application and why it is used so Im being looking at hieroglyphs ???.

my question is there any method,tactics, or way to analyse a script .. should I take (for example)classes or function first and dissect them seperately ? or should I start with the index page check it first then take its links? do I have to understand the var name first to help me understand its work.

what you experts do usually when reading a code .. and how much time it took you often ?

please help ..  thanks in advns. 

 

 

Link to comment
Share on other sites

hmmm - hard to help you there - these are terms that may be in cluded in a pre-requisit list for php101 at college...

 

please don't be offended - I'm not trying to get at you - its just if you don't understand some of teh basic terminaology and are unable to follow the flow of a script then I doubt there is anything you could get from anyone over the internet - I suggest you try and find someone who can phyiscally sit with you and hold your hand for a couple of hours - that shoudl give you enough to go and at least follow a script to its conclusion...

Link to comment
Share on other sites

ToonMariner , nafetski

thanks for your replays

actually Im not very bad  Cool.

I know the programming basic concepts (Ive learned some C fundamentals before)

and do some tiny scrips in php.

but I always wonder ,when I stay more than 1hour looking at a page in some script,am I in the right way?

does it worth all that time? do all ordinary programmers stay 1hour to understand just one page of the script

and how they make 'hacks' to some applications.. of course they understood the script very well... HOW!.

so I feel I lack some approach or method to read others' scripts.

 

nafetski..do you have tutorials for a big project or application (10 pages or so) that will be appriciated 

Link to comment
Share on other sites

yes, there is no replacement for experience.

 

when i was first learning PHP and had to make changes to complex code, i would put echo()'s all over the place so I could follow the logic and figure out what files were include()'d or require()'d where. then put echo()'s in those files, etc. as you learn more, it will become much easier to follow logic without echo()'ing every step of the code.

Link to comment
Share on other sites

You have to write lots and lots of code to have a chance at being a good programmer.  Programming is always about efficiency.  How can you do the same tasks better and faster.  The only way you can make a process more efficient is by understanding it thoroughly.  Basically write 10 small programs that do similar things.  As you write each one you'll realize you are repeating certain steps and that is where you take a step back and go, "Now how can I do this so I'm not always repeating myself?"

 

Basically if you want to be a better programmer you have to thoroughly understand the process of writing code.  And you won't have that until you write lots of code.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.