News for hackers. Stuff that matters.
Re:C++ has become a scripting language by usea on Wednesday October 16, 2013 @09:17AM (#6559440)
Requisite C# one-liner:

  Main(string[] args) { File.WriteAllLines(args[1], File.ReadAllLines(args[0]).OrderBy(x => x).ToArray()); }
Excludes using statements, .net library references. project file, solution file, framework config file...

I have invented a language called Croml, in which all source code compiles to the same program. This program reads in a file, sorts the lines, and writes it back out to another file. An empty source file accomplishes this task.

Re:C++ has become a scripting language by frozenport on Thursday October 17, 2013 @03:30AM (#6564079)
You are cheating because of all the menus you had to jump through just to make the project :-)
Re:C++ has become a scripting language by foobarred on Thursday October 17, 2013 @04:17AM (#6564179)
Use LinqPad then it's not cheating. It becomes:

File.WriteAllLines(args[1], File.ReadAllLines(args[0]).OrderBy(x => x));

Re:C++ has become a scripting language by usea on Thursday October 17, 2013 @02:36PM (#6567286)
I did actually use LINQPad. My comment was in jest :P

However, there's no Main in LINQPad which takes string[] args. Also File.WriteAllLines takes an array as its second parameter, while OrderBy returns an IEnumerable.