Good Editorial by Russell Jones - Page 6


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 6 of 6 FirstFirst ... 456
Results 76 to 85 of 85

Thread: Good Editorial by Russell Jones

  1. #76
    William Cleveland Guest

    Re: Good Editorial by Russell Jones

    Steve Dee wrote:
    >
    > > Jeeez, I can't believe I'm saying this, but "What Mike said", (in a

    > nutshell). It
    > > was a good option, when used appropriately. Unfortunately, they hosed it

    > in VB4, and
    > > it never really did recover fully. This made the potential pay-off much

    > less, and
    > > the justification requirements much more rigorous. But if you (generic

    > "you") don't
    >
    > I have seen no reason, including the example that justifies using Gosub.
    > Especially one that we have been warned about for years is going away. Just
    > because an obsolete construct exists, does not imply that it is "useful" or
    > should be used?
    >

    We've been warned that it isn't considered a good practice and, for the
    most part, it isn't. You shouldn't build whole applications that way,
    certainly, but it's handy on occasion, and I hadn't seen anything
    saying they were going to get rid of it. I don't really think they had
    any intention to get rid of it until they started making more drastic
    changes, like changing type names, all zero-based arrays, no DF, etc.

    Bill

  2. #77
    Steve Dee Guest

    Re: Good Editorial by Russell Jones

    Karl,

    > Mind pointing <g> to that article? I'm not sure which you're refering

    too. (Fwiw,
    > advising folks to save before "playing" with CopyMemory is not at all

    unlike advising
    > them to back up their registry before spelunking. The only folks who

    *typically*
    > complain are those who don't pay attention.)


    Sure I'll point it out <double g>. It was "Look Into Raw Memory Contents" in
    the Feb. 2001 issue. You missed my point though. I questioning why some
    people do things in VB when it is not the right language for the job. i.e.
    subclassing windows, and <ahem> what you did in the Feb. 2001 issue. Get
    serious here....you wrote this nice long article about how to view raw
    memory in VB. Why? Why would anyone do this? Why would you write an
    article telling people how to do this? You could have simply made the API
    call in C and then used the nice built in debugger to do exactly what your
    article does for free (read with no code)? And guess what? If I mess up
    the call, it won't take the IDE down and I won't lose my code changes.

    void main()
    {
    DWORD dwRet;
    GUID Guid;
    PDOMAIN_CONTROLLER_INFO pDomainControllerInfo;

    dwRet = DsGetDcName(NULL, NULL, &Guid, NULL, 0, &pDomainControllerInfo);

    <break point goes here>
    /// other stuff
    NetApiBufferFree(pDomainControllerInfo); // clean up...You did
    call this didn't you??????
    }

    On the breakpoint, the debugger shows me the address of
    pDomainControllerInfo in the locals window. I can expand the structure and
    see everything. What about the cool hexdump? Why don't we pop up a memory
    debug window and tell it to look at the address that pDomainControllerInfois
    pointing at? Neat a hexdump! (and of course, you can do this in VS.Net!!!)

    Oh you also stated that the documentation for this call was
    wrong....specifically:

    DomainControllerInfo
    [out] Pointer to a variable that receives a pointer to a
    DOMAIN_CONTROLLER_INFO structure describing the domain controller selected.
    This structure is allocated by the system and must be freed using the
    NetApiBufferFree function.

    Actually the documentation is correct. The variable pDomainControllerInfo
    receives a pointer to a structure which is allocated by a successful call to
    DsGetDcName and you should call NetApiBufferFree() when you are done.

    > how much more "powerful and safe" the .net approach would be. Begin now.

    (You may
    > use the back of the paper.)



    Dang....I can't even come up with a quarter of a page worth of code just the
    API call and use the tools built in.. What was the RAD tool in this case?
    Oh yeah...I didn't actually write a HexDump routine....but why shouId I?
    The same and more functionality is built into the debugger....the same
    debugger that is now part of VB.Net.

    When you dive into the API in VB you are leaving the nice safe VB
    environment and getting into the same area that causes C/C++ programmer's
    grief...but you are doing it with a tool that is not designed to debug it.
    You are loading a gun....when you use API call's that involve pointers in VB
    you are sticking the gun to your head.

    As far as the .Net approach goes. .Net is exposing the API to you in nice,
    safe, friendly, classes. Perfect for VB/Java typeof people. You don't want
    pointers? Fine, you don't need them. You want to subclass a window and
    debug it? Fine...do it. It's safe now.



  3. #78
    William Cleveland Guest

    Re: Good Editorial by Russell Jones

    Steve Dee wrote:
    >
    > Karl,
    >
    > > Mind pointing <g> to that article? I'm not sure which you're refering

    > too. (Fwiw,
    > > advising folks to save before "playing" with CopyMemory is not at all

    > unlike advising
    > > them to back up their registry before spelunking. The only folks who

    > *typically*
    > > complain are those who don't pay attention.)

    >
    > Sure I'll point it out <double g>. It was "Look Into Raw Memory Contents" in
    > the Feb. 2001 issue. You missed my point though. I questioning why some
    > people do things in VB when it is not the right language for the job. i.e.
    > subclassing windows, and <ahem> what you did in the Feb. 2001 issue. Get
    > serious here....you wrote this nice long article about how to view raw
    > memory in VB. Why? Why would anyone do this?


    Because your idiot boss has mandated that you use VB.

    Bill

  4. #79
    Steve Dee Guest

    Re: Good Editorial by Russell Jones

    > Because your idiot boss has mandated that you use VB.

    Hmmm....well I'm not sure that that is a good reason, but it IS a reason I
    hadn't thought of. Maybe your "idiot" boss simply wanted you to write only
    "pure" VB? That would mean no API's period. I could understand that
    reasoning if that is the case.



  5. #80
    William Cleveland Guest

    Re: Good Editorial by Russell Jones

    Steve Dee wrote:
    >
    > > Because your idiot boss has mandated that you use VB.

    >
    > Hmmm....well I'm not sure that that is a good reason, but it IS a reason I
    > hadn't thought of. Maybe your "idiot" boss simply wanted you to write only
    > "pure" VB? That would mean no API's period. I could understand that
    > reasoning if that is the case.


    I suppose so. My previous boss, although a nice guy, was thoroughly
    incompetent. The consensus among the programmers at my office seems
    to be that he pretty much deserves to be ignored whenever possible (he
    is still around, just managing a different group). It was amusing,
    however, to watch his management skills decline (he was always a bad
    programmer) as he got farther into his IT Management masters.

    Anyway, in the year and a half I worked for him I can't think of
    anything that we ever disagreed on where I think now that he turned
    out to be right.

    Bill

  6. #81
    Karl E. Peterson Guest

    Re: Good Editorial by Russell Jones

    Hi Steve --

    > Sure I'll point it out <double g>. It was "Look Into Raw Memory Contents" in
    > the Feb. 2001 issue. You missed my point though. I questioning why some
    > people do things in VB when it is not the right language for the job.


    Ah, I see. Right tool for the job, and all that other manly stuff, right?

    > subclassing windows, and <ahem> what you did in the Feb. 2001 issue. Get
    > serious here....you wrote this nice long article about how to view raw
    > memory in VB. Why? Why would anyone do this?


    Because it's there?

    > Why would you write an
    > article telling people how to do this?


    Teach a man to fish...

    > You could have simply made the API call in C


    Now _there_ is just the solution VBPJ readers would be looking for. Of course.

    > Oh you also stated that the documentation for this call was
    > wrong....specifically:


    My mistake. Misleading may have been a more proper term, when viewed from a VB
    perspective.

    > As far as the .Net approach goes. .Net is exposing the API to you in nice,
    > safe, friendly, classes.


    Which class retrieves the same info provided by the API in question?

    Thanks... Karl
    --
    http://www.mvps.org/vb



  7. #82
    Steve Dee Guest

    Re: Good Editorial by Russell Jones

    Hi Karl....I voiced my concerns about this offline to you, but either you
    didn't receive it, or you ignored it.

    > Ah, I see. Right tool for the job, and all that other manly stuff,

    right?

    Apparently you don't see it the same way. What's wrong with the right tool
    for the job? As far as the "manly" stuff goes, do you really feel that
    belittled by C? It's just another language.

    > Because it's there?


    So climb a mountain. I hear it's quite fun

    > Teach a man to fish...


    Yeah, but teach him HOW to catch fish, and tell him the right bait to use!

    > My mistake. Misleading may have been a more proper term, when viewed from

    a VB
    > perspective.


    I can see that....from a VB perspective. But you wrote an article in a
    leading magazine that said it was WRONG. Not cool. Believe it or not,
    people read your articles. I would think that you would want to give them
    accurate information.

    > Which class retrieves the same info provided by the API in question?


    I absolutely have no clue (and I looked). But that doesn't mean it won't
    exist after "beta days". But even if it does not exist, I would still
    question doing what you did in VB when C flat out gives it to you.....and
    with less effort.

    Playing around with the Windows API doesn't make you a "VB Pro"...but of
    course, you already know that.



  8. #83
    Karl E. Peterson Guest

    Re: Good Editorial by Russell Jones

    Hi Steve --

    > Hi Karl....I voiced my concerns about this offline to you, but either you
    > didn't receive it, or you ignored it.


    Hmmm, maybe.

    > > Ah, I see. Right tool for the job, and all that other manly stuff,

    > right?
    >
    > Apparently you don't see it the same way. What's wrong with the right tool
    > for the job? As far as the "manly" stuff goes, do you really feel that
    > belittled by C? It's just another language.


    Heh, no, far from it, really. I sense that coming from the other direction, though.
    Heck, your quick assumption right there, that this in any way related to C, goes
    straight to the point.

    > > Because it's there?

    >
    > So climb a mountain. I hear it's quite fun


    It is! Regular hobby of mine. :-)

    > > Teach a man to fish...

    >
    > Yeah, but teach him HOW to catch fish, and tell him the right bait to use!


    Dynamite works, but flies are more fun. <g>

    > > My mistake. Misleading may have been a more proper term, when viewed from a VB
    > > perspective.

    >
    > I can see that....from a VB perspective. But you wrote an article in a
    > leading magazine that said it was WRONG. Not cool. Believe it or not,
    > people read your articles. I would think that you would want to give them
    > accurate information.


    I do. This was very regretable. :-(

    Fwiw, I've insisted (over a month ago) that a tech reviewer be retained to help me,
    based on this single misstatement. The previous reviewer left FTP a year or so ago,
    and I'm very happy to have the second set of eyes again! Hopefully, this sort of
    mistake won't happen again. If you'd care to write a letter to the editors, I'd be
    happy to do what I can to fast-track it for the correction.

    > > Which class retrieves the same info provided by the API in question?

    >
    > I absolutely have no clue (and I looked).


    Would you believe me if I said, "me too!" <g>

    > But that doesn't mean it won't exist after "beta days".


    Also provides weighty evidence that the framework will *never* cover the needed
    bases. They never do, and it's pointless to pretend otherwise.

    > But even if it does not exist, I would still
    > question doing what you did in VB when C flat out gives it to you.....and
    > with less effort.


    That's not the point. Folks *do* do this stuff, and with good cause. Mine is not to
    question why. I only help them achieve their goals.

    > Playing around with the Windows API doesn't make you a "VB Pro"...but of
    > course, you already know that.


    I've always hated that column name. Used to be "Q&A". Much more appropriate. Then
    FTP bought inquiry.com, and thought they had a product tie-in. Not something I had a
    say in.

    Thanks... Karl
    --
    http://www.mvps.org/vb



  9. #84
    Steve Dee Guest

    Re: Good Editorial by Russell Jones

    Hi Karl,

    > Heh, no, far from it, really. I sense that coming from the other

    direction, though.
    > Heck, your quick assumption right there, that this in any way related to

    C, goes
    > straight to the point.


    Perhaps I misread what you typed. You seemed to be taking pot shots at
    C....i.e. the "manly" way. You know as well as I do that these dang
    messages can easily get "read the wrong way".

    > It is! Regular hobby of mine. :-)


    I bet it is.....perhaps if I ever got smart and quite smoking.....

    > Dynamite works, but flies are more fun. <g>


    Okay...I'll bite (scuse me) byte. In this particular situation I see VB as
    dynamite (or sledgehammer). Much as I see C/C++ as dynamite for GUI
    development. Which one is the dynamite and which is the fly (in your
    opinion)?

    > I do. This was very regretable. :-(
    > Fwiw, I've insisted (over a month ago) that a tech reviewer be retained to

    help me,
    > based on this single misstatement. The previous reviewer left FTP a year

    or so ago,
    > and I'm very happy to have the second set of eyes again! Hopefully, this

    sort of
    > mistake won't happen again. If you'd care to write a letter to the

    editors, I'd be
    > happy to do what I can to fast-track it for the correction.


    Glad to hear you say that! I actually WAS thinking of writing a letter, but
    since it seems obvious that you DO care and are fixing the problem I don't
    think it is needed.

    > Also provides weighty evidence that the framework will *never* cover the

    needed
    > bases. They never do, and it's pointless to pretend otherwise.


    True....

    > That's not the point. Folks *do* do this stuff, and with good cause.

    Mine is not to
    > question why. I only help them achieve their goals.


    I know they do....I have to clean up after it all the time. I just don't
    feel that doing everything in one language is neccessarilty the right or
    smart way to do the job. If someone asked me to show how to do a memory
    dump for debugging purposes in VB I would have probably asked them why,
    showed them the nice built in stuff in the VC debugger and then if they
    really had to do it in VB for some reason helped them with it. I doubt most



  10. #85
    Karl E. Peterson Guest

    Re: Good Editorial by Russell Jones

    Hi Steve --

    > > Heh, no, far from it, really. I sense that coming from the other direction,

    though.
    > > Heck, your quick assumption right there, that this in any way related to C, goes
    > > straight to the point.

    >
    > Perhaps I misread what you typed. You seemed to be taking pot shots at
    > C....i.e. the "manly" way. You know as well as I do that these dang
    > messages can easily get "read the wrong way".


    Sure.

    > > It is! Regular hobby of mine. :-)

    >
    > I bet it is.....perhaps if I ever got smart and quite smoking.....


    That'd make a difference, no doubt.

    > > Dynamite works, but flies are more fun. <g>

    >
    > Okay...I'll bite (scuse me) byte. In this particular situation I see VB as
    > dynamite (or sledgehammer). Much as I see C/C++ as dynamite for GUI
    > development. Which one is the dynamite and which is the fly (in your
    > opinion)?


    Okay, this one's clear. VB is the fly. It takes *far* more patience, finesse, and
    intuition than C/C++ ever would. That's why a lot of folks do it simply for the fun
    of it. When it becomes as business like as some would seem to want it, the user base
    will dry up. If it's a "job", who needs it?

    > > Also provides weighty evidence that the framework will *never* cover the needed
    > > bases. They never do, and it's pointless to pretend otherwise.

    >
    > True....


    That's a point *everyone* needs to keep in mind, here.

    Thanks... Karl
    --
    http://www.mvps.org/vb



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