From VB.net to C# - Page 9


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 9 of 14 FirstFirst ... 7891011 ... LastLast
Results 121 to 135 of 196

Thread: From VB.net to C#

  1. #121
    Mike Mitchell Guest

    Re: From VB.net to C#

    On Sat, 6 Apr 2002 12:12:39 -0700, "Isle of the Dead"
    <isleofthedead@earthlink.net> wrote:

    > No. His last set of viewpoints are demented. I can't
    > believe anyone would question namespaces.


    I am not questioning namespaces per se, but their existence in a
    supposedly B.A.S.I.C. language. You can have all the namespaces you
    wish in C++ or C#, but B.A.S.I.C. as in classic Visual Basic did a
    fine job without all the propeller-head complexity, so why should we
    need it now?

    MM ("Sorry if this opinion was controversial!")

  2. #122
    Mike Mitchell Guest

    Re: From VB.net to C#

    On Sat, 6 Apr 2002 20:44:18 +0200, "Thomas Eyde"
    <thomas.eyde@online.no> wrote:

    >I believe that's what Mike meant.


    Thomas, you're right; but it hardly matters what I meant. They'll just
    twist my words nevertheless.

    MM ("Sorry if this opinion was controversial!")

  3. #123
    Mike Mitchell Guest

    Re: From VB.net to C#

    On Sat, 6 Apr 2002 20:47:22 +0100, "Kunle Odutola"
    <kunle.odutola@<REMOVETHIS>okocha.freeserve.co.uk> wrote:

    >No. Mike is attempting to fudge the issue again.


    Achtung! Twisters ahead!

    >His post basically argued that since there are no repeated entries in the
    >References list, there is no need for namespaces.


    What I said was: "Also, when I use the References list in VB6 I see
    nice, meaningful English phrases like 'Visual Basic objects and
    procedures', or 'Microsoft ActiveX Data Objects 2.5 Library'. I don't
    see ugly jargon like 'System.Runtime.InteropServices'."

    Where did I argue there that there is no need for namespaces? I was
    highlighting the approachable, easily comprehensible, English phrases
    in the VBc References list compared to statements embedded,
    un-RAD-like, straight into the code such as "Imports System.Runtime.
    InteropServices"

    I even supplied an alternative view elsewhere of how some of the other
    jargon could be simplified and returned to its classic Visual Basic
    stable:

    Sub Whatever()

    IsProtected
    IsOverridable

    End Sub

    KISS!

    > My reply gave an example
    >with VB5/6 - that he might be familiar with giving his ignorance of VB.NET -
    >where there is a typename collision *across* references. This is the very
    >problem that namespaces and typename aliasing addresses elegantly.


    I showed that there is no problem in VB6 that needed solving! In over
    300 entries in my References not a single multiple entry! As for
    seeing the "solution" in VB.Net as elegant by just incorporating
    jargon like "Imports System.Runtime.InteropServices" as in-line code,
    well, classic VB had other, better ways of instructing the programmer
    without resorting to hitting him over the head with a syntax hammer.
    Option Explict comes to mind, or Option Base, or On Error GoTo Label
    -- all simple, English-like constructs which do not need a degree in
    obfuscation to be understood. I mean, who *ever* came up with
    Try...Catch...Finally?!! ***?

    MM ("Sorry if this opinion was controversial!")

  4. #124
    Mike Mitchell Guest

    Re: From VB.net to C#

    On Sun, 7 Apr 2002 12:47:04 +0200, "Thomas Eyde"
    <thomas.eyde@online.no> wrote:

    >Ok, that was not how I understood it. I interpreted it as Mike wants
    >friendly names on his references instead of
    >"System.Runtime.InteropServices".


    Exactly! B.A.S.I.C. in other words. Not B.A.S.I.C. that looks like
    C++!

    MM ("Sorry if this opinion was controversial!")

  5. #125
    Cali LaFollett Guest

    Re: From VB.net to C#

    > Delphi does it this way:
    >
    > procedure Dispose(disposing: Boolean);protected;overridable;
    > (the syntax is not entirely correct, but you get the picture)
    >
    > The Delphi'ers have no problem with this, are they smarter than us?


    Thomas not entirely correct (as you pointed out ;-)

    ****************************************
    interface

    uses
    Classes, SysUtils;

    type
    DisposableObject = class
    protected
    procedure Dispose(disposing: Boolean); virtual;
    end;

    implementation

    procedure DisposableObject.Dispose(disposing: Boolean);
    begin
    // Dispose stuff here...
    end;
    ****************************************

    Cal



  6. #126
    Cali LaFollett Guest

    Re: From VB.net to C#

    > Thomas not entirely correct (as you pointed out ;-)

    Also note, Mike should have been able to of quickly correct you but I am
    sure he is off supporting others in the Delphi news groups.

    Cal



  7. #127
    Kunle Odutola Guest

    Re: From VB.net to C#


    "Mike Mitchell" <kylix_is@yahoo.co.uk> wrote in message
    news:3cb035f9.11313952@news.devx.com...
    > On Sun, 7 Apr 2002 12:47:04 +0200, "Thomas Eyde"
    > <thomas.eyde@online.no> wrote:
    >
    > >Ok, that was not how I understood it. I interpreted it as Mike wants
    > >friendly names on his references instead of
    > >"System.Runtime.InteropServices".

    >
    > Exactly! B.A.S.I.C. in other words. Not B.A.S.I.C. that looks like
    > C++!


    Mike, there is no link between B.A.S.I.C and ProgID of COM components. You
    do realise that COM itself written in C/C++ right?.

    Also, in the post I replied to you weren't arguing for friendly names. You
    were ranting about how "Imports" felt wrong, namespaces were a "solution in
    search of a problem" and detailing the problems with VB/VB.NET access
    modifier syntax accroding to MM.

    Kunle



  8. #128
    Kunle Odutola Guest

    Re: From VB.net to C#


    "Mike Mitchell" <kylix_is@yahoo.co.uk> wrote in message
    news:3cb03141.10105790@news.devx.com...

    > >No. Mike is attempting to fudge the issue again.

    >
    > Achtung! Twisters ahead!
    >
    > >His post basically argued that since there are no repeated entries in the
    > >References list, there is no need for namespaces.

    >
    > What I said was: "Also, when I use the References list in VB6 I see
    > nice, meaningful English phrases like 'Visual Basic objects and
    > procedures', or 'Microsoft ActiveX Data Objects 2.5 Library'. I don't
    > see ugly jargon like 'System.Runtime.InteropServices'."
    >
    > Where did I argue there that there is no need for namespaces?


    Perhaps where you said:

    <quote>
    I can't say I ever seen multiple entries in my references. I've just
    had another look at mine, there are 370 in the list, and they don't
    contain any multiple entries. So could your namespace argument just be
    another "solution in search of a problem"? When you say, I had to
    depend on GUIDs, so what? Only a year or two ago, that whole system
    was being defended by Microsoft to the hilt! Now you imply that it was
    all wrong and namespaces are the answer.
    </quote>

    > > My reply gave an example
    > >with VB5/6 - that he might be familiar with giving his ignorance of

    VB.NET -
    > >where there is a typename collision *across* references. This is the very
    > >problem that namespaces and typename aliasing addresses elegantly.

    >
    > I showed that there is no problem in VB6 that needed solving! In over
    > 300 entries in my References not a single multiple entry!


    Showing your ignorance [of VB.NET] again Mike. Namespaces <> References.
    VB.NET has *both*.

    Kunle


  9. #129
    Mike Mitchell Guest

    Re: From VB.net to C#

    On Sat, 6 Apr 2002 14:54:25 -0500, "Ian R" <ianr@na.net> wrote:

    >1)
    >The IsXXXX way implies a function. These are attributes or properties of the
    >method. Using IsSomething for a property of an object doesn't make sense
    >from an OOP point of view. Which is more logical?
    >
    >If User.Online Then
    >
    >or
    >
    >If User.IsOnline Then


    If User.IsOnline of course! "If User.Online" is just an abbreviated
    (and thus unnecessarily obfuscatory) way of saying the same thing. I
    would *prefer* to read something like "Is the user online?", which
    would be understandable to a lot more people, wouldn't it? Yes, the
    parser would have to work overtime, but who cares with the mainframe
    power we've got on our desks and aren't utilising, except for playing
    games (except me)? Anyway, it was only a suggestion. I said so. I
    could instead have suggested:

    Sub Whatever ()

    Protected
    Overridable

    End Sub

    or:

    Sub Whatever() Protected Overridable

    End Sub

    or:

    Sub Protected Overridable Whatever()

    End Sub

    There is more than one way of skinning a cat.

    >2)
    >You already have method attributes in VB classic. You're just so used to
    >them you don't realize it.
    >Remember Private/Public/Friend Sub ? Are you now saying that VB6 et al is
    >wrong and should have been done in the following way ?
    >
    >SomeSub(ByVal SomeParameter As Integer)
    >
    > Private
    > Sub
    >
    >...
    >
    >End Method ' Or some new keyword


    It's certainly not ideal the way it is, but there are only four of
    them (you forgot Static). But now there are a whole lot more in
    VB.Net. And reading "Protected Overridable" in front of Sub just does
    not make it *more* readable, but less.

    >Now you're just *****ing for *****ings sake. As usual.


    More Personal Abuse! (MPA)

    >> Yes! I *don't* want C with B.A.S.I.C. syntax! I want B.A.S.I.C.! Maybe

    >
    >You have it. You just refuse to see that.


    No, I don't "have" it. It's different. Therefore I don't see what you
    see. LotusScript is more like VB than VB.Net.

    >> Microsoft will get the message that some consumers want to see the
    >> same in a simplified version of VB.Net? Make the product accessible to

    >
    >Maybe you should switch to RPG. Ticking boxes might be easier for you.


    Dunno about RPG, but ticking boxes and pulling down lists seem like
    good ideas to me! Kinda, sorta RAD-like, don't you agree? Why all this
    fetish with writing reams of code, more code, and yet more code? It's
    a buzz, isn't it? Without reams of code, the buzz would be lost,
    maybe? Keep on writing reams of code because it bolsters our arcane
    mystery, and we've got a propeller head and two anoraks to support?

    >> In classic VB, Unicode was forced down our throats at one fell swoop.

    >
    >VB had nothing to do with Unicode. That was a platform implementation and VB
    >had to be modified to support it. Like all the other languages.


    VB strings with and after VB4-32 had *everything* to do with Unicode!
    There was *no* other choice! VB could have supported Unicode in
    numerous ways, like Dim MyString As Unicode or Dim MyString As String.
    Spot the difference? The latter would not have broken any existing
    apps that happened to use strings for file buffers, i.e. all of them!
    It was not done, because the designers didn't want to. And then they
    had to introduce the Byte array (and therefore the Byte variable
    type), and LenB, and so on. Just because someone took the decision
    that all strings would henceforth be Unicode ones.

    >> No option to switch it off, no choice, oh, no, that would have been
    >> just too democratic, wouldn't it? Unicode made no difference to any of
    >> my apps, except that I couldn't rely on strings for file buffers any
    >> more. Unicode was for me a pain in the butt. It was just a ****

    >
    >Maybe you didn't need it but others did. Windows is an international
    >platform. Microsoft didn't write it just for Mikee.


    So how many VB apps need Unicode compared with the ones that don't?
    What d'you reckon? 10:90? 20:80? Even it was 50:50 that still leaves
    50% of the already-written apps requiring potential changes in the way
    they handled strings.

    >> nuisance that suddenly appeared on the scene. The obvious thing they
    >> could have done was provide an option, e.g.
    >>
    >> Option Unicode
    >>
    >> or:
    >>
    >> Dim MyString As UnicodeString
    >>

    >
    >Maybe if you'd read the documentation once in a while you'd find possible
    >solutions to your problems. Byte arrays and StrConv come to mind.


    Oh, I used Byte arrays all right! And StrConv, too. That's not the
    point. They were necessary because Unicode strings can't hold odd
    numbers of bytes.

    >> Dead easy for them to do, but they just wanted everyone to adopt
    >> Unicode habits overnight, even though vast numbers of the world's apps
    >> will never, ever need it. So in addition to Unicode, now I have to

    >
    >You have no clue what you're talking about do you ?


    MPA!

    >> learn about Marshalling and what ever else besides. Sounds like I

    >
    >What is there to learn ? The only time you'll need marshalling is when using
    >p/invoke (or since you probally didn't read the docs again, that would be
    >api calls for you) and from your level of comprehension about most things
    >you don't use them.


    p/invoke? I believe you meant to say P-Invoke. At least use the
    correct syntax so that newbies will understand! I use the Windows API
    extensively, thanks to reading Dan Appleman's excellent books on the
    subject. Dead simple. But P-Invoke sounds suspiciously like more
    arcane jargon borrowed from the nether world of C++. "Declare
    Function" sounds much more like comprehensible English, doesn't it?

    >> >Every class you used in VB6 (as in pre-packaged components) had *at

    >least*
    >> >one interface you had to learn. Deal with it.

    >>
    >> And now there are 5,000!


    Yeah, I can just guess what Jesus must have felt like! A veritable
    multitude!

    >And that's a bad thing ? Are you actually trying to say that having proper
    >libraries is bad ?? That being able to do things in a couple of lines of
    >code that once took a large amount of hacks and lines of code is bad ??


    What "large amount of hacks"? What is the problem with "Declare Sub"?
    Moreover, the API was needed *only* when more advanced stuff was
    necessary. The namespaces in VB.Net on the other hand are part and
    parcel of the whole caboose. You can't get away from namespaces in
    VB.Net. Dan Appleman writes: "Namespaces determine the structure of a
    VB.NET program from the perspective of scoping. Every type of object
    in VB.NET has a name and is part of a namespace." So, the VBc
    programmer who didn't need to use API calls could just ignore the
    entire API thing, yet VB.Net programmers have to "know" their
    namespaces! Sounds like a lot of additional baggage to accompany the
    OOPification of VB.Net.

    > What drugs are you taking Mike ?


    Er, ibuprofen, actually -- you lot give me a pounding headache!

    > You are seriously whacked in the head.


    Yep. I just said so! By you lot! But it comes across yet again as MPA.

    >Do you use every control and library that's available for VB ? No. Sounds
    >like you don't use any actually.


    Jeez, with sounds like that, I'd get a new CD player.

    > Same thing in the framework. If you don't
    >need it don't use it. What's the problem ?
    > Other than you're a whining blockhead ?


    MPA!

    >> I want to *build upon* past experience! That would seem to me to be
    >> the most sensible means of "reuse". What you're advocating is

    >
    >Get some experience first.


    Implied MPA!

    >> rewriting my entire experiences to the tune of VB.Net! Oh, well, I
    >> 'spose rewriting will become second nature in the VB.Net world!

    >
    >No. Taking advantage of .NET *might* (in your case most likely) require
    >re-coding depending on how you coded things in the first place.
    >Using VB.NET like VB6 doesn't require much more on your part.


    I think it does.

    >> >>There is no Dispose in VB6, so it's immaterial.

    >
    >Dispose isn't required for all objects. We've been through the DF/NDF crap
    >before.


    You're right about the crap, certainly. Ask *most* VB programmers what
    they understand by "deterministic finalization" and they'll likely
    respond with "***?"

    >> But VB3 didn't break all the rules of backward compatibility! Its new
    >> features just added to the language without altering whatever mindset
    >> the programmer had already adopted.
    >>

    >
    >And ended up with VB6, which though is a good tool isn't as good as VB.NET.


    It is *different* from VB.Net. It *is* a good tool. When I see the
    figures that prove VB.Net is as good a tool, I'll start to believe it.

    >The problem with backward compatibility is you end up keeping a lot of
    >excess baggage that isn't needed and limits what you can do.


    That is not the case. You can use new features of the next version,
    while retaining and maintaining the previous code. Then, when you are
    satisfied that the new features behave properly, you can start to
    discontinue your "legacy" code. Simple, straightforward common sense.

    MM ("Sorry if this opinion was controversial!")

  10. #130
    Mike Mitchell Guest

    Re: From VB.net to C#

    On Sun, 7 Apr 2002 12:57:25 +0200, "Thomas Eyde"
    <thomas.eyde@online.no> wrote:

    >Delphi does it this way:
    >
    > procedure Dispose(disposing: Boolean);protected;overridable;
    > (the syntax is not entirely correct, but you get the picture)


    Hey! That looks *just* like the kind of syntax mods I was coming up
    with!

    >The Delphi'ers have no problem with this, are they smarter than us?


    Of course we are! (Only kidding, Delphics!)

    MM ("Sorry if this opinion was controversial!")


  11. #131
    Mike Mitchell Guest

    Re: From VB.net to C#

    On Sat, 6 Apr 2002 14:56:48 -0500, "Ian R" <ianr@na.net> wrote:

    >And a lot of it pretty good. I suppose you're adverse to DVDs as well too ?


    No.

    MM ("Sorry if this opinion was controversial!")

  12. #132
    Mike Mitchell Guest

    Re: From VB.net to C#

    On 6 Apr 2002 22:11:21 -0800, "Jason" <jason@creative_nospam_corp.com>
    wrote:

    >Don't forget Personal Video Recorders. They make things a lot easier, but
    >I'll bet Mike won't try one because "you can't rewind a hard drive."


    How d'you get back to the beginning then?

    MM ("Sorry if this question was controversial!")

  13. #133
    Mike Mitchell Guest

    Re: From VB.net to C#

    On Sat, 6 Apr 2002 20:31:01 -0500, "dont_eat_the_salmon"
    <officerjenny@nospam.com> wrote:

    >is MSFT just abandoning this area? i find it hard to believe they would
    >pass up a chance to make $$$ anywhere


    Well, yes, implicitly they *are*. Discontinuing a product inevitably
    sends *some* kind of message to the community. I think their long-term
    aim is to get consumers to see and use the internet as the next
    "operating system", controlled (naturally) by them and supplied with
    functionality through web services, also controlled by them if at all
    possible. It's the new revenue stream model. Ergo, with this mindset,
    there *is* no "local app" any more where the concept of a "classic VB"
    would fit the bill.

    MM

  14. #134
    Mike Mitchell Guest

    Re: From VB.net to C#

    On 6 Apr 2002 22:05:22 -0800, "Jason" <jason@creative_nospam_corp.com>
    wrote:

    >If you don't like JavaScript, you could just use VB.NET. I still contend
    >that it is simpler to use, even for macros and other simple tasks, than VB6
    >or VBA.


    Such a contention is ridiculous! Just compare any of the VB.Net
    "wordiness" with VB's simplicity. You'll see what I mean, honest!

    MM ("Sorry if this opinion was controversial!")

  15. #135
    Thomas Eyde Guest

    Re: From VB.net to C#

    For simplicity I dropped the whole file specification, but just wrote the
    sample method signature the way it would look in Delphi, but kept the VB
    words.

    You corrected:
    procedure Dispose(disposing: Boolean);protected;overridable;

    to:
    procedure Dispose(disposing: Boolean); virtual;

    Both are the Delphi way, which was my point.

    ..Thomas

    "Cali LaFollett" <cali@please_no_spam_visionized.com> wrote in message
    news:3cb03b76@10.1.10.29...
    > Thomas not entirely correct (as you pointed out ;-)
    >
    > ****************************************
    > interface
    >
    > uses
    > Classes, SysUtils;
    >
    > type
    > DisposableObject = class
    > protected
    > procedure Dispose(disposing: Boolean); virtual;
    > end;
    >
    > implementation
    >
    > procedure DisposableObject.Dispose(disposing: Boolean);
    > begin
    > // Dispose stuff here...
    > end;
    > ****************************************





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