Professional PHP

PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.
« Expert and Novice Programmers
Changes to my blog (and feeds) »

Editing PHP

May 21st, 2005

Tobias Schlitt has a post on Comfortable PHP Editing in VIM.

I’ll have to look at integrating phpm with TextWrangler, which is what I am using right now to edit php. (see mac mini and php) Being able to look up parameters in my editor would be a big bonus for me. I’ve been programming PHP for almost 5 years now and there are still alot of things I have to look up on a regular basis.

I have a theory about editors. People who use a GUI editor pad their operators and commas with spaces and are generous with their horizontal whitespace, while people who use a console editor conserve their horizontal whitespace. So, you can divine the editor that someone uses by looking at their code.

Crackpot or Not?

categories PHP
tags editing-php

Related Posts

  • Zend PHP Framework not a rumor
  • A WordPress bug fix
  • Upgraded to WordPress 1.2
  • PHP Coding Standards
  • Knocked off the internet, a story of Windows and Macintosh
You can leave a response, or trackback from your own site.

8 Responses to “Editing PHP”

  1. #1 Christian responds...
    May 21st, 2005 at 8:52 am

    I am using a console editor rather often, however since I write quite a bit, I am used to padding, because then code is more readable. But generally, I think you are right; when using a console editor you try to conserve space.

  2. #2 RubenV responds...
    May 21st, 2005 at 9:46 am

    As far as I’m concerned, it’s crackpot ;-)

    I’m a big vim adept, yet still my code looks like this:

    $var = function(”a string”, 32);

    Even at 80 chars wrapping, you shouldn’t sacrifice readability.

    But then again, my ideas might be crackpot too :-)

  3. #3 Darkside responds...
    May 21st, 2005 at 10:36 am

    Not. I have a lot of padding in my code, and I’m using BBEdit. Thank goodness that when I got really serious editing php in BBEdit, they came out with document drawers. Otherwise I’d be going crazy.

  4. #4 Toby responds...
    May 21st, 2005 at 10:53 am

    Hmmm… difficult to say. I’m using only VIM since more than a year now. Since I got a widescreen display (which sucks in a way) I think I don’t save horizontal whitespaces.

    Btw. a trackback would have been nice. :)

  5. #5 admin responds...
    May 22nd, 2005 at 5:28 pm

    Toby, I’m embarrassed to say that the BBCode plugin i use doesn’t work for trackbacks, so I don’t usually use them. Hope to change that soon.

    I was setting up a new server this week and I noticed that vi on this new server had PHP syntax highlighting, as well as syntax highlighting for httpd.conf. A pleasant surprise.

  6. #6 Ace Macleod responds...
    June 17th, 2005 at 11:04 am

    I’ve been an Xemacs bigot for over 10 years, and yes I pad my commas and operands religiously.
    here’s an example of my code:
    ———————-
    if (preg_match(”%^operand%i”, $action)) {
    print “operand is true\n”;
    }
    else if (isset($query['action'])) {
    print “action is set\n”;
    }
    else {
    $counter = $numRounds + 3;
    print “This isn’t real code…I’m just doing it for fun $counter\n”;
    }
    ——————
    Readability every time.

  7. #7 Toby responds...
    September 20th, 2005 at 11:47 am

    Just a little hint on something new I made for PHP and VIM: http://www.vim.org/scripts/script.php?script_id=1355 Hope that’s helpful.

  8. #8 Ben responds...
    October 17th, 2005 at 11:04 am

    I use TextWrangler when coding PHP on my PowerBook, and I couldn’t live without BBAutoComplete (http://c-command.com/bbautocomplete/). It’s a free app that provides autocompletion for a number of Mac apps.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

code: use [code=php][/code].

Comment Preview

  • Search

  • Subscribe

    Subscribe All Posts
    Subscribe All Comments
    Subscribe All Bookmarks
    Subscribe with Bloglines Subscribe with My Yahoo Add to netvibes Subscribe in NewsGator Online Add to Google
  • Share This

  • Categories (Home)

    • Agile Methods (14)
    • Mac (14)
    • Misc (17)
    • Open Source (14)
    • PHP (97)
    • Software Design (29)
    • Usability (14)
    • WACT (7)
    • Web Design (20)
  • Recent Comments

    • goto in PHP  45
      wawa, Riccardo Tacconi, Steve [...]
    • Building a culture of objects in PHP  6
      MagicCleanerU, hafizan, [...]
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)  125
      ad, aankun, Hutch [...]
    • Comparing PHP with other languages  22
      ?????, ?y??, Olivier Lalonde [...]
    • WordPress BBCode Plugin  23
      AgeRLeloglalK, smolenskiy, wow [...]
    • Looking Towards the Cloud  15
      Robin, Mohammad, tsst [...]
    • Code Coverage, Feedback and Open Source  3
      rwer, sdfsdf, mayur
    • Firefox Extensions for Web Developers  16
      Salman, Markus, Mitch [...]
    • php | tek Wrapup  6
      Livetek Software, PHP Guru, Scott [...]
    • OOP is Mature, not Dead  15
      Fernando, Chabrell Igan, deltawing [...]
    • nofollow and comment spam  4
      Mozzgggos, sss, Nataly Marshak [...]
  • Pages

    • Tags
  • Recent Posts

    • Looking Towards the Cloud
    • Holiday Tech Support
    • Closures are coming to PHP
    • php | tek Wrapup
    • php | tek 2008
    • Sarah Snow Stever
    • Benchmarking PHP’s Magic Methods
    • The Endpoints of the Scale of Stupidity on Video
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)
    • Keywords and Language Simplicity
  • Archives

    • 2009: Mar Apr May
    • 2008: May
    • 2007: Jan Feb Mar Apr May Sep Oct Nov
    • 2006: Jan Feb Mar Apr May Jun Jul Oct Nov Dec
    • 2005: Jan Feb Mar Apr May Sep Oct Nov Dec
    • 2004: Apr May Jun Jul Aug Sep Oct Nov
  • Menu

    • Register
    • Log in