C# and Mono vs Perl. Oh my god, who am I.

So I’ve spent the last few days diving deep into C#/.net/Mono. When I first looked at it a few years ago, I saw a big clunky language and an unwieldy runtime. Having just spent the last 6 months looking at perl/Moose I have to admit, I’m a bit embarrassed. Seriously y’all, what the hell happened.

I find myself enjoying C# *more* than perl. I want you to think about what I just said… From a pure pleasure standpoint, from a pure “getting things done” standpoint… C# is *smashing* perl. Killing it. Crushing it. I’m besides myself with grief, and I’m besides myself with excitement.

I’ve spent years writing event driven code in perl. *years*. Writing state machines that control physical hardware, state machines which drive terabytes of content, state machines which drive entire clusters of machines to do image processing, and every time I reached for Perl. Sometimes I reached for POE, sometimes I reached for AnyEvent, sometimes I just threw some shit together, but I always reached for Perl.

I can’t believe I’m about to write this.

Event driven architectures are way easier to express, performant, easy to debug, and scalable in C#/.net/mono. And this is after only a week and a half of effort on my part.

I was not expecting this. I’m besides myself.

Oh, and don’t get me started in how much easier .Net code is to deploy. Don’t fucking get me started. Sure, perlbrew/local-lib have made life infinitely easier (that you @miyagawa), and it’s not *quite* as easy as Go‘s model, but it’s comically easier. Comically.

This entry was posted in tech and tagged , , , . Bookmark the permalink.

3 Responses to C# and Mono vs Perl. Oh my god, who am I.

  1. tlrrd says:

    Could you give an example showing the difference between a perl and c# implementation? I do them a lot in c++ and perl, but always felt that the syntax of languages of that vintage has to be worked around rather than with when doing event based programming

    How does c# do it, and how succinct is it compared to perl? (POE syntax was always a little ugly IMHO, so AnyEvent might be fairer)

  2. salvafg says:

    In my experience, using AnyEvent or POE to write state machines inevitably lends to spaghetti code. Program flow jumps from callbacks to callback without any obvious order, no structure, no high level or low level, just small chunks of code being executed…

    I wrote Class::StateMachine and then Class::StateMachine::Declarative to solve that. I am still not completely happy with Class::StateMachine::Declarative and that’s the reason it is not on CPAN yet, but, well, see for yourself how real code implementing complex state machines looks:


    How this compares to C#? (and I really mean it, as you, I learned C# several years ago and after that, never come back to it, so I am curious)

  3. Y Sharp says:

    Lol. Glad you enjoy the C “hash”… I mean… the C “sharp” πŸ˜‰ Welcome to the fan club! πŸ™‚ Also, it’s not even too bad, perf-wise: https://github.com/ysharplanguage/FastJsonParser


Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s