ASPit - Totally ASP JSit - Totally JavaScript
Search PHPit

Use this textbox to search for articles on PHPit. Seperate keywords with a space.

Advertisements

5 Tips To Speed Up PHP Development

(Page 1 out of 2)

Introduction

As PHP developers, we all like to create our PHP scripts as fast as possible, and we try to take any shortcuts that we have. In some sense we are quite lazy, and we hate doing all the grunt work. That's why I'm going to give you five tips to really speed up your PHP development, and save some serious time. If you're an experienced PHP developer, these tips will probably seem very obvious to you, so this article is geared more towards beginners.

Tip #1 - Use a good editor or IDE

Using a good editor can really save you time. If you're still stuck on using Notepad to edit your PHP scripts, switch right now. There are plenty of free alternatives around, such as PHPEdit or EditPlus 2 (Shareware). The biggest advantage you get with a proper editor is code highlighting (automatically coloring your code). Code highlighting can help you debug your scripts, or follow code logic. Most editors support code highlighting, and if yours doesn't, then you know it's not suited for coding.

Another great advantage of using a good editor is the ability to do powerful search-and-replace operations. I know for a fact that EditPlus 2 supports regular expressions in their search-and-replace functionality, and I bet most editors do. It just makes it so much easier to replace a snippet of code. Imagine having to replace something by hand hundreds of times. Think of the time that gets wasted.

You can also use a full-blown PHP IDE (Integrated Development Environment). Unfortunately, there aren't many PHP IDE's, and most of them are quite steep in license fees. The best one on the market is Zend Studio, by Zend (the company backing PHP). An IDE can really save you time, by making the debugging process easier, and some IDE's (such as Zend Studio) also include IntelliSense, which will help you with function names and such (e.g. you start typing file_get.. IntelliSense shows a dropdown that matches what you were typing. It's brilliant).

In short, use a good PHP editor or IDE, and you'll save a massive amount of time!

Tip #2 - Use a framework or skeleton

Most of your PHP scripts will probably do many of the same tasks, such as database functionality (insert, update, select, delete), and have many of the same functions. You could re-write these functions and tasks every time you start a new project, but that seems a bit pointless. Instead, you could use an existing framework or skeleton, and base your new scripts on that.

You can either use a full-blown PHP framework, like CakePHP or the Seagull Framework, but you can also use a very simple skeleton that you create yourself. It doesn't have to be complicated at all, and can even be just one file which contains all the functions you commonly use.

If you've already written part of your new script, you've already saved time, no matter how much or little you've already written. If you use a framework, the structure of your script has also been determined already (largely), which can also save time.

In short, you should try to re-use as much code as you can, and try to create (or download) some short of skeleton or framework to really speed up development.

Tip #3 - Don't re-invent the wheel

Continuing the previous tip, something that really speeds up development is using existing solutions. I'm not talking about a skeleton or framework, but using a full-blown script, and customizing it to your needs.

If you're going to build a CMS for your website, which is actually one of the most common things PHP developers create, then you should first look at existing scripts. There are plenty of great scripts already, and many of them are completely free, often licensed under an open source license, such as the GPL license. A good example of this is WordPress. Originally, WordPress is a blogging tool, but it can easily be used as a CMS for your website, and you can even extend it using template hacks, plugins or code modifications. This will save you a significant amount of time, which means you can focus your time on other tasks.

Of course in some situations, when you have really specific needs, it won't be possibly to use an existing script, but before you start, try and find something that resembles your needs. Have a look on HotScripts and search Google. There's a big chance that it already exists.

Next: Tips #4 and #5 »



15 Responses to “5 Tips To Speed Up PHP Development”

  1. Millisami Says:

    I’ve gone through many articles to find and understand good PHPFramework.
    I did find many articles and frameworks.
    But this article helped me a lot not in the sense of the ‘Speed Up PHP Development’ but in the sense of good framework like Seagull, CakePHP.

    Thanks a lot.
    Regards
    Millisami

  2. Harinder Says:

    HI,

    The advices you have written are very good and practical. The soutions you have given can really save developers time.

    Thanks

    Harinder

  3. Ryan Says:

    Another good PHP editor, (sorry linux only), is Quanta Plus…I use it all the time. Code completion, syntax highlighting, project based, etc….and its free

  4. Rod Says:

    I use EnginSite PHP Editor/IDE from Luckasoft. It’s excellent!

    http://enginsite.com/php-editor.htm

  5. Ben Says:

    And another good PHP editor ive found is one called PHP designer 2005. Occasionally a little buggy, but free and one thing i like is that you can set it to type the close of brackets when you open them, and puts the cursor in between. Also has a syntax checker if you download the php intepretor

  6. Daniel Says:

    I too use PHP Designer 2005. It is very handy, especially when you download the interpretor (http://www.php.net/downloads.php). The interface shows the includes and classes in a tree so you can see the layout. Also has the code coloring for HTML, CSS, XML, PERL, JS, VB, C# and even SQLs. As stated in the beginning of this article, I used to be one of the ‘notepadders’. :) I must admit though… Not having to count lines to find an error (with wordwrap turned off) is worth a lot to me!! Great article, Thanks much!

  7. Spajus Says:

    There’s no alternative for speeding up things to Zend Studio. Code coloring is a must for even a text viewer nowadays. And you should use PHPDOC type of comments, not //some thing ones…

  8. Dennis Pallett Says:

    I don’t really like PHPDoc type of comments myself. I find them really annoying, and it really clutters up my PHP files. I’d rather have the documentation seperate.

  9. Matt Kaufman Says:

    I have a license that I bought for Zend IDE, and I actually prefer (and use) jEdit over it .. it’s far faster and has a great set of plugins that can be added in very easily: http://jedit.org

  10. Luk Says:

    For me the best editor is Notepad++

  11. SN Says:

    I have been using a framework not mentioned in the tips called Zoop Framework for PHP. It has really helped me productivity wise. Thanks for your tips. Additionally I have been using Quanta myself as an Editor. It doesn’t have a windows port, but runs great on linux and macOSX, is free, and has an Intellisense like feature.

  12. Kevin Says:

    I would have to disagree with the part that says: Don’t re-invent the wheel. This is a very limited way to tell php programmers, as being lazy and not promoting development. Yes you can customize those scripts, but why do that when you have to ability to code your own. Who cares if it takes a little while, atleast it can be a very good learning tool. But I do have to say people new to php could use one of those, but don’t discourage ones who are able to code their own CMS, or whatever.

  13. makro Says:

    I partially agree with the author BUT i have to say, that many Frameworks as well as Scripts have various downsides, which could well slow down the development process in the long run:

    1.) Licenses: What to do if you used a script / framework under GPL (free) and want to go commercial?
    - You have to publish all of your code, what in turn makes the whole application vulnerabe, because everyone can see your source.

    2.) Functions: What if you depend on a framework and some day need to implement functionality, which the framework does not provide.

    - You have to rewrite the app or extend the framework itself. All your changes are like to be lost after a applying a Framework (sourcecode) update.

    3.) Modules: So you use modules for your framework to speed up development, huh?

    - Many bad things can happen to your app: Sourcecode of every module you use is public (vulnerable).
    - Licenses can change, can be tricky or expensive.
    - Updates of the framework can break the module.
    ….

    There are many other concerns on this topic but they would be out of scope of this posting.

    For my work as freelance programmer and systems professional i always “reinvented” the wheel and this is what i got:

    Thin, fast, reliable, “personal” and secure Applications or Daemons.
    No other solution than the tailored one can really do what you (or the customer) want to do it.
    Frameworks and CMS are often slow, unsecure and offer all-singing-all-dancing stuff, you really will (probably) not need.

    I always said: Quality overrules Quantity.

    If more Programmers and Companies would get the point of this statement, there wouldnt be so much, really much, crap pieces of software out there.
    Additionally, speeding the development process (which includes analysis and design AND testing / debugging) has negative effects on the income of the developer and the financial expectations of your customers. This is where relationships between development, open source, closed source, marketing and so on come into view and covering these here would be FAR BEYOND the scope of the article and this posting.

    It always is hard for the worker when the market exploits his industry.

    Greetz,
    makro

  14. WC Says:

    1) Publishing your source code does -not- make it more vulnerable. Bad coding does. Publishing bad code only makes it easier to find the loopholes.

    2) Extending a framework is easier than writing the whole thing from scratch.

    3) Licenses can’t change on the current version of a module. Future revisions, yes, but not the current one. Update of -anything- can break your code. That’s life. It’s still a -lot- faster to fix the new problem than write everything from scratch.

    The programming market is changing. Speed of code is not nearly as important as it used to be, and speed of creating code is much more important.

    There will always be jobs for ‘reinvent’ people, but the current market trend is towards ‘reuse’ people.

  15. Steve Says:

    Frameworks are good. But make sure you select one that you are comfortable with. Don’t just follow the pack.

Leave a Reply

About the author
Dennis Pallett is the main contributor to PHPit. He owns several websites, including ASPit and Chill2Music. He is currently still studying.
Article Index
  1. Tips #1 - #3
  2. Tips #4 and #5
Bookmark Article
Download Article
PDF
Download this article as a PDF file