View Poll Results: Which language do you prefer? (Readability, line count, flexibility, standards)

Voters
4. You may not vote on this poll
  • VB.NET

    4 100.00%
  • XML.NET

    0 0%
Results 1 to 16 of 16

Thread: XML.NET vs. VB.NET - an imaginary language

  1. #1

    Thread Starter
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    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="<&#37;= 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:
    1. Public Class Form1
    2.     Private WithEvents lblHello As New Label() With { .Text = "Hello, VB.NET world!" }
    3.     Public Sub New()
    4.         Me.Text = "VB.NET Demo Project"
    5.         Me.MaximizeBox = False
    6.         Me.Controls.Add(lblHello)
    7.     End Sub
    8.     Private Sub lblHello_Click(ByVal sender As Object, ByVal e As EventArgs) Handles lblHello.Click
    9.         SayHello("this language")
    10.         Me.Close()
    11.     End Sub
    12.     Private Sub SayHello(ByVal [from] As String)
    13.         Dim v As String = [from]
    14.         If v = "this language" Then
    15.             v = "VB.NET"
    16.         Else
    17.             'Do nothing.
    18.         End If
    19.         MessageBox.Show("Hello from " & v & "!","Hello, world",MessageBoxButtons.OK,MessageBoxIcon.Information)
    20.     End Sub
    21. End Class


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

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: XML.NET vs. VB.NET - an imaginary language

    Don't joke. There actually are languages just like that. XSL comes to mind.

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: XML.NET vs. VB.NET - an imaginary language

    XML Schema, Schematron. Some templating languages.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    540

    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

  5. #5
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    Re: XML.NET vs. VB.NET - an imaginary language

    How aptly named.

  6. #6
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: XML.NET vs. VB.NET - an imaginary language

    XML.NET makes VB.NET look like C#.

  7. #7

    Thread Starter
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: XML.NET vs. VB.NET - an imaginary language

    MUMPS... My eyes!!!

  8. #8
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: XML.NET vs. VB.NET - an imaginary language

    ........ Xaml anyone? and its actually pretty nice to use.

  9. #9

    Thread Starter
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: XML.NET vs. VB.NET - an imaginary language

    Isn't XAML more design-time things and visual effects?

  10. #10
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    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.

  11. #11

    Thread Starter
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    Re: XML.NET vs. VB.NET - an imaginary language

    Parallelism? I'm now going to Google that for .NET.

  12. #12
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: XML.NET vs. VB.NET - an imaginary language

    I agree with max...

  13. #13
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    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.

  14. #14
    Frenzied Member MaximilianMayrhofer's Avatar
    Join Date
    Aug 2007
    Location
    IM IN YR LOOP
    Posts
    2,001

    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.

  15. #15
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: XML.NET vs. VB.NET - an imaginary language

    My sort of programming!

  16. #16

    Thread Starter
    Stack Overflow mod​erator
    Join Date
    May 2008
    Location
    British Columbia, Canada
    Posts
    2,824

    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
  •  



Click Here to Expand Forum to Full Width