Take the 2-minute tour ×

When writing PHP code for any given project, do you find you can write code off the top of your head? Or do you make multiple round trips to php.net? If it is the later, can you still be considered a good coder. This is a legitimate question as I find I have difficulty always remembering all of the functions that are available to me so I find I use php.net as a crutch. Is there anyway to improve this?

share|improve this question
If you don't know ten things off the top of your head, I'd prefer it if you looked up twenty than eight. It's better to make sure than make errors. –  David Thornley Mar 8 '10 at 20:11
Thanks David. That is great feedback. I also focus on quality... this is very sound advice to ensure quality. The take away for me is it (for a literal example) may be better to implement a switch() than if...elseif...elseif...elseif. Great advice. Thanks! –  Chuck Burgess Mar 8 '10 at 20:15
Thanks everyone for you great feedback! I feel much more confident and focused on what a good coder is. I realize it is more about accuracy and readability of code, not how you got to that point per se. Speed is also an issue, but for me quality is much more important than speed. Thanks to everyone who contributed! –  Chuck Burgess Mar 8 '10 at 20:40
IDE's with autocompletion helps me, try it out :) Eclipse and many, more with it, features an almost complete documentation right as you code. –  chelmertz Mar 8 '10 at 20:46
The number one reason I check php.net is because of the inconsistency in naming functions and the order of function arguments (salt and haystack anyone?). The functions you use on a daily basis will stick around soon enough. But with the case of PHP, the inconsistencies I named, I still struggle. A good IDE can help a bunch with this by the way :-). –  Htbaa Mar 8 '10 at 20:47

8 Answers 8

up vote 12 down vote accepted

Being a good coder doesn't exclusively mean that you know everything off the top of your head. Most of being a good coder is knowing how to approach problems and solve them. I've been writing PHP for 7 years now and regularly find myself consulting the manual. Sure, I don't check it as often as I used to, but with a language as large as PHP (and with as many inconsistencies), it'll always be necessary to check the documentation. As with anything, over time you will remember more and more.

share|improve this answer
Thanks for the feedback. I appreciate the encouragement. –  Chuck Burgess Mar 8 '10 at 20:22
One major part of problem solving is knowing where to look when you're stuck. I don't think that anyone's brain can hold everything, hence why there are todo lists, sticky notes, etc. –  KFro Mar 8 '10 at 20:42

The same as any language (computer or otherwise) - the more you use it, the better you get.

An issue with PHP is the unpredictability of function names and arguments.

share|improve this answer
Thank you! Sounds like I will need to keep at it. I just wonder if it will ever get easier? –  Chuck Burgess Mar 8 '10 at 20:06
I've been writing PHP for almost 10 years now. I still have to go to php.net all the time. The function names are really dumb and most are impossible to remember. –  Marc W Mar 8 '10 at 20:08
Definitely agreee with the uncertainty about the names point. I've been doing HTML for 7 years and (with the exception of HTML5) I can do it all by hand in notepad (or another text editor). Granted, HTML isn't even a scripting language, it's a step in the right direction. –  Moshe Mar 8 '10 at 20:10
str_replace and strpos are a classic example - arguments different ways round, and inconsistency in naming. –  Rich Bradshaw Mar 8 '10 at 20:40

I think that one of the secrets of becoming a great coder is to read a lot of documentation. I have seen far too many people using the same limited tools over and over again, or desperately doing trial and error instead of broaden the perspective by reading documentation. Don't be ashamed of looking things up - be proud that you have the right attitude to be able continously learning things.

share|improve this answer
Thank you for your perspective. My take away is "be humble". Don't think you have to know everything / or assume you know everything. This is great advice. It is better to look it up and be write, than to wallow in mistakes ever trying and never improving. –  Chuck Burgess Mar 8 '10 at 20:31

Don't judge your ability based on how fluent you are in a specific language or framework. Always keep in mind that the PHP gods would likely flounder if they were told to write something in C#.

If you are able to put out good code in a reasonable amount of time, it really doesn't matter what you use for assistance.

share|improve this answer
Great comment! This makes sense to me. I guess all that really matters is the end product right? Bonus is that the code is readable and put out in a reasonable amount of time. I guess there is always the notion that you can recognize good code when you see it, right? –  Chuck Burgess Mar 8 '10 at 20:20
Exactly. Also, if you read just to 'make sure' even if you are reasonably certain you know what's going on, there's always the chance you will learn something new. –  aehiilrs Mar 8 '10 at 20:23

Being a good coder and having a good memory (thankfully) have nothing to with one another.

Now, not having to look up method names and such can be a time saver, and being fast is part of being a good coder. However, that's what IDEs are there for. If you find yourself looking things up really often, get a PHP IDE with good intellisense and context specific help.

share|improve this answer
This is too true! I had been using Dreamweaver for a long time. Mostly because I had it and I couldn't really find an IDE that I liked. But now, I use Komodo and I am able to find things quicker. Not to mention, I am able to document my code better because of the intellisense built in for comments. So what you say is accurate as well. Thanks! –  Chuck Burgess Mar 8 '10 at 20:38

My frequent trips to PHP.NET are mainly due to confusion with the other languages I work with. I usually remember the names of the functions in PHP, but need to double-check the order of the parameters. I don't think that makes someone a bad programmer. If your reason for visiting PHP.NET is to remember how to do an if statement on the other hand...

share|improve this answer
I don't have issues with the simple functions that are virtually common among all languages (if, foreach, etc.). But there are times I cannot remember the name of the function. For example, strrpos() to find the last occurrence of a needle/haystack. I do not use all of these functions frequently enough to keep them committed to memory. So I usually find myself searching for the command, then seeing the required parameters, I then can write what I need. –  Chuck Burgess Mar 8 '10 at 20:12

I think that referencing the documentation when you are unsure is a very good practice. Not only can you avoid making silly mistakes you may also discover different ways to go about doing something, potentially saving you a lot of headaches.

I don't think having a perfect recall of everything you have learned in the past is what makes you a good programmer; I think developing the problem solving skills that are necessary is what will enable you to become a good programmer.

My two bits, Rob

share|improve this answer
Thanks Rob. Great summary! –  Chuck Burgess Mar 8 '10 at 21:12

When I was new to PHP, I used to refer to official PHP file (a chm file) a lot but now I don't make much trips to either that file or php.net as i have been using all those functions again and again, remembered automatically with passage of time that is experience. :)

In short:

Practice does the trick.

share|improve this answer
I think that is where my problem is. In high school, I was an actor. I could remember entire scripts having played the lead role in multiple shows. I have been using PHP for quite a few years albeit inconsistently, but I still have trouble remembering. Maybe it's the age? (40yrs and climbing) Who knows? Maybe I need to work at a job where I use it daily, then things will get better. –  Chuck Burgess Mar 8 '10 at 20:18
@cdburgess: As the science of mind tells, you are able to memorize things quickly when you have strong observation, and kids have this more than us. At school times, you have better observation allowing you to remember things easily but with the passage of the time this strong observation keeps on fading and you are not able to remember the things like you did in school. –  Sarfraz Mar 8 '10 at 20:34
To true! Sucks getting old. ;) –  Chuck Burgess Mar 8 '10 at 20:36

Your Answer


