Re: .NET post only please, Take two.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 1 of 4 123 ... LastLast
Results 1 to 15 of 55

Thread: Re: .NET post only please, Take two.

  1. #1
    maxcaber Guest

    Re: .NET post only please, Take two.


    "Rob Teixeira" <RobTeixeira@@msn.com> wrote:
    >That's (quite) a bit of a loaded question Max.


    Rob,
    Just like in my "Coke vs. Pepsi post", I was trying to use a bit of sarcasm
    to get my point across. Sorry that you could not detect it. The point of
    my sarcasm is this:

    1. Write, compile and execute the same "Hello World" program, or any other
    program in Java, C#, VB.NET and clasic VB.
    2. Look yourself in the mirror and answer the following question: Of the
    above four languages/platforms, name the one that is least like the others.
    3. If you don't answer VB Clasic, then maybe you are related to Joe Isuzu
    or have a law degree from BSU.

    After completing steps one and two, you will also be, "so inclined to differenciate
    the products in that fashion" to quote yourself.

    By the way, I do like VB Clasic, C# and Java. I also will not turn down
    coke, pepsi, diet coke, diet pepsi or pepsi one especially if they are mixed
    with Jack Daniels, Jim Beam, Old Grand Dad, Makers Mark, etc.

    Hope this clears things up,
    Max



  2. #2
    Rob Teixeira Guest

    Re: .NET post only please, Take two.


    "maxcaber" <maxcaber@yahoo.com> wrote:
    >
    >Rob,
    >Just like in my "Coke vs. Pepsi post", I was trying to use a bit of sarcasm
    >to get my point across. Sorry that you could not detect it. The point

    of
    >my sarcasm is this:


    Fair enough.
    I'm just trying to address the issue of what posts "belong" on this group
    and what posts don't. People who are trying to find an exacting litteral
    law (most likely just so they can ***** about it) are being blatantly obtuse.
    If you don't fit into that category (and so far I haven't seen evidence that
    you do), then my hat's off to you.

    >If you don't answer VB Clasic, then maybe you are related to Joe Isuzu

    or have a law degree from BSU.
    >After completing steps one and two, you will also be, "so inclined to differenciate
    >the products in that fashion" to quote yourself.


    That's one viewpoint. I'm not saying that it's not valid - certainly some
    people do feel that way. However, I can say the same thing about writing
    a simple, yet functional, program in VB1 and doing the same thing in VB6.
    Apparently, nobody seems to remember that there's extensive differences even
    within what they term "classic" VB.

    But to answer your question more directly, here's the code:

    [VB.NET]
    Sub Main()
    MsgBox("Hello World")
    End Sub

    [VB "classic"]
    Sub Main()
    MsgBox "Hello World"
    End Sub

    [C#]
    public static void Main()
    {
    System.Console.WriteLine("Hello World");
    }

    [Java]
    public static void main(String args[])
    {
    System.out.println("Hello World");
    }

    Notice that the Java and C# examples don't even show a messagebox, that's
    not the standard "hello world" example, and that would take more code.
    Also note that with Java, I'm actually running the Java interpreter and passing
    the class binary to it, whereas with VB.NET, VB "classic", and C# i'm running
    the EXE file the compiler created. Also note that VB.NET and VB "classic"
    both retain the idea of a Module (even if the concept is implemented differently
    behind the scenes), and that the code used here must be placed in a Class
    block for C# and Java.

    Which one is more different than the others? You tell me, but it's not as
    simple as you think

    >By the way, I do like VB Clasic, C# and Java.


    I too think that there's plenty of room within the development community
    for all these languages. No one is clearly better than any other for *all*
    project types.
    Clearly, I have a preference for VB.NET and C# as a personal note, but that's
    relative to the environment and project types that i work with.

    However, liking one language over another, or seeing differences between
    them still doesn't address the original issue of the post i made, which is
    - anyone posting in this newsgroup (or any newsgroup for that matter) should
    try to stick to the topic of the newsgroup. In this case, VB.NET. Again,
    it's ok to post about other technologies, but try to keep it relevant to
    the topic.

    >I also will not turn down
    >coke, pepsi, diet coke, diet pepsi or pepsi one


    I will turn down anything "diet" or "one" in the name, regardless of the
    vendor

    >especially if they are mixed
    >with Jack Daniels, Jim Beam, Old Grand Dad, Makers Mark, etc.


    Here, here.

    -Rob

  3. #3
    markN Guest

    Re: .NET post only please, Take two.


    >... (most likely just so they can ***** about it) are being blatantly >obtuse

    ...
    I looked up the definition of obtuse, and I am far from it. I was TRYING
    to make a point to the keeper of the newsgroup. I've seen little here that
    just is VB.NET. I was trying to make sort of an "exaggeration for an obvious
    effect" and it ended up an "exaggeration for an oblivious effect". I didn't
    take into account the lack of humor and imagination. Those who didn't get
    it are probably the obtuse ones. I might be a little obscure but definitely
    not obtuse.



  4. #4
    maxcaber Guest

    Re: .NET post only please, Take two.


    "Rob Teixeira" <RobTeixeira@@msn.com> wrote:
    >Notice that the Java and C# examples don't even show a messagebox, that's
    >not the standard "hello world" example, and that would take more code.


    Following is the Message Box example in all C#, VB.NET and Java:

    [C#]
    using System;
    using System.Windows.Forms;

    public class ClientMain
    {
    static void Main(string[] args)
    {
    MessageBox.Show("hello");
    }
    }

    [VB.NET]
    Imports System.Windows.Forms
    Module Module1
    Sub Main()
    MessageBox.Show("hello")
    End Sub
    End Module

    [Java]
    import javax.swing.*;
    public class ClientMain
    {
    public static void main(String[] args)
    {
    JOptionPane.showMessageDialog(this,"Hello");
    }
    }

    >Also note that with Java, I'm actually running the Java interpreter and
    >passing the class binary to it, whereas with VB.NET, VB "classic", and C#
    >i'm running the EXE file the compiler created.


    I believe that the EXE created by the .NET compiler passes partially compiled
    (IL) code to the .NET CLR, just like you pass Java byte code to a Java VM.
    Correct me if I am wrong on this.

    >Also note that VB.NET and VB "classic" both retain the idea of a Module

    (even if the concept is implemented differently behind the scenes), and >that
    the code used here must be placed in a Class block for C# and Java.

    I have much more experience with C# then VB.NET. Please tell me why VB.NET
    uses Modules in place of a class. I know that you still use a class in VB.NET,
    so why is there two things that do the same thing?


    Once you go beond the "hello world" program and write complex applications
    with try/catch error handling, constructors, static members, etc. The above
    three tend to look more alike, and less like VB Clasic.
    Max



  5. #5
    Patrick Troughton Guest

    Re: .NET post only please, Take two.


    >[VB.NET]
    >Imports System.Windows.Forms
    >Module Module1
    > Sub Main()
    > MessageBox.Show("hello")
    > End Sub
    >End Module


    You don't have to use the System.Windows.Forms namespace if you don't want
    to. Instead, you can call the intrinsic VB MsgBox statement...

    Module Module1
    Sub Main()
    Call MsgBox("hello")
    End Sub
    End Module

    Other than the Module...End Module, this VB.NET code is identical to VB6
    code.

    >I believe that the EXE created by the .NET compiler passes partially compiled
    >(IL) code to the .NET CLR, just like you pass Java byte code to a Java VM.
    > Correct me if I am wrong on this.


    This correct. Keep in mind VB6 also had a similar option when you compiled
    to P-Code which is then interpretted to native code by the VB6 run-time.

    >I have much more experience with C# then VB.NET. Please tell me why VB.NET
    >uses Modules in place of a class. I know that you still use a class in

    VB.NET,
    >so why is there two things that do the same thing?


    <SPECULATION>Probably for backwards compatability or for people who don't
    want to fully endorse OO.</SPECULATION>

    >Once you go beond the "hello world" program and write complex applications
    >with try/catch error handling, constructors, static members, etc. The above
    >three tend to look more alike, and less like VB Clasic.
    >Max


    Which classic VB? Do you mean 'VB Classic 1-3' or do you mean 'VB Classic
    4-6'? See, to a VB3 programmer, all of VB6's OO capabilites ...classes, constructors,
    destructers, properties, methods, interface inheritance, user controls, user-created
    events, global multiuse classes... make VB6 look a lot less like VB3.

    /Pat

  6. #6
    Patrick Troughton Guest

    Re: .NET post only please, Take two.


    kylix_is@yahoo.co.uk (Mike Mitchell) wrote:
    >On 20 Nov 2001 13:55:03 GMT, "Rob Teixeira" <RobTeixeira@@msn.com>
    >wrote:
    >
    >>[VB.NET]
    >>Sub Main()
    >> MsgBox("Hello World")
    >>End Sub

    >
    >Why did MS change classic VB to mandate the brackets?


    They didn't. It's just part of Rob's post.

    >>[VB "classic"]
    >>Sub Main()
    >> MsgBox "Hello World"
    >>End Sub

    >
    >Yep. The one *TRUE* Basic. Admire its simplicity while you can. And
    >then obliterate it from your minds. Microsoft doesn't want simplicity
    >in their grand scheme of things. They want obfuscation. They can pull
    >more wool over people's eyes with obfuscation. Can't do that with
    >simplicity, no siree.


    What are you babbling about? Except for the parenthesis, the above two code
    samples are indentical. In fact, I see a lot of VB6 newbies get confused
    about when to use the parenthesis and when not to use them. VB.NET simplifies
    this by always using them.

    >[C#]
    >>public static void Main()
    >>{
    >> System.Console.WriteLine("Hello World");
    >>}

    >
    >Horrid. Convoluted. Obtuse. Arcane.


    LOL! Are you serious?! That's one of the best examples of self-documenting
    code you'll ever see. It's writing a single line of text, "Hello" world to
    the console. Why don't you try and write this same program in VB6 and tell
    us which is simpler. Be sure to include all the API declarations....

    /Pat

  7. #7
    Mike Mitchell Guest

    Re: .NET post only please, Take two.

    On 20 Nov 2001 13:55:03 GMT, "Rob Teixeira" <RobTeixeira@@msn.com>
    wrote:

    >But to answer your question more directly, here's the code:
    >
    >[VB.NET]
    >Sub Main()
    > MsgBox("Hello World")
    >End Sub


    Why did MS change classic VB to mandate the brackets? What's the
    point? Were they just bored?


    >[VB "classic"]
    >Sub Main()
    > MsgBox "Hello World"
    >End Sub


    Yep. The one *TRUE* Basic. Admire its simplicity while you can. And
    then obliterate it from your minds. Microsoft doesn't want simplicity
    in their grand scheme of things. They want obfuscation. They can pull
    more wool over people's eyes with obfuscation. Can't do that with
    simplicity, no siree.


    >[C#]
    >public static void Main()
    >{
    > System.Console.WriteLine("Hello World");
    >}


    Horrid. Convoluted. Obtuse. Arcane.

    >
    >[Java]
    >public static void main(String args[])
    >{
    > System.out.println("Hello World");
    >}


    Yuck.Double yuck. No, correct that: Triple yuck. Yep. About right.
    Oops! Forget the semicolon;

    MM

  8. #8
    Rob Teixeira Guest

    Re: .NET post only please, Take two.


    "maxcaber" <maxcaber@yahoo.com> wrote:

    Patrick did a good job of explaining the code bit, so i'll skip that.

    >I believe that the EXE created by the .NET compiler passes partially compiled
    >(IL) code to the .NET CLR, just like you pass Java byte code to a Java VM.
    > Correct me if I am wrong on this.


    Not really. The IL is embedded in the EXE. Either at install or during execution,
    the IL is rendered to native code (JIT) and runs that way. Services and classes
    are provided by the CLR, but it is not an interpreter. Either way, this behavior
    is a lot more like old VB with it's p-code in the EXE than Java with it's
    binary class files.

    >I have much more experience with C# then VB.NET. Please tell me why VB.NET
    >uses Modules in place of a class. I know that you still use a class in

    VB.NET,
    >so why is there two things that do the same thing?


    Compatibility with non-OO programming style. As i've said previously, there
    really is no need for a programmer in VB.NET to resort to explicitly creating
    classes, just as in older versions of VB. You still consume classes, but
    then again, you did that too with older VB and its form/control/component
    classes.

    The implementation of the module (which i hinted at) is different. In VB.NET,
    a module is a class in disguise, and the procedures/variables are static
    members. But again, the reasoning behind it is a consistancy with the programming
    model.

    >Once you go beond the "hello world" program and write complex applications
    >with try/catch error handling, constructors, static members, etc. The above
    >three tend to look more alike, and less like VB Clasic.


    That depends. Again, there's no requirement to explicitly write class code.
    Old-style VB error handling is still implemented in VB.NET. And despite the
    syntax changes, the code still looks a heck of a lot more like older VB than
    a C derivative.

    -Rob

  9. #9
    Patrick Troughton Guest

    Re: .NET post only please, Take two.


    We've explained this to you a million times before. If you really want to
    know, go search the newsgroup archives...but I suspect you don't and you
    won't.

    /Pat

    kylix_is@yahoo.co.uk (Mike Mitchell) wrote:
    >On 20 Nov 2001 20:04:39 GMT, "Patrick Troughton"
    ><Patrick@Troughton.com> wrote:
    >
    >>Which classic VB? Do you mean 'VB Classic 1-3' or do you mean 'VB Classic
    >>4-6'? See, to a VB3 programmer, all of VB6's OO capabilites ...classes,

    constructors,
    >>destructers, properties, methods, interface inheritance, user controls,

    user-created
    >>events, global multiuse classes... make VB6 look a lot less like VB3.

    >
    >Why, then, with all those OO capabilities in VB6, is it so
    >incompatible with VB.NET? They must have done it deliberately, yes?
    >
    >Fact: I can take just about any VB3 program and load it straight into
    >VB6 and run it without changing a jot.
    >
    >Not a fact: I can take just about any VB6 program and load it straight
    >into VB.NET and run it without changing a jot.



  10. #10
    Mike Mitchell Guest

    Re: .NET post only please, Take two.

    On 20 Nov 2001 19:23:51 GMT, "maxcaber" <maxcaber@yahoo.com> wrote:

    >Once you go beond the "hello world" program and write complex applications
    >with try/catch error handling, constructors, static members, etc. The above
    >three tend to look more alike, and less like VB Clasic.


    That's because they *are* all alike and classic VB stands out by its
    unique blend of simplicity, accessibility for everyone, including
    occasional programmers, and its lack of bloat. Some of that code in
    those other languages would make me ashamed to call myself a
    programmer, not, I hasten to add, max, because *you* wrote it, but
    because of the very arcaneness of the languages which makes code of
    this sort unavoidable and inevitable.

    Yep, programming, especially for RAD applications, has definitely
    taken a turn up Blind Alley now for a few years, until they see the
    light and realise that the vast majority of users want a simple
    solution, not a complex one. Then, hopefully, all the awfullness will
    go.

    MM

  11. #11
    Rob Teixeira Guest

    Re: .NET post only please, Take two.


    kylix_is@yahoo.co.uk (Mike Mitchell) wrote:
    >On 20 Nov 2001 13:55:03 GMT, "Rob Teixeira" <RobTeixeira@@msn.com>
    >wrote:
    >
    >>But to answer your question more directly, here's the code:
    >>
    >>[VB.NET]
    >>Sub Main()
    >> MsgBox("Hello World")
    >>End Sub

    >
    >Why did MS change classic VB to mandate the brackets? What's the
    >point? Were they just bored?


    I don't *why* they mandated that. But I do know that *everyone* i've ever
    taught VB to has asked me why the **** you needed parans for functions, but
    couldn't use them on sub calls (without Call). They were irritated at the
    inconsistancy. And when I say everyone, I mean everyone
    The only people who seemed to not even notice were the people using basic
    long before there was a VB.
    Either way, the ideal may have been to accept with and without the parans
    (and to not require Call), but that makes a horrid mess for the parser.

    >>[VB "classic"]
    >>Sub Main()
    >> MsgBox "Hello World"
    >>End Sub

    >
    >Yep. The one *TRUE* Basic. Admire its simplicity while you can. And
    >then obliterate it from your minds. Microsoft doesn't want simplicity
    >in their grand scheme of things. They want obfuscation. They can pull
    >more wool over people's eyes with obfuscation. Can't do that with
    >simplicity, no siree.


    Not much difference between these two, as I see it.

    >>[C#]
    >>public static void Main()
    >>{
    >> System.Console.WriteLine("Hello World");
    >>}

    >
    >Horrid. Convoluted. Obtuse. Arcane.


    In your eyes perhaps. Other people prefer this. I happen to like the VB syntax
    personally, even after years of C++ work. But that's all a matter of personal
    preference and opinion.

    >>[Java]
    >>public static void main(String args[])
    >>{
    >> System.out.println("Hello World");
    >>}

    >
    >Yuck.Double yuck. No, correct that: Triple yuck. Yep. About right.
    >Oops! Forget the semicolon;


    See previous statement.

    -Rob

  12. #12
    Patrick Troughton Guest

    Re: .NET post only please, Take two.


    "Rob Teixeira" <RobTeixeira@@msn.com> wrote:
    >
    >>Why did MS change classic VB to mandate the brackets? What's the
    >>point? Were they just bored?

    >
    >I don't *why* they mandated that.


    Does Mike mean the brackets [] or the parens ()? I thought he was referring
    to the []. If the parens, MS did it to simplify the language. Contrary to
    anti-.NET rhetoric in this newsgroup, there are a lot of cases where VB.NET
    is *simpler* than VB6. The whole parens issue is just one small example of
    VB6 being more complicated than VB.NET.

    /Pat

  13. #13
    Mike Mitchell Guest

    Re: .NET post only please, Take two.

    On 20 Nov 2001 20:04:39 GMT, "Patrick Troughton"
    <Patrick@Troughton.com> wrote:

    >Which classic VB? Do you mean 'VB Classic 1-3' or do you mean 'VB Classic
    >4-6'? See, to a VB3 programmer, all of VB6's OO capabilites ...classes, constructors,
    >destructers, properties, methods, interface inheritance, user controls, user-created
    >events, global multiuse classes... make VB6 look a lot less like VB3.


    Why, then, with all those OO capabilities in VB6, is it so
    incompatible with VB.NET? They must have done it deliberately, yes?

    Fact: I can take just about any VB3 program and load it straight into
    VB6 and run it without changing a jot.

    Not a fact: I can take just about any VB6 program and load it straight
    into VB.NET and run it without changing a jot.

    See the difference?

    MM

  14. #14
    Patrick Troughton Guest

    Re: .NET post only please, Take two.


    You can still do that in VB.NET if you want.

    /Pat

    kylix_is@yahoo.co.uk (Mike Mitchell) wrote:
    >On 20 Nov 2001 21:35:57 GMT, "Patrick Troughton"
    ><Patrick@Troughton.com> wrote:
    >
    >>Does Mike mean the brackets [] or the parens ()? I thought he was referring
    >>to the []. If the parens, MS did it to simplify the language. Contrary

    to
    >>anti-.NET rhetoric in this newsgroup, there are a lot of cases where VB.NET
    >>is *simpler* than VB6. The whole parens issue is just one small example

    of
    >>VB6 being more complicated than VB.NET.

    >
    >Parentheses () are not required around parameters in VB6 calls to a
    >sub, but you can optionally put an argument in parentheses to force a
    >call ByVal, even though you'd normally be calling ByRef, the default
    >call method, thus preserving the original variable in some calls or
    >modifying it in others, as each individual situation may demand.
    >
    >MM



  15. #15
    Jim Pragit Guest

    Re: .NET post only please, Take two.


    "Patrick Troughton" <Patrick@Troughton.com> wrote:
    >
    >MS did it to simplify the language. Contrary to
    >anti-.NET rhetoric in this newsgroup, there are a lot of cases where VB.NET
    >is *simpler* than VB6. The whole parens issue is just one small example

    of
    >VB6 being more complicated than VB.NET.


    This is a good point. Not knowing when to use parenthesis around an argument
    list is a common point of confusion for some beginners. As far as I can
    tell, there are at least 5 different syntaxes for calling a procedure in
    Visual Basic 6. Depending on which syntax you pick, you may or may not need
    parenthesis.

    The VB6 syntax for calling a subroutine is as follows:

    1) Using the Call statement, always use parenthesis:
    Call DoSomething(Param1, Param2)

    2) When not using the Call statement, don't use parenthesis:
    DoSomething Param1, Param2

    The VB6 syntax for calling a function is as follows:

    3) Using the return value, always use parenthesis:
    sngTotol = CalcTotal(Parm1, Parm2)

    4) Discarding the return value, don't use parenthesis:
    CalcTotal Parm1, Parm2

    5) Discarding the return value and using the Call statement, always use parenthesis:
    Call CalcTotal(Parm1, Parm2)

    VB.NET simplifies this by always requiring parenthesis regardless of which
    syntax you choose.

    - Jim


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center