After seeing the site I mentioned ye, Function A Day, got me thinking of something.
You often hear experienced PHP programmers say that there is a mentality among PHP coders to only use a small subset of PHP's capabilities. I know this is true from my personal experience where I have written a functionality I needed, small or large, and later found that there already was something very similar implemented as an extension that came bundled with PHP.
The reason this happens is that we are not always aware of all the possibilities that PHP offers. In fact, I find it amusing that some programmers are puzzled by this; often contributing it to inexperience and outright sloppiness. While I do not doubt that is often the case , I do doubt that it is the principle reason though. The simple fact is that there is just too many darn functions in PHP to keep track of and more are added all the time. Most of the time it is actually easier to just write the piece of code you need than to browse Google and the PHP manual looking for a specific functionality. I would even argue that it is a weakness in PHP that there are so many functions.
Another good reason not to always rely on PHP's functions is that they may have annoying defects or they simply do not behave the way you want them to. The final reason to code things for yourself is just to keep yourself writing code. With an abundance readily available functions and classes, with out-of-the-box solutions, it is easy to get lazy and rely too heavily on them. This damages a programmer's own skill to write basic things from scratch. Personally I find it helpful to understand the underlying principles of a PHP function before I use it and the best way for me to do that is to write the function myself.
In my mind, the solution to this problem is to use PHP's wide array of functionality but not obsessively. Remember to rely on your own skill and imagination when solving problems. If there is a quick fix in the form of a PHP function, by all means use it. It is faster and more efficient but do not spend an hour pouring through the manual when you could have written your own solution in just ten minutes.
Showing posts with label principle. Show all posts
Showing posts with label principle. Show all posts
Tuesday, December 11, 2007
Saturday, December 1, 2007
Developer's Dogma
I figured I would start the Developer's journal with an overview of what programming is to me how I approach it. My favorite language to work with, without a doubt, PHP but I have been known to write in Perl, C, Java and C# in the past. For whatever purpose, no one can say. I have chosen PHP as my primary tool to work with because developing new and better web applications is what interests me. It is an ungrateful endeavor because a lot of application developers often look down on web developers. Many hardcore Java and C developers see dynamic languages as merely toys that kids play with. This attitude has lessened somewhat during the past couple of years with the advent of major web applications (other than the usual CMS, framework, or bulletin board software) like Google's web office and Microsoft's commitment to ASP.NET. The support of major corporations into the development of serious web applications has somewhat "redeemed" the web developer community.
However there are still many misguided people with strange and even utterly misconceived notions about dynamic languages and the programs that we write with them. I am not saying that everyone or that even the majority of programmers fall into this category. But the unfortunate truth is that these individuals still exist and they have an active impact on the community.
But I have always believed that it is important, especially to yourself, to stand up for what you believe in. Do not be afraid to have opinions and stand by them. There are fewer wrong opinions than right ones. In fact it is more important to have opinions than not have them at all. The world would be a lesser place if we were afraid to make a stand just because we were afraid of being prooven wrong.
This dogma has helped me tremendously over the years. I have been known to be wrong many times but my life is richer for it. When you are a programmer this kind of mantra is even more important because it can be a very unforgiving environment. Most programmers are not afraid to tell you what they think, wrong or right, and when there is a conflict of opinions (which is say ... often) at best they disdain at your presence and worst they despise you.
So why are there so many differences in opinions? Because programming is an active process that keeps developing. You can learn new things every day of your life and in every program there is always room for improvement. It is a perfectionist's nightmare. Then there is also the fact that programmers use different tools that behave different and most of us have styles and preferences that can differ like the sun and moon from each other. This is the reason why you should never be afraid to push yourself onward. Try new tools, new methods, new design principles, etc. You are likely to make more mistakes by trying new things but in the end you will also make better and more useful things that way. In a society is becoming more dependent on technology at every passing moment, this can only be a good thing.
So here in short is my developer's dogma:
However there are still many misguided people with strange and even utterly misconceived notions about dynamic languages and the programs that we write with them. I am not saying that everyone or that even the majority of programmers fall into this category. But the unfortunate truth is that these individuals still exist and they have an active impact on the community.
But I have always believed that it is important, especially to yourself, to stand up for what you believe in. Do not be afraid to have opinions and stand by them. There are fewer wrong opinions than right ones. In fact it is more important to have opinions than not have them at all. The world would be a lesser place if we were afraid to make a stand just because we were afraid of being prooven wrong.
This dogma has helped me tremendously over the years. I have been known to be wrong many times but my life is richer for it. When you are a programmer this kind of mantra is even more important because it can be a very unforgiving environment. Most programmers are not afraid to tell you what they think, wrong or right, and when there is a conflict of opinions (which is say ... often) at best they disdain at your presence and worst they despise you.
So why are there so many differences in opinions? Because programming is an active process that keeps developing. You can learn new things every day of your life and in every program there is always room for improvement. It is a perfectionist's nightmare. Then there is also the fact that programmers use different tools that behave different and most of us have styles and preferences that can differ like the sun and moon from each other. This is the reason why you should never be afraid to push yourself onward. Try new tools, new methods, new design principles, etc. You are likely to make more mistakes by trying new things but in the end you will also make better and more useful things that way. In a society is becoming more dependent on technology at every passing moment, this can only be a good thing.
So here in short is my developer's dogma:
- Always stand up to what you believe in.
- Do not be afraid to take risks and venture into the unknown.
- By experimenting and talking with others in the field, try to recognize new and better ways of doing things.
Subscribe to:
Posts (Atom)