Hard on the developer, easy on the compiler! Introducing a really stupid and imaginary new .NET language: XML.NET! It's all based on XML, increasing the number of characters you have to type and decreasing flexibility, readability, and performance. Enjoy!
XML.NET code:
Code:
<project name="Demo Project" namespace="DemoProject" startup="DemoProject.Form1" />
<class name="Form1" partial="true" inherits="System.Windows.Forms.Form">
##DESIGN XML
<property name="Text" value="XML.NET Demo Project" />
<property name="MaximizeBox" value="true" />
<control type="System.Windows.Forms.Label" name="lblHello" modifiers="private">
<property name="Text" value="Hello, XML.NET world!" />
</control>
##END DESIGN
</class>
<class name="Form1" access="Public">
<method name="SayHello" return="null">
<param name="from" pass="byval" type="System.String" />
<run>
<define variable="v" type="System.String" value="<%= System.String.Empty %>" />
<assign value="<%=from%>" to="v" cast="none" /><!-- other available options for cast are "unbox" and "convert". -->
<if assertion="equality" op1="<%=v->toLower()%>" op2="this language">
<assign from="XML.NET" to="v" />
<else>
<!-- do nothing -->
</else>
</if>
<call method="System.Windows.Forms.MessageBox.Show" message="Hello from <%=v%>!" title="Hello, world" icon="<%=System.Windows.Forms.MessageBoxIcon.Information%>" />
</run>
</method>
<method name="lblHello_Click" return="null" handles="this.lblHello.Click">
<param name="sender" pass="byval" type="System.Object" />
<param name="e" pass="byval" type="System.EventArgs" />
<run>
<call method="this.SayHello" from="this language" />
<call method="this.Close" />
</run>
</method>
</class>
Equivalent VB.NET code:
vb.net Code:
Public Class Form1
Private WithEvents lblHello As New Label() With { .Text = "Hello, VB.NET world!" }
Public Sub New()
Me.Text = "VB.NET Demo Project"
Me.MaximizeBox = False
Me.Controls.Add(lblHello)
End Sub
Private Sub lblHello_Click(ByVal sender As Object, ByVal e As EventArgs) Handles lblHello.Click
SayHello("this language")
Me.Close()
End Sub
Private Sub SayHello(ByVal [from] As String)
Dim v As String = [from]
If v = "this language" Then
v = "VB.NET"
Else
'Do nothing.
End If
MessageBox.Show("Hello from " & v & "!","Hello, world",MessageBoxButtons.OK,MessageBoxIcon.Information)
End Sub
End Class

21 lines (vb.net) VS 36 long lines (xml.net).
So, what's your vote? Which one is better?