A recent question on the SF.pm mailing list about IDEs prompted me to think about what I depend on to code Perl.
I've been spending some time recently in GUI IDEs for other languages, especially MonoDevelop and Visual Studio. MonoDevelop is snappy and helpful. VS is of course a bloated mess. (Though if I were developing for Windows I probably couldn't live without it. Fortunately this is not my lot.) GUI IDEs are like C++ socket wrappers: Making one is easy, but making one that actually helps you get your work done is harder than it looks.
However, I am accustomed to Emacs and I simply cannot do development without shell-fu. Frankly I'm surprised anyone does. IDEs are simply not well suited for power coding. Too much clicking and so little progress for all that. However, some real, earnest, full-power IDE support for Perl inside Emacxs would be excellent. For example, automatic runs of "perl -c" and highlighting of error lines would be beautiful, and I would give real money for automated refactoring to e.g. rename things globally and safely. Perhaps given the libperl integration of vim it would be better to build the smart bits with vim and PPI rather than trying to shoehorn it into Emacs?
I've had recommended Perlnow for Emacs and perl-support for vim. I'll give them a look.
Meanwhile, today, I count nine tools that are vital for my Perl development. In roughly descending order of importance, they are:
- CPAN and search.cpan.org, though that's a given
- emacs with cperl-mode (make sure it's up to date!) and some easy customizations -- e.g. a function key for grep which defaults to ack at project root (well my own script that predates ack)
- zsh. Like I said, there is absoutely no substitute for shell-fu
- perl -d. I simply cannot live without this, and neither can you. If you think you're doing OK without it, you're kidding yourself
- Thinkpad. These keyboards simply have no equal. I don't understand people who code on Macs ... not because of the software, though that is a minor issue, but because of the perverse industrial design of the keyboards. Beautiful pains
- git, or hg in a pinch.
- Debian. (Sorry, Mac OS, if you ran on a machine with a decent keyboard I'd think about it.)
- cpanm
- vi. Emacs is too heavy for quick hacks
Let me know if you know of any good Perl IDE hacks for emacs/vim, or want to suggest additions to the above list.
Can you qualify "Thinkpad keyboard" a bit more? What is it about those keyboards specifically? Layout? Mechanism? Clit mouse?
Posted by: genehack | April 14, 2011 at 09:10 PM
What about perltidy? I'm interested about the keyboard part as well.
Posted by: Htbaa | April 14, 2011 at 11:55 PM
PPIx::EditorTools has some useful PPI based tools for editing Perl code. Text::FindIndent hooked into an on-open-event of your editor can prevent co-workers from getting upset at you for screwing up their sacred indentation.
Posted by: Steffen Mueller | April 15, 2011 at 06:06 AM
There are at least three Emacs Perl modes on CPAN: Emacs::PDE, Devel::PerlySense, and Sepia, each with its own guiding philosophy. Also, Emacs' built-in flymake seems to hook into "perl -c", though I don't use it.
Posted by: seano | April 15, 2011 at 08:15 AM
I've elaborated on the virtues of ThinkPad keyboards in a new post: http://chip.typepad.com/weblog/2011/04/thinkpad-keyboards.html
Thanks much for the pointers to Text::FindIndent, Emacs::PDE, Devel::PerlySense, Sepia, and flymake. I'll check them out.
Posted by: Chip Salzenberg | April 15, 2011 at 09:20 AM
As for perltidy, I have never enjoyed working with automated layout systems. Smart editors, sure. But (1) any code so messed up that you need an indenter to read it probably isn't worth reading. Seriously. and (2) I follow TomC's maxim that logically parallel constructs should be visually parallel as well, and automatic indenters ruin that.
Posted by: Chip Salzenberg | April 15, 2011 at 09:23 AM