Google now returns code snippets

Google’s main search screen now returns code snippets in its list of results. This is not just in code.google.com any more.


I needed to find the docs for the PHP function ftp_connect, so searched Google for it. (I could have gone to php.net and searched there, but why?)
The list of results has three hits to PHP manual pages, and the fourth and fifth are bits of code that use ftp_connect. Anyone know if they’re getting Perl stuff in there as well? I tried it with WWW::Mechanize, but couldn’t turn up hits.

Technical debt in your file headers

Here’s a little article about the “file header tax”, lines of boilerplate at the top of files that serve no purpose. Copyright notices, disclaimers, maybe even some revision history, it’s all just clutter, and clutter is technical debt.

Take a look at the next file you edit. Is there anything at the top of it that is not functional code? Ask yourself if it really needs to be there. If in doubt, throw it out.

Don’t trust yourself or your code

Jared Parsons writes about how
Part of being a good programmer is learning not to trust yourself. It’s filled with basic but all-too-often-forgotten wisdom about defensive programming. Key bits: “Turn assumptions into compiler errors,” “The best way to avoid making bad assumptions is to actively question them at all times,” and “1 test is worth 1000 expert opinions.”

I also chuckled to see a sidebar disclaimer that said “All code posted to this site is covered under the Microsoft Permissive Lice.” I’d heard of parasitic licensing before, but never like this!

ack 1.78 is out

After three months of lots of development work and intermediate releases, I’ve released ack 1.78. There are tons of new features and lots of compatibility fixes for Windows. ack is a replacement for grep that is geared to working with trees of code.

Highlights in this release include:

  • Files specified on the command line are always searched, even if they don’t match a known filetype
  • Ability to ignore directories
  • Pager support
  • More flexible grouping options
  • Many more languages recognized and existing ones improved, including CFMX, Actionscript, assembly, Tcl, Lisp, Smalltalk
  • Ability to define your own languages based on filetype

ack may well change the way you work on the command-line with source code. Try it out and let me know what you think. You can install it by installing App::Ack from CPAN, or downloading the standalone version to your ~/bin directory.

Help find students for Perl projects in Google Summer of Code 2008

(Following is Eric Wilhelm’s call for participation in Google Summer of Code.) — Andy

The Perl Foundation is participating in Google’s 2008 Summer of Code™
and we have a lot of capable, willing mentors looking forward to working
with some talented, driven students. So, we would like you to help
find those students (and quickly — the students must apply before
March 24th.)

This is a rare opportunity for students to get a chance to get a paid
summer of hacking on exciting projects like Parrot, Perl 6, Moose,
Jifty, SVK, Catalyst, or their very own Perl modules or applications.
It also brings new talent into the community and gives the student a
hefty “real world” experience with a knowledgable mentor. Further,
employers love to see this sort of demonstration of teamwork, handling
deadlines, communication skills, resourcefulness and etc.

We’re looking for promising students who are interested in open source
(or maybe you know someone who *should* be interested in open source.)
Knowledge of Perl is optional if the project is Parrot-related. The
student doesn’t need to be an expert in the problem domain (after all,
learning is part of the process), but should bring a big pile of
creativity, problem-solving skills, and determination.

Students should review
the page of suggested projects,
encouraged to bring their own proposals (those are often the best.)
The most important first step is getting in touch with the community
and discussing their project idea with potential mentors.

Google has posted some flyers if you happen to have a university
bulletin board or hallway handy:
http://code.google.com/p/google-summer-of-code/wiki/GsocFlyers

Additional info:

http://www.perlfoundation.org/perl5/index.cgi?gsoc2008
http://code.google.com/soc/2008/
http://code.google.com/soc/2008/faqs.html

(Note that Google has particular requirements to do with the fact that
they are paying the students. The student must be able to show their
eligibility regarding enrollment and employability.)

Remember, the Perl community draws talent from many fields, so if you
came to Perl from a non-computer-science major and still have contacts
in that department from your university, it is probably worth
mentioning to them.

Please feel free to forward this to whoever may be interested.

TPF helps defend the Artistic License

Jim Brandt writes in the TPF news blog that the Perl Foundation is helping a court case surrounding the Artistic License. A Java project has adopted the Artistic License and is now in the middle of a legal battle that could be important legal precedent for future cases regarding open source licensing. TPF has helped support an amicus curae brief in the case.

Jim’s article notes “the argument [in the case] that there can be no remedy to a copyright holder who chooses not to charge money for their work.” It’s kind of like how puzzled relatives ask why me work on open source projects if I’m not getting paid to do it, as if it’s less worthwhile that there’s no money (directly) changing hands. Here, the plaintiffs in the case are trying to make that perception into settled case law. Thanks to TPF for their work here against that happening.