views:

298

answers:

8

I recall when I first read Pragmatic Programmer that they suggested using scripting languages to make you a more productive programmer.

I am in a quandary putting this into practice.

I want to know specific ways that using Python or Ruby can make me a more productive .NET developer.

One specific way per answer, and even better if you can say whether I could use Python or Ruby or Both for it.

See standard format below.

+1  A: 

Quick Prototyping - Both

In the simplest cases when firing a python interpreter and writing a line or two is way faster than creating a new project in visual studio.

And you can use ruby to. Or lua, or evel perl, whatever. The point is implicit typing and light-weight feel.

Tadeusz A. Kadłubowski
you change it back? I didn't think the edit was a big deal
Alex Baranosky
@GordonG: He was probably typing while you made your edit.
musicfreak
+5  A: 

IronPython / IronRuby

IronPython in Action will do a better job explaining this (and exactly how best to use IronPython) that can possibly be accommodated in a SO answer. I'm biased -- I was a tech reviewer and am a friend of one of the authors -- but objectively think it's a great book. (No idea if IronRuby is blessed with a similarly wonderful book, yet).

As you want "one specific way per answer" (incompatible with SO, which STRONGLY discourages a poster posting 25 different answers if they have 25 "specific ways" to indicate...!-): prototyping in order to explore some specific assembly or collection thereof that you're unfamiliar with (to check if you've understood their docs right and how to perform certain tasks) is an order of magnitude more productive in IronPython than in C#, as you can explore interactively and compilation is instantaneous and as-needed. (Have not tried IronRuby but I'll assume it can work in a roughly equivalent way and speed).

Alex Martelli
+1 for prototyping. Rapid prototyping and exploratory programming don't require a dynamic language, but most of the dynamic languages have better support for that kind of approach. Python in particular has been designed with interactive/exploratory programming as a major feature, and most Python programmers will prototype extensively in the interactive mode before writing "actual" code.
Daniel Pryden
+2  A: 

Advanced Text Processing

Traditional strengths of awk and perl. You can just glue together a bunch of regular expressions to create a simple data-mining system on the go.

Tadeusz A. Kadłubowski
+4  A: 

Less Code

I think productivity is direct result on how proficient you are in a specific language. That said the terseness of a language like Python might save some time on getting certain things done.

If I compare how much less code I have to write for simple administration scripts (e.g. clean-up of old files) compared to .NET code there is certain amount of productivity gain. (Plus it is more fun which also helps getting the job done)

Philip Fourie
+1  A: 

Cross platform

Compared to .NET a simple script Python is more easily ported to other platforms such as Linux. Although possible to achieve the same with the likes of Mono it simpler to run a Python script file on different platforms.

Philip Fourie
+1  A: 

Processing received Email

Python has built-in support for POP3 and IMAP where the standard .NET framework doesn't. Useful for automating email triggered tasks.

Philip Fourie
+2  A: 

Learning a new language gives you knowledge that you can bring back to any programming language. Here are some things you'd learn.

Add functionality to your objects on the fly.

Mix in modules.

Pass a chunk of code around.

Figure out how to do more with less code: ruby -e "puts 'hello world'"

C# can do some of these things, but a fresh perspective might bring you one step closer to automating your breakfast.

Andy Gaskell
And we all know, automating breakfast is the Shang-Ri-La of coding ;)
Alex Baranosky
+2  A: 

Embedding a script engine

Use of IronPython for a scripting engine inside your .NET application. For example enabling end-users of your application to change customizable parts with a full fledge language such as Python.

A possible example might be to expose custom logic to end-users for a work flow engine.

Philip Fourie
I'd love to here a more in-depth example.
Alex Baranosky