[web] What do you use to write PHP?

Started by
30 comments, last by spookycat 16 years ago
I use Programmer's Notepad (its text editor can mix-and-match PHP/HTML/&#106avascript/CSS in a single file, which is useful).

For debugging, I insert a check at the start of the main source file to see if the software is running locally (ie, not on a production server), and if so insert a custom error handler that displays a neatly formatted backtrace when something goes wrong. Not very elegant, but it works well enough for me. [smile]

[Website] [+++ Divide By Cucumber Error. Please Reinstall Universe And Reboot +++]

Advertisement
Quote:Original post by ToohrVyk
I wonder how you can do better than simply grepping the name in the entire source directory... PHP doesn't have the static structure required to do serious static analysis.

This is true--it's a sad byproduct of such high-level languages that it's nigh-impossible to have an IDE do all the cool stuff I'd wish it did. For instance, "Show me where this function is defined" or "List all member functions of the variable $TheClassInstance, including inherited members" or "Refactor the selected code into its own new function of this class."

Sander, in what ways does an IDE get in the way of your PHP development?
I use Ultraedit mainly because it has the best ftp browser out of all the ones I tried.
I needed this feature because I was tired of editing-saving-and reuploading everytime I wanted a code change.
--krizo
Quote:Original post by ToohrVyk
I wonder how you can do better than simply grepping the name in the entire source directory... PHP doesn't have the static structure required to do serious static analysis.

An understanding of the code should be able to at least provide educated guesses. A pathological example might include something like

$className = 'FooClass';$classInstance = new $className();


If $className comes from something unpredictable then it would be impossible to guess what $classInstance is but if I have something like

class MetaBase {   function doIt() {      // Doing it!   }}class FooClass extends MetaBase {}class BarClass extends MetaBase {}function MakeIt($className) {   $classInstance = new $className();   if (is_a($classInstance, 'MetaBase')) {      return $classInstance;   }   return false;}


Then we know that wherever MakeIt() is known to have returned something non-false then whatever it returned is a type of MetaBase. This type of information requires a lot more complexity and a lot more understanding of the code but even in the cases that it works effectively it would be very useful.

And if anything but the most basic inference is too difficult then at least provide me with an editor that recognizes that if I have this code

class Foo {   function Save() {}}class Bar {   function Save() {}}


and I looked up where Foo->Save() was used it wouldnt also give me uses of Bar->Save(). There are many cases when it is possible to be sure if it's one or the other. If it's not sure then give me the option to know about these so I can decide, but separate them off from the others.
Quote:Original post by BeanDog
This is true--it's a sad byproduct of such high-level languages that it's nigh-impossible to have an IDE do all the cool stuff I'd wish it did. For instance, "Show me where this function is defined" or "List all member functions of the variable $TheClassInstance, including inherited members" or "Refactor the selected code into its own new function of this class."

All of those can be done in dynamic languages with a good IDE. If you IDE can't do it, replace it.

(I use Komodo.)
Quote:Original post by BeanDog
Sander, in what ways does an IDE get in the way of your PHP development?


In various ways. It depends on the IDE in question and the language I'm developing in (I code PHP, Python, C and C++ mostly). The most annoying thing with most IDEs is that they tend to break my concentration. They all try to alert me or be helpful in some way that distracts me. Error checking while you type is annoying (the reductio ad absurdum is of course the office VB editor that pops up a modal dialog every time you leave a line with an error in it). Same thing for auto completion popups.

The second most annoying thing is that IDEs usually impose a certain structure on your application and if you want to do it differently then you get a lot of hassle. This is more apparent with C/C++ IDEs that with PHP/Python IDEs though.

I know that with many IDEs I can turn all those things off and reconfigure the hell out of it. But when I do that I just end up with a bloated glorified text editor anyway. Combine that with the fact that I'd like to use one application for all my coding (I don't want app A for PHP stuff, app B for C++ stuff, etcetera) and it's easy to see that a good text editor is a much better fit for me.

For the moment I've settled on Kate (from the KDE desktop environment). It has all the features I want. It's fast, light weight, does highlighting of a massive amount of languages, auto indenting and editing remote file over FTP, SSH and a whole lot of other protocols. That's all I need in an "IDE". The only thing I'm still looking for are a few nice color schemes :-)

Anyone have a nice color scheme for PHP and Python? Post screenies if you got 'em!

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

I use nano ^_^
I use Dreamweaver with instant access to my ftp-site so I won't have to upload all the edited files manually

And also dreamweaver portable for my u3 usb-stick XD
ActiveState recently released a free version of Komodo IDE. It's more of a generic text editor with syntax highlighting, code completion and some integrated support.
I ran across a couple of beautiful color schemes for vim. After a futile effort to configure Kate with those colours (I realized quickly that it would take forever to change all many, many syntax colors for Kate) I switched to (g)vim for most of my editing, using the netrw plugin with ssh-agent for remote editing. I'm just testing with it, but so far I like it a lot. It's a very steep learning curve but the possibilities are endless.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

This topic is closed to new replies.

Advertisement