True. One of the interesting... "quirks" of modern languages -- Java and C# primarily -- is that creating more visual forms of text is almost more simple than writing out plain text to the console. For example:
class MyClass { public static void Main(string[] args) { System.Windows.Forms.MessageBox.Show("Hello world!"); } }
That would probably be significantly harder to recreate in few lines in Perl. Similarly, there are things in Perl that are easier to do than in C#. Languages are merely tools, and for each task, not all tools are the same. :)
when using WriteLine the \n is going to give you two lines not just one :) You were probably looking for Console.Write(). Out isn't really necessary either.
True. And I was writing dang quickly after a busy day of not using C#. But that doesn't make the example necessarily wrong. :)
That said, I also believe having the namespace declaration to be completely superfluous. Not entirely sure on that point since I haven't written much in the way of C#, but there you go.
namespace MyNamespace
{
class MyClass
{
public static void Main(string[] args)
{
Console.Out.WriteLine("Hello world!\n");
}
}
}
Reply
- Jux
Reply
http://www.python.org/doc/humor/#python-vs-perl-according-to-yoda
Reply
class MyClass
{
public static void Main(string[] args)
{
System.Windows.Forms.MessageBox.Show("Hello world!");
}
}
That would probably be significantly harder to recreate in few lines in Perl. Similarly, there are things in Perl that are easier to do than in C#. Languages are merely tools, and for each task, not all tools are the same. :)
Reply
Reply
That said, I also believe having the namespace declaration to be completely superfluous. Not entirely sure on that point since I haven't written much in the way of C#, but there you go.
Reply
Reply
Leave a comment