PHP – NONCODERS – Reasons for the code.
As coders we are lazy
I find now that meet more and more coders we are all driven by a very similar goal. The main goal that fuels most coders is to be as lazy as possible. This doesn’t mean we don’t try or put effort in but if it came down to it coders in my experience will work smarter and not longer every day. I don’t know if it is just we want to get back to our video games, or beds but if there is a way we can do something cool without needing to continually update or type in every different element the better.
Make it so I don’t have to type so much
There are many types of ways to remove redundancy in PHP. One of the great tools is the looping logic I will get into this with my post for the basics of code. But for now it is a way to loop through items that are similar so you can execute a task on a list of things.
One of the other things that make less typing is the concept of functions. Functions are a set of actions that can be retriggered every time you need to use them. Functions are great from calculations, or validation of forms and really your imagination is the limit.
Make it flexible so I don’t have to write another page
Making a thing think is really where I get excited about code. I don’t know if it is because I love logic or it is great to see something interact with somewhat complicated reactions with a set of very basic rules. Later I will talk about conditionals but right now it is broken into the simple thoughts of “If this then do that” or “do something else.”
Make it easier to update
Anyone who has written a website can tell you that the concept of includes are the greatest thing since sliced bread. The wonder of writing an element that shows up in multiple places but only has to be altered once is just fantastic. Many web designers are already familiar with this concept because this is used in CSS. You write a single document to decorate your pages site wide. Be careful with this one though. It is dangerous to “include” too many parts of a single page because it is complicated to keep it all-straight. I shoot for 4 included elements in a page more then that I start loosing where a div ends and starts. But “including ” is used right it is a great tool to centralize elements that are reused and would be complicated to correct over many pages.
No commentsNo Comments
Leave a comment

