|go ahead... be a heretic|
Perl IDE and New Foreign APIsby tomazos (Deacon)
|on Sep 09, 2005 at 08:20 UTC||Need Help??|
Further to this non-article (476795) that I'm not going to write, I've been working through O'Reilly's "Java Examples in a Nutshell" exercises in Eclipse 3.1 with Java 5 (or 1.5 or 2.0 or J2SE, I wish Sun would sort their versioning out and have their marketing department shot). I also tackled some 1000-point questions on TopCoder in Java. Some of them are actually difficult (admittedly usually because of the physics or numerical analysis involved and not for the language contortions). On TopCoder I also saw more C#/.NET code. (Iím interested to know why there is a fork from Ruby to C# in the levenezís language history - havenít quite worked that out)
The biggest differences in workflow that I've noticed, apart from the Java code being on average about four times as verbose as the equivalent Perl code (and Java 5 language proper approaching the design of C++ at an alarming rate), I think comes from the some of the niceties of the Eclipse IDE.
Iím no emacsian-master by a long shot. To come clean, Iíve actually been using EditPlus2 on a Windows client machine to edit my Perl code. I started out using WIMP GUI IDEs 15 years ago and never got out of the habit. I think it has something to do with that whole ďrecognition vs recallĒ thing - and I have a short memory sometimes.
Being more specific:
In Eclipse you have a javadoc window open that follows your cursor. Whenever you go over a symbol in your source it displays the documentation associated with that given symbol (by looking at the symbolís source code and parsing out the comments like perldoc). You can also go to the Type Hierarchy and get a tree of the sub/superclasses of the class you are looking at (with methods). After you type a class name or instance identifier in the source you can hit CTRL-space and it will give you a drop down menu of all the methods it has. You can select one and it types the function name for you.
Why not something similar in Perl? Or what is some of the equivilant in Perl IDEs (emacs for example)? Take Set::Object for example. My usual workflow would be to cpan install module, copy and paste the Synopsis into my code and then munge it into what I need, and then hopefully remember the API if I need to use it again.
Iím sure there must be equivilant magic in Perl-land.
I guess my question would be how do you work with a new foreign API in Perl? Is it a matter of studying the entire module's perldoc in a seperate window and then retaining that information when writing your source? Is there a way in your Perl IDE (eg emacs) to get to the documentation of a given package or blessed reference at the cursor?
More generally, what are some of the tricks you use to do things that offer the same benefits as the features of a recognition-based IDE?
As a specific example using Set::Object - Let's suppose you wanted to use it but didn't know anything about it. Can you describe in detail your workflow of acquiring and using the API through your Perl environment?