By raindoll
via reinholdweber.com
Published: Feb 04 2008 / 07:54
This is something I prefer to call my "programming list of shame". Although having a formal university education I have been guilty of every single one of those things at one time or another.
Comments
Walkere replied ago:
Wouldn't say I agree with everything on the list, but interesting nonetheless.
I hate uncommented code, but I often start out scripts by not commenting. I go back later and re-comment when/if I get it working satisfactorily.
I always try to plan thoroughly... but I tend to start scripting halfway through and just do the rest by the seat of my pants.
I HATE when stuff is echo'ed in a function instead of returned. Grr...
I disagree about templating. I've never used it on a project I created, but I found it tremendously helpful when I was working with a larger project (CMS Made Simple).
Travis Swicegood replied ago:
Some of the best programmers in PHP-land use Vim and most of the ones I consider half-way decent consider the current slate of IDEs a complete waste of time unless your using its interactive debugger.
antych replied ago:
You should know better that using IDE has obsoletely no correlation with someone's skill. It comes down to knowledge and experience, not tools. Some people are just adventurous and look for shiny tools to make them more productive, other feel somewhat intimidated by them and stick to what they know.
robse replied ago:
Nowadays when you apply for a job as developer you would have bad chances if you don't even know an IDE.
And for good reason.
antych replied ago:
Maybe in Java world where IDE does most of the job for you. I'm all for IDEs, I like them, I use them.
But I recently gave up on encouraging people to switch. At some point you need to realise that some people just don't want them and they shouldn't be penalized as long as they can do their job. Even if they lose 10% or something efficiency , I'd rather work with people that like their job and use their favourite tools than poor developers armed with IDEs.
dzonereader replied ago:
Agree to this, dont waste hours to configure big fat IDE when it can be done quickly without them, be pragmatic not the follower!
raindoll replied ago:
- seeing the benefits of an IDE is more about not just being a programmer nerd & having to use your favorite editor but doing what you do in the most effective and fast way possible because that is what counts when you earn your living programming php or any other language
- about the template engine - please read the linked discussion on sitepoint for the reason why I think you don't actually need one
Warm regards & thanks for dropping by - Reinhold
c-ovidiu.tk replied ago:
I'd say that Vim is more intimidating than most IDEs.
c-ovidiu.tk replied ago:
Whoops. Replied to the wrong post.
antych replied ago:
I guess it works both ways, depends where you start
antych replied ago:
Pretty pointless and controversial list. Some points are good some are plain stupid. There are some inaccuracies too, like Subclipse is not a version control system, it's a Subversion plugin for Eclipse.
Not a very good list...
robse replied ago:
better his list than no list at all
EllisGL replied ago:
#19 - don't use __autoload - So if I don't use __autoload - i'm a bad php programmer? But ....
http://reinholdweber.com/?p=3
#3 - on this list says don't use __autoload
raindoll replied ago:
Using __autoload when programming OO style is good because all your classes get loaded only when needed/instantiated unlike the much too often used alternative with include/require(_once) or however you prefer to load them.
My other article is about optimizing your scripts which can get quite theoretical and you can argue about the real-life effects of most of them. There are many other aspects of optimizing like databases, load balancing, ... that are not mentioned simply because it is just about php.
PHP's magic methods tend to be a tad slow sometimes compared to alternate solutions, and depending on the context the same is true for __autoload. That's what I was trying to say anyway. It all depends on the context.
For a benchmark of PHP's magic functions see http://www.garfieldtech.com/blog/magic-benchmarks
Thanks for reading and posting your opinions.
EllisGL replied ago:
No problem.
evarlast replied ago:
#6 is not good enough. Parameterized queries are the ONLY way to go.
ATSkyWalker replied ago:
mmmm. Subclipse is not a version control system! Its a plugin for Subversion, which is, in fact, a version control system. So here's my #41:
- If you don't know the difference between an IDE plugin and a version control system.
raindoll replied ago:
@ the downvoters - how someone feels the need to downvote this in my opinion very helpful list because he doesn't like 1 out of 40 points, an IDE or hasn't read "This is completely subjective & Eclipse oriented" (Subclipse) is clearly beyond me.
But it's the internet, right? :-)
antych replied ago:
You have too much faith in yourself. I think most of those points are wrong in some way. Not to mention inaccuracies, many points are vague or not applicable in many situations. This list shows that you either lack experience and are lousy developer yourself or you just didn't pay enough attention building this list.
For example, you mention filtering input, what about escaping output? You mention DRY and KISS, what about YAGNI?
Many points are so vague that it's even hard to comment on them. You are lousy if you don't refactor? What if don't need to? You will rewrite code just for sake of it wasting time and money?
You use design patterns to optimise your application? DP improve your design often sacrificing performance for readability and maintainability, this is kind of opposite to what you claim.
I could continue but I don't want this to turn into a flamewar. You should improve the list, make it better, don't suggest that someone is lousy not following this rules. Name them as your own best practices or something.
eelmore replied ago:
Sign #1: You use PHP.
(I voted this up for its theme on disciplined coding)
section31 replied ago:
I don't know about lousy, how about amateur.
tCodex replied ago:
I voted against this for 2 reasons: 1) I get sick of all the holier than thou preaching from developers who must make 1million a year for all of their expertise. 2) What a waste of time to hit people over the head with a hammer instead of lead by example - If I had time to waste writing baseless articles like this I would be the millionaire...
eelmore replied ago:
Hammers are more fun ^_^
Voters For This Link (18)
Voters Against This Link (12)