dev304. what scriptcs is and why it exists how to get it basics of how to use it putting the pedal...

31
C# on a diet with scriptcs Glenn Block DEV304

Upload: lesley-obrien

Post on 04-Jan-2016

221 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

C# on a diet with scriptcs

Glenn Block DEV304

Page 2: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

What we’re going to coverWhat scriptcs is and why it existsHow to get itBasics of how to use itPutting the pedal to the metal

Page 3: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

scriptcs

Page 4: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

C#

Page 5: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

But sometimes it feels heavy

Page 6: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

What if there was a low cal option?

Page 7: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

Similar to these

Page 8: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal
Page 9: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

The node developer experience

Page 10: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

The node developer experienceNo IDE required – Any editor will doNo projectMinimum installEverything else is a package

Page 11: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

What about C#?

Page 12: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

The scriptcs developer experienceNo IDE required – Any editor will doNo projectMinimum installEverything else is a package

Page 13: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

scriptcs hello.csx

Page 14: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

Using scriptcsWrite code in the REPL or stand alone scriptsNo class required, can write plain procedural codeInclude other scripts with #loadReference assemblies with #rAccess script arguments with ScriptArgsThe rest is plain old C#

Page 15: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

packages

Page 16: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

packagesNuget.exe is not requiredInstall any nuget package with scriptcs -installCan install a set of packages via packages.configPackages and all dependencies installed locallyAutomatically loaded into your scripts, just add a using

Page 17: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

scriptcs in action

http://www.flickr.com/photos/csullens/4344741769/sizes/l/in/photolist-7BVWmR/

Page 18: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

scriptcs in actionExperimentationConsole utilitiesWeb apps (Nancy)Web APISSimple WPF apps

Hardware automationHosting in memory databases

Page 19: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

Not everything in script land is pretty

Page 20: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal
Page 21: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal
Page 22: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal
Page 23: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

Script packs

Page 24: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

Script packsAdd reference assembliesAdd using statementsMake .NET libraries more consumable from scripts

Page 25: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

Hosting

Page 26: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

HostingAdd script support to your own runtimesHost scripts in a full blown web appHost scripts anywhere

Page 27: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

Open source and open to contributionOn githubApache 2125 forks30 ContributorsAlmost 80 commits

http://github.com/scriptcs/scriptcs

Page 28: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

What we coveredscriptcs is a tool which offers lightweight C# devNot a replacement for VS or PowershellUseful for prototyping, tinkering, automationOffers both editor based and REPL developmentIntegrates with nugetCan be hosted in your own appsIs open source and has a rich community

Page 29: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

Related contentBreakout Sessions (session codes & titles)

DEV309 – ASP.NET Web API – What’s new (all demos using scriptcs!)

Find Me Later At...At the Microsoft booth, or ping me on twitter: @gblock

Page 30: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

Evaluate this session and you could win instantly!

Head to...aka.ms/te

Page 31: DEV304. What scriptcs is and why it exists How to get it Basics of how to use it Putting the pedal to the metal

© 2013 Microsoft Corporation. All rights reserved.Microsoft, Windows and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.