As much as i like C#, static typed languages are inadequate when using them in shell. You really don't want to type all that. Powershell has access to the BCL and can do all that with a nicer syntax when using it in the shell.
CShell: A simple, yet powerful, C# scripting IDE
41–50 of 90 posts
Re: CShell: A simple, yet powerful, C# scripting IDE
#42So I'm sorry but a "scripting" language whose print operator is longer than 5 chars is not a scripting language :)
Re: CShell: A simple, yet powerful, C# scripting IDE
#43I guess I'm old. My first thought was http://en.wikipedia.org/wiki/C_shell
It probably should have been named CSShell :-)
By the way, this is really useful. Loaded all our app libraries and works like a charm. I feel much more productive now except for the fact that it made me comment on HN =)
Re: CShell: A simple, yet powerful, C# scripting IDE
#44Also see http://www.hanselman.com/blog/ProjectlessScriptedCWithScript... - no REPL though, although that would be easy to create since there's a SrciptingEngine for C# ( http://blogs.msdn.com/b/csharpfaq/archive/2011/12/02/introdu... )
Re: CShell: A simple, yet powerful, C# scripting IDE
#45The point of scripting is to do things quickly at the expense of possibly being ugly. Most of the things we do in the UNIX shell are one-off local stuff. I want to rename all file extensions in a directory. I want to find a regex in files ending with .c and .h excluding the .svn and .git directories. Etc etc. So I'm sorry but a "scripting" language whose print operator is longer than 5 chars is not a scripting langua…
Action print = Console.WriteLine;
I mean, it's not perfect but you can also create a .Dump() extension method for all objects like Linqpad does. It comes really handy.Re: CShell: A simple, yet powerful, C# scripting IDE
#46Re: CShell: A simple, yet powerful, C# scripting IDE
#47As much as i like C#, static typed languages are inadequate when using them in shell. You really don't want to type all that. Powershell has access to the BCL and can do all that with a nicer syntax when using it in the shell.
// This an array of integers.
var x = new[]{1, 2, 3};
// This is a list of integers.
var y = x.ToList();
// This is an anonymous type.
var pet = new { Age = 10, Name = "Fluffy" };
Zero type names there. Not all types can be inferred by literals though, most annoyingly dictionaries:
var myDict = new Dictionary{ { "test", "test" }, { "test2", "test2" } };
although I'm sure that could also have been created without typing out the name if you really wanted.
Re: CShell: A simple, yet powerful, C# scripting IDE
#48As much as i like C#, static typed languages are inadequate when using them in shell. You really don't want to type all that. Powershell has access to the BCL and can do all that with a nicer syntax when using it in the shell.
If your language has you type more because it has a static ype system then it's just poor at inferring types and/or it's syntax has you write out things that it could infer anyway. You may have to write types in C# from time to time, but often you don't have to: // This an array of integers. var x = new[]{1, 2, 3}; // This is a list of integers. var y = x.ToList(); // This is an anonymous type. var pet = new { Age =…
Re: CShell: A simple, yet powerful, C# scripting IDE
#49The point of scripting is to do things quickly at the expense of possibly being ugly. Most of the things we do in the UNIX shell are one-off local stuff. I want to rename all file extensions in a directory. I want to find a regex in files ending with .c and .h excluding the .svn and .git directories. Etc etc. So I'm sorry but a "scripting" language whose print operator is longer than 5 chars is not a scripting langua…
scala > 7 * 7
res0:Int = 49
scala > res0 - 9
res1:Int = 40
Saves a lot of typing.Re: CShell: A simple, yet powerful, C# scripting IDE
#50Earlier quoted context omitted.
If your language has you type more because it has a static ype system then it's just poor at inferring types and/or it's syntax has you write out things that it could infer anyway. You may have to write types in C# from time to time, but often you don't have to: // This an array of integers. var x = new[]{1, 2, 3}; // This is a list of integers. var y = x.ToList(); // This is an anonymous type. var pet = new { Age =…
Inferring types is cool, if it doesn't create bugs. But it does. Its not a lot of work to just say it outright, and it can save your life.