View Poll Results: Which language do you prefer? (Readability, line count, flexibility, standards)
- Voters
- 4. You may not vote on this poll
-
Apr 22nd, 2010, 07:00 PM
#1
Thread Starter
Stack Overflow moderator
XML.NET vs. VB.NET - an imaginary language
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?
-
Apr 22nd, 2010, 07:17 PM
#2
Re: XML.NET vs. VB.NET - an imaginary language
Don't joke. There actually are languages just like that. XSL comes to mind.
-
Apr 23rd, 2010, 06:55 AM
#3
Re: XML.NET vs. VB.NET - an imaginary language
XML Schema, Schematron. Some templating languages.
-
Apr 23rd, 2010, 08:04 AM
#4
Fanatic Member
Re: XML.NET vs. VB.NET - an imaginary language
Where I'm from we only have one bit of advice for new comers: "If you hear banjos, turn and run".
VS 2008 .NetFW 2.0
-
Apr 23rd, 2010, 10:41 AM
#5
Re: XML.NET vs. VB.NET - an imaginary language
-
Apr 23rd, 2010, 12:12 PM
#6
Re: XML.NET vs. VB.NET - an imaginary language
XML.NET makes VB.NET look like C#.
-
Apr 23rd, 2010, 04:13 PM
#7
Thread Starter
Stack Overflow moderator
Re: XML.NET vs. VB.NET - an imaginary language
-
Apr 23rd, 2010, 08:22 PM
#8
Frenzied Member
Re: XML.NET vs. VB.NET - an imaginary language
........ Xaml anyone? and its actually pretty nice to use.
-
Apr 24th, 2010, 11:49 AM
#9
Thread Starter
Stack Overflow moderator
Re: XML.NET vs. VB.NET - an imaginary language
Isn't XAML more design-time things and visual effects?
-
Apr 25th, 2010, 09:29 AM
#10
Re: XML.NET vs. VB.NET - an imaginary language
Yep, designed for better separation between the designing and coding aspects of development. I personally believe it may be the best thing that microsoft has ever come out with for .Net.
That and the new parallelism.
-
Apr 25th, 2010, 04:34 PM
#11
Thread Starter
Stack Overflow moderator
Re: XML.NET vs. VB.NET - an imaginary language
Parallelism? I'm now going to Google that for .NET.
-
Apr 25th, 2010, 05:06 PM
#12
Frenzied Member
Re: XML.NET vs. VB.NET - an imaginary language
-
Apr 26th, 2010, 01:03 AM
#13
Re: XML.NET vs. VB.NET - an imaginary language
I can teach you the Parallelism in 5 seconds.
Replace for with Parallel.For
Replace foreach with Parallel.ForEach.
Done! That'll be $5.
-
Apr 26th, 2010, 07:21 AM
#14
Re: XML.NET vs. VB.NET - an imaginary language
Blindly apply to all existing code, then marvel as applications crash and populate the screen with errors you've never heard of.
-
Apr 26th, 2010, 07:43 AM
#15
Frenzied Member
Re: XML.NET vs. VB.NET - an imaginary language
-
Apr 26th, 2010, 02:27 PM
#16
Thread Starter
Stack Overflow moderator
Re: XML.NET vs. VB.NET - an imaginary language
Really?!! I thought parallel_for and others were only available for C++!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|