|
urlwolf
|
 |
« on: February 11, 2008, 02:01:50 PM » |
|
I have to read someone else's code in PHP. They didn't use any rules for line lengnth(standards : 80 col)... and lines are really long. This is a large project so an IDE may help navigating the code.
The problem is that none of the IDEs I have tested (PHPed, Komodo, EasyEclipse) can do proper word wrapping keeping indentation. The last one is the one I like the most right now.
It's a pain to have to scroll horizontally to see a long SQL call.
The only editor that does this kind of wrapping is sublime editor.
Any pointers? What's your recommendation for an IDE overall? Thanks!
|
|
|
|
|
Logged
|
|
|
|
|
yotta
|
 |
« Reply #1 on: February 11, 2008, 02:25:02 PM » |
|
if your willing to pay however much it is for dreamweaver, then its worth buying it just for its code view, otherwise aptana ( http://www.aptana.com) has both free and paying versions(used to be just free! grrr) and supports all those features + direct saving to ftp and many different code highlighting options
|
|
|
|
|
Logged
|
|
|
|
|
mouser
|
 |
« Reply #2 on: February 11, 2008, 02:30:19 PM » |
|
Last time i went searching, these 2 seemed top of the line to me, though i was mainly looking for good debug features: however i must say that i didn't fall in love with any of the php ides i tried. both of the above programs were very powerful, perhaps a bit too much so.. i tend to like my IDEs to not be so busy and complicated.
|
|
|
|
|
Logged
|
|
|
|
|
|
Veign
|
 |
« Reply #3 on: February 11, 2008, 03:25:31 PM » |
|
Seconding PhpEdit that was mentioned by mouser and also adding Komodo Edit (free version). I still use emEditor as my primary code editor (not really an IDE).
|
|
|
|
|
Logged
|
|
|
|
|
Lashiec
|
 |
« Reply #4 on: February 11, 2008, 03:33:09 PM » |
|
Did you try a programming editor, like PSPad or Notepad++? If you only want to read and fix code, an IDE is overkill IMO Anyway, some of the PHP editors not mentioned here, and freeware as well are Dev-PHP, SIDE, tsWebEditor, Tulip and PHP Designer. We briefly compared all them (minus PHP Designer, as it's not OSS), for a web project we have to take care off at college this year, and the most compelling seems to be tsWebEditor. We ended up doing the code by hand, anyway 
|
|
|
|
|
Logged
|
|
|
|
|
tinjaw
|
 |
« Reply #5 on: February 11, 2008, 05:34:12 PM » |
|
My suggestion is to first run the code through a code beautifier or pretty printer to get it formatted to your liking. Then using any of the IDEs mentioned, you should be able to fold code, jump to definitions, get an outline/treeview, etc. Also, if you don't already have one, get a dual-monitor setup. The #1 tool for reading somebody else's code is screen real estate. Spread it out before you.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
urlwolf
|
 |
« Reply #7 on: February 11, 2008, 10:59:55 PM » |
|
Thanks tinjaw. Good idea. I ended up using easyEclipse. One free editor (looks really good with plugins) that does sane wrapping is Jedit. Unfortunately it cannot jump to a function definition (other than that, it's great).
First time looking at PHP. It does look like spagetti code.
@jasper: I've found mixed reviews on Delphi for Php. It sounds great on paper, but it looks like the code it genrates is so-so (and often broken). The reviews are early 2007 so this might have changed.
|
|
|
|
|
Logged
|
|
|
|
|
Dr-Leech
|
 |
« Reply #8 on: February 12, 2008, 04:13:36 AM » |
|
Not an IDE but I'm using EditPlus from long time ago and it's great. Kinda outdated lately but it's enough for my coding needs.
|
|
|
|
|
Logged
|
|
|
|
|
urlwolf
|
 |
« Reply #9 on: February 12, 2008, 10:22:01 AM » |
|
Looks like hard wrap keeping indentation is not something IDEs nor editors do very well. Even Jedit, which does soft wrap fine, fails at hard wrap!
I'm stuck here because the PHPcodeBeautifier I found (by the PHPedit people) doesn't offer any wrapping options.
I remember an arcane unix command to format text witdth (used en-masse for email). Maybe I could use that?
I'm wasting a lot of time on this. It's surprising. I thought I'd find a good solution soon because it's a common problem... but nope!
Anyone knows a general tool that does hard wrapping? Thanks
|
|
|
|
|
Logged
|
|
|
|
|
tinjaw
|
 |
« Reply #10 on: February 12, 2008, 11:45:35 AM » |
|
Anyone knows a general tool that does hard wrapping?
I'm not sure what you mean by that term? Is that like turning on "Word Wrap" in Notepad? If so, notepad++ will give you that and PHP syntax highlighting. You can use the Function List Plugin (a bundled plugin) to navigate around functions. You also get code folding.
|
|
|
|
|
Logged
|
|
|
|
|
urlwolf
|
 |
« Reply #11 on: February 12, 2008, 11:53:53 AM » |
|
soft wrapping: it's just a trick in the editor; it doesn't insert anything on the file; line numbers are kept.
hard wrapping: it inserts actual \n to split the lines. That's what I need.
notepad does wrapping but doesn't keep the indentation (as bad as eclipse). Only Jedit and sublime editor (that I know of) do this... but only in soft wrapping.
|
|
|
|
|
Logged
|
|
|
|
|
jgpaiva
|
 |
« Reply #12 on: February 13, 2008, 04:31:05 AM » |
|
urlwolf: vim!  If you set some textwidth, it'll wrap on words when they pass that mark.
|
|
|
|
|
Logged
|
|
|
|
|
urlwolf
|
 |
« Reply #13 on: February 13, 2008, 08:13:39 AM » |
|
yes, but that's when you type, not when you open someone else's code! you could reformat the entire file that way by doing :ggvGgqi, but it does crazy things sometimes. Too dangerous. I found that IDEs are just better to read other people's code (surprised to say that myself!). Go to function definition, find usages etc... it's better. I found IDE nirvana in NetBeans... it's absolutely genial. That, and the fact that I have decided not to look at php code, and use ruby instead 
|
|
|
|
|
Logged
|
|
|
|
|
tinjaw
|
 |
« Reply #14 on: February 13, 2008, 09:38:45 AM » |
|
* tinjaw slaps urlwolf with a python
|
|
|
|
|
Logged
|
|
|
|
|
Ampa
|
 |
« Reply #15 on: February 13, 2008, 09:55:57 AM » |
|
NetBeans looks nice... but no PHP 
|
|
|
|
|
Logged
|
|
|
|
|
urlwolf
|
 |
« Reply #16 on: February 13, 2008, 11:51:02 AM » |
|
yes, there's a php plugin. go to tools > plugins, and scroll down the list; there's php there. Never tried it though.
No netbeans python support that I could find. there's a debugger but the instructions to install it are outdated.
Tinjaw, have you tried both python and ruby? Why do you like python better?
|
|
|
|
|
Logged
|
|
|
|
|
urlwolf
|
 |
« Reply #17 on: February 13, 2008, 12:45:03 PM » |
|
But Wait! Before you answer... look at this: http://poignantguide.net/ruby/ written by the incredibly prolific hacker "why the lucky stiff". I have laughed as hard as when I found "RMS is the new Chuck norris". I thought that was impossible  _why's existence makes me renew my faith in humanity. And make me want to learn the language too 
|
|
|
|
|
Logged
|
|
|
|
|
tinjaw
|
 |
« Reply #18 on: February 13, 2008, 12:47:20 PM » |
|
Tinjaw, have you tried both python and ruby?
No, I haven't tried Ruby. I have played with it a bit in an interactive online tutorial, but nothing beyond that. Why do you like python better?
I can't say one is better than the other, since I haven't used Ruby. It's more of the case that I love Python and have no interest in Ruby.
|
|
|
|
|
Logged
|
|
|
|
|
tinjaw
|
 |
« Reply #19 on: February 13, 2008, 12:49:27 PM » |
|
I am familiar with that book and have heard nothing short of raving reviews from anybody who has read it. In fact, when I was looking to get started with Python there was a lot of chatter on the Net about writing just such a book for Python.
|
|
|
|
|
Logged
|
|
|
|
|
Ampa
|
 |
« Reply #20 on: February 13, 2008, 12:53:26 PM » |
|
Agreed! Why's Ruby guide is a classic - it is worth learning the language JUST as an excuse to read that document! If only such things existed for Javascript, PHP, Java etc etc. I have toyed with Ruby and it seems very elegant and a great tool for certain applications. I have a friend who is using it to code his experimental maths.
|
|
|
|
|
Logged
|
|
|
|
|
Lashiec
|
 |
« Reply #21 on: February 14, 2008, 10:25:38 AM » |
|
Heh, the guy from Hackety Hack 
|
|
|
|
|
Logged
|
|
|
|
|
ivanv
|
 |
« Reply #22 on: February 22, 2008, 04:11:22 PM » |
|
I'm wondering why nobody has mentioned Zend Studio. It's been years last time I touched PHP code, but I used this IDE and it was almost like being in Visual Studio (minus the Visual part of course). I'm sure it has come a long way since then.
|
|
|
|
|
Logged
|
|
|
|
|
allen
|
 |
« Reply #23 on: February 22, 2008, 04:25:53 PM » |
|
Agreed! Why's Ruby guide is a classic - it is worth learning the language JUST as an excuse to read that document!
If only such things existed for Javascript, PHP, Java etc etc. Note quite as fun as the book for Ruby, but what I've seen of it thus far I'm quite pleased with http://eloquentjavascript.net/
|
|
|
|
|
Logged
|
|
|
|
|
|
|