Monks,

I am not ashamed to tell you that I use both Perl and .Net (specifically, C#).

"But how to know which one to use, and when?"

My rule of thumb is: When on Windows, use .Net. When on Linux, use Perl

"But why not use Perl on Windows?"

I do use Perl on Windows, but only in a pinch. You see, C# is to Windows as Perl is to Linux. I run Ubuntu Linux as my desktop and do most of my software development on CentOS using Apache/MySQL/Perl. Perl just fits in so nicely with what I do on a daily basis it's difficult to imagine getting by without it.

However when the $client makes Windows a requirement, C# is my tool of choice. With new gadgetry like LINQ to SQL I get an Object-Relational Mapper (ORM) along the lines of DBIx::Class or Class::DBI, plus a hackneyed equivalent of sort/map/grep. IIS 7 feels to me like what Apache httpd will one day become. ASP.Net MasterPages + ASP.Net MVC + ASP.Net generic handlers feel very much like the environment provided by Apache2::ASP.

Aside from the fact that it is Windows and I have to put up with Windows' problems, shortcomings and arbitrary limits, it's better than it was before recent advances in C# and .Net.

"Isn't C# hard to learn?"

I feel that C# and Perl are very similar. Perl6 will include some ideas that C# already has implemented, so it could actually help by learning some C#. Specifically, the regular experessions in C# have named placeholders - something Perl6 Rules will have as well. C# also provides partial classes, first-class Delegates (analogous to Perl5 subroutine references) and lambda expressions (though not nearly as nice as Perl6 will offer).

After years of Perl-only or Perl-centric coding, C# offered a great way for me to get used to strict typing and true object-oriented design. This discipline improved my software architecture skills in general, and the way I design Perl software in particular. The result is that my Perl is much easier to write useful unit tests for, and is better suited to scale out.

"What about Moose?"

Moose is another option, but without compile-time type checking or runtime casting. Moose is a solution to another kind of problem - a good one at that.

"So what's your point?"

My point is that "Fivers" who could use a head-start on true OO could benefit from taking a good look at C# (use Mono if you like).


In reply to Perl and C# - how I use both by jdrago_999

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.