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
https://forums.phpfreaks.com/topic/100489-how-to-read-analyse-scripts/
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...

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 

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.

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.