Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Perl Programmer Learning C#, Seeking Helpful Resources, Tips

by Jim (Curate)
on Apr 06, 2014 at 19:36 UTC ( [id://1081327]=perlquestion: print w/replies, xml ) Need Help??

Jim has asked for the wisdom of the Perl Monks concerning the following question:

Greetings,

I'm a longtime Windows Perl hacker who's now learning C#. I'm hoping to find helpful resources and to get good tips from other experienced Perl programmers who have translated their Perl skills to C# and .NET Framework programming.

I write a lot of basic kinds of scripts that are mostly simple command-line utilities that operate on files—usually plain text files. Occasionally, I work with data in SQL databases. A typical script of mine uses modules like File::Glob, File::Spec, Getopt::Long, Text::CSV_XS, DateTime, DBI, DBD::ODBC, etc. Of course I use object-oriented modules, but the scripts I write are procedural with incidental sprinklings of functional (map, grep, Schwartzian transforms, etc.). I've never written a class myself. I can't imagine programming without hashes (associative arrays or dictionaries). I consider myself pretty darned adept with regular expressions, and I know a lot about Unicode. (I'm an individual member of the Unicode Consortium.) I'm also the company date, time and time zone nerd. I work primarily in the electronic discovery business.

I think the quickest way for me to learn C# and to become productive using it is to write a few simple console applications with it that I would otherwise have written using Perl. So it would be really helpful to find resources that guide a Perl hacker quickly to success with C# and .NET. For example, what does a smart C# programmer use that a smart Perl programmer uses Getopt::Long for? Likewise, what's the C# alternative to Perl's Text::CSV_XS? More generally, how would I craft the same kinds of command-line filters in C# that I'm so accustomed to whipping up quickly and easily in Perl?

I'll learn all the tricky Windows programming stuff (WPF, XAML, etc.) after I've gotten comfortable with the core C# language and the basics of the .NET Framework.

Thank you in advance for your helpful responses. And please:  no programming language war in this thread. I have to learn C#, and I promise I won't stop hacking Perl. Fair enough?

Jim

  • Comment on Perl Programmer Learning C#, Seeking Helpful Resources, Tips

Replies are listed 'Best First'.
Re: Perl Programmer Learning C#, Seeking Helpful Resources, Tips
by Anonymous Monk on Apr 06, 2014 at 22:00 UTC
Re: Perl Programmer Learning C#, Seeking Helpful Resources, Tips
by kcott (Archbishop) on Apr 06, 2014 at 20:30 UTC

    G'day Jim,

    Plugging "C# Perl" into my search engine produced many results showing comparisons between the two languages and how code, to perform the same task, could be written in both.

    "C# and Perl Cross Reference Guide" seemed like a promising start. I'll leave you to research further.

    -- Ken

        "Which search engine is that? Both DuckDuckGo and Google didn't return that page in first 20 results"

        The first one does. Here's the full URL: "https://duckduckgo.com/?q=C%23+Perl&kp=-1&kl=au-en". Perhaps it doesn't appear if your configuration settings generate a different query string.

        -- Ken

Re: Perl Programmer Learning C#, Seeking Helpful Resources, Tips
by sundialsvc4 (Abbot) on Apr 07, 2014 at 11:51 UTC

    The biggest hurdle to overcome when moving your mind-set between the two languages is simply that C# is a fully-compiled and strongly-typed language, whereas Perl is highly dynamic and essentially type-less.   Java (not JavaScript) is a fairly good corollary, although there is one other important consideration:   C# is designed for use in a Microsoft-centric, dot-Net environment, period.   To fully understand C# as in to be truly effective with it, you’ll need to study the environment in which it stands.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1081327]
Approved by kcott
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2024-04-25 00:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found