Razor (C) Sharp scripting...

Discussion in 'Ruby' started by SwarmShepherd, Sep 9, 2011.

  1. <!-- Single statement block. -->
    @{ var theMonth = DateTime.Now.Month; }
    <p>The numeric value of the current month: @theMonth</p>

    <!-- Multi-statement block. -->
    var outsideTemp = 79;
    var weatherMessage = "Hello, it is " + outsideTemp + " degrees.";

    <p>Today's weather: @weatherMessage</p>


    For my client-side work I've been looking around again (IronRuby,
    Sinatra, Mono, Rails...) and gosh darned but the most exciting thing
    I'm seeing this time around is this new "templating engine" from the
    Evil Empire.

    note var type for outsideTemp was never declared, note that converting
    itself to a String is automatic....

    The whole C# / Razor thing seems, somehow, like it might be largely
    inspired by Ruby?

    Just my humble impression.

    It seems a real shame that IronRuby isn't alive and well enough to
    kick it up with C# in this particular niche?


    SwarmShepherd aka Thunk
    SwarmShepherd, Sep 9, 2011
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.