RE: Is $PHP = dead; ?

You are viewing a single comment's thread from:

Is $PHP = dead; ?

in technology •  7 years ago 

Yeah I know what you mean about it being overwhelming. When I was learning Java I was looking at just how much it cold do and thought "I'm never going to be able to learn all this!"

But the good thing is you don't need to learn it all.

Learn the bits that you are interested in and get really good at them.

One huge thing to focus on, particular if you want to stay server side, is data modelling - creating data structures in such a way that it is easy to store, cycle and retrieve data.

You want to aim to cycle through and array (or simile) only once per request / page load to get your data.

Where this become really run is that in Javascript and PHP, you can have associative arrays (with text as the array key) (Ok, in Javascript they are Objects, but you can use them like arrays)

That way it is super fast and easy to get data out by using the key and you don't have to iterate across the whole array to find what you are looking for.

Multiple loops and recursion etc really slow down a script's execution, so the less you can do if it the better.

My best advice (in no particular order) -

Code for readability - some poor sod will have to look at your code and edit it long after you have left t live a life of luxury in the Bahamas.

Code for security - being hacked hurts. Never trust any input from anyone. Always sanitize everything that comes into your scripts.

Code for speed - use techniques like the one above to make your code sing right from the start.

Code for fun - enjoy what you do. You will be spending a lot of hours doing it, and a lot of brainpower and frustration and exasperation and a lot of beer and a lot of pizza and hair pulling and yelling at the screen. So if you don't enjoy it, then your life will totally suck.

So learn to enjoy the beer and pizza :-)

Good luck ;-)

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!