Results 1 to 38 of 38

Thread: VB to C++?

  1. #1

    Thread Starter
    Hyperactive Member crosbj's Avatar
    Join Date
    Oct 2000
    Location
    Michigan
    Posts
    285

    VB to C++?

    I have been using vb for @ 2 yrs to develop standard database stuff. Before that I worked with Access for a couple of years but not fulltime. I don't have any classical programming training and just kinda fell into this job. Now it has become a fulltime job developing database applications. I am presently finishing up an app that uses vb 6. From here I was planning on going to .Net because I don't see much point in continuing with vb 6. I hear that it has changed vb a lot and as I stated earlier I don't have a great deal of training in programming. So at this point I'm thinking that if I'm going to switch to .Net and have to learn vb again why not just go to .Net and start learning C++. It seems to be (C++) the most respected programming langauge in job searches. My questions are how hard is C++ to learn vs vb? Is it good for doing database apps? What is the best way to learn (web site forums etc) or any books that are recommended? In general are there any good reasons to switch other than to say you program in C? Any feedback would be appreciated.

  2. #2
    Frenzied Member Technocrat's Avatar
    Join Date
    Jan 2000
    Location
    I live in the 1s and 0s of everyones data streams
    Posts
    1,024
    How hard is C++ to learn vs vb?
    Very hard in comparisson. VB is very easy to understand and use for people that don't have any real programming training. C++ requires a lot of reading and has a bit of a learning curve. One possitive is that I did it. I was a VB person that came into a C/C++ world, and I know many others here have as well. One hint I will give you if you decied to continue is to unlearn almost everything you know about VB except the very basics of programming and to stop thinking in VB. If you can do this its going to help you a ton.

    Is it good for doing database apps?
    No, VB, .NET, or C# is still a better choice. It can be done, just not as easily or as fast.

    What is the best way to learn (web site forums etc) or any books that are recommended?
    I think this question can only be answered by you and your learning style. For me I read books, lots and lots of books and got help from forums like this one.

    In general are there any good reasons to switch other than to say you program in C?
    Well I think you know the main reason and that is there are generally more jobs in C/C++ field than VB. Also you can do a lot more in C/C++ than you can VB. Most applications are writen in C, C++ or ASM (I SAID MOST not all).
    MSVS 6, .NET & .NET 2003 Pro
    I HATE MSDN with .NET & .NET 2003!!!

    Check out my sites:
    http://www.filthyhands.com
    http://www.techno-coding.com


  3. #3

    Thread Starter
    Hyperactive Member crosbj's Avatar
    Join Date
    Oct 2000
    Location
    Michigan
    Posts
    285
    Thanks for the reply 'Technocrat'. I guess I don't really feel like using vb is really programming? All I do is throw objects on a form and throw a little code to make them do stuff. All the things you need to do can be done if you just know which keyword to use and read about it. Is this really programming? I feel like I'm developing in Access but instead of Access handling the events I have to write them all. Granted my apps are not awesome or anything and I feel comfortable with vb but am I really becoming better at learning to program?

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    In as much as you're telling the computer what to do, yeah, you're programming. You still have to think logically, get things in the right order, handle errors, do proper testing, etc.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Technically, both VB and C++ are programming. They both have all major programming concepts (except that VB lacks OOP - VB.NET supposedly doesn't, but I don't want to look at VB.NET code.)

    Practically, VB is good for databases, testing COM objects, and very small applications (as a friend of mine once said, "cashier desk apps"), where C++ is used for the real programs.

    I don't want to comment about .NET.

  6. #6

    Thread Starter
    Hyperactive Member crosbj's Avatar
    Join Date
    Oct 2000
    Location
    Michigan
    Posts
    285
    Practically, VB is good for databases, testing COM objects, and very small applications (as a friend of mine once said, "cashier desk apps"), where C++ is used for the real programs.
    You don't consider database apps real programs? What do major app vendors who use databases use for their data entry vb or C++? Are you saying that C++ should only be used for non-database programs like an Office application Excel etc. I think my main thing is we have a lot of systems we bought from large software companies which our business uses to warehouse information. They are all database driven but none of the big db apps are written in vb. So if I am going to continue to develop db apps why not use C++ if thats what all the big db app driven software uses? I understand what you are saying about small apps, its easy to use vb and Access to build an app for a few people to use but technically the only thing the vb app is doing is passing data to a database. The actual size of the database is determined by the db used. So what would the complexity of the interface matter if it worked? If you used vb to build an app that inserted 5 million rows into a sql server or the same app inserted 1000 rows into Access? Why do the large database apps use C++ when all they are ultimately doing is passing data to a database system to manage? If I am going to make a living at building database apps shouldn't I learn to use what professional app developers use? Why use vb just because its easier? Why not just use Access to build the interfaces? What are these so called "real programs" that are written in C++? By the way thanks for the reply I appreciate your feedback!

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    With most DB systems I've seen, the DBMS itself will be written in C or C++. That then exports a SQL interface, which would most likely be used by a VB program.

    In essence, you're "scripting" the core database engine. And that's all that's needed; I wouldn't make an Access front-end using C++, I'd pick VB.

    Although on my chosen platform (Unix), I'd probably end up using C/GTK or Perl anyway.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  8. #8

    Thread Starter
    Hyperactive Member crosbj's Avatar
    Join Date
    Oct 2000
    Location
    Michigan
    Posts
    285
    With most DB systems I've seen, the DBMS itself will be written in C or C++. That then exports a SQL interface, which would most likely be used by a VB program.
    Yes, I'm certain that my copy of MSSQL 7 was not written in VB. My point is that many of the commerical apps that we use have an interface (application) that manipulates data within an Oracle or large SQL database. These applications handle data entry (sending sql commands to the db engine), reporting etc. these interfaces are NOT written in vb. I have never seen a commercial software package which uses a major database (MSSQL etc) for data storage/retreival using an interface that was written in vb? They must write them in C++ for a reason? Granted there are a lot of small in house apps that are build with vb but I haven't seen any commerical database interfaces written in vb.

  9. #9
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    The commercial database interfaces often do many calculations themselves, which is reason enough not to use VB for them. When it comes to complicated algorithms C++ can really live its speed advantage vs. VB.

    If I should make a recommendation, learn C#. Through the .Net library you can still program relatively easy and you have good DB access via ADO.NET. You also have RAD programming (I think). On the other hand C# gives you an idea of OOP programming and the syntax of C++.
    Once you know C# you can then go on to C++.

    Or you wait a little until our "C++ for absolute newcomers" tutorial is done.
    Galahtech
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  10. #10

    Thread Starter
    Hyperactive Member crosbj's Avatar
    Join Date
    Oct 2000
    Location
    Michigan
    Posts
    285
    CornedBee - What exactly is C# and why did M$ introduce another language? Is it going to be around for a while or what? I went to a MSDN developers group several months ago and one of the speakers had switched to C# from vb and was really impressed with it. I'm just concerned that its not just a passing fad for M$. I know that at least vb/C have been around for a while and will not be exiting easily.

  11. #11
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    MS made an extremely good move by submitting C# for standardisation, and keeping the documentation available for everyone. As such, there is now a project for using C# on non-Windows systems, along with the whole .NET framework.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  12. #12
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    C# is probably going to stick around for quite a while, maybe even replacing Java...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  13. #13
    Lively Member blackeyed's Avatar
    Join Date
    Nov 2002
    Location
    Chandigarh
    Posts
    118
    What I can say is only that C++ requires you to enlargen your database.


    For your information, as per the statistics you will have to write twice as much code as you write it in VB for the same problem and probably more than that.

    But this will help you grab the fundamentals of the computer world much clearly.

    Well all these advices come from my friend sitting next to me.

    I can simply say that you will need a lot of hard work and time to shift from VB to C++..

    Bye and if you are shifting to c++ then may God bless you.
    ~~Avi~~

  14. #14
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    well im on C# but i must say a thing...vb.net and C# are the same thing...only a couple differences..u have some imported functions from vb6 in vb.net that lack in C# and some things like intelsense xml documentation in c# that is lacking in vb.net..anyways is just a matter of sintax..cuz they both run on the same framework
    \m/\m/

  15. #15
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Quite right. Both VB.NET and C# are compiled to the same bytecode. They use the same framework. They are part of the same philosophy. It's really only a matter of syntax and the capabilites of the IDE.

    There might be some minor differences in terms of what part of the framework is actually accessible (there was a strange organization of the groups at MS), but I don't think you'll ever notice it.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  16. #16

    Thread Starter
    Hyperactive Member crosbj's Avatar
    Join Date
    Oct 2000
    Location
    Michigan
    Posts
    285
    Sounds like the general consensus is to upgrade to .Net and begin with C#.

  17. #17
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Originally posted by crosbj
    Sounds like the general consensus is to upgrade to .Net and begin with C#.

  18. #18
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    General consensus, except for our Guru...

    But not everyone can be a hardcode C++ hacker (real sense).
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  19. #19
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Originally posted by CornedBee
    But not everyone can be a hardcode C++ hacker (real sense).
    I absolutely agree.
    Everyone can be a C# programmer.
    Everyone can be a VB programmer.
    Everyone can be a .NET programmer.
    Imagine how worthless those positions will be in 20 years.
    Mark my words.

    Or ignore them, I don't care.

    (Yes, many people will disagree with this. Flames welcome.)

  20. #20
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    /me agrees with the man

    C++ will be gone in 20 years as well. I will personally guarantee that fact. However, the algorithms and designs behind things will *still* apply.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  21. #21
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    20 years is an eternity in computer terms...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  22. #22

    Thread Starter
    Hyperactive Member crosbj's Avatar
    Join Date
    Oct 2000
    Location
    Michigan
    Posts
    285
    Everyone can be a C# programmer.
    Everyone can be a VB programmer.
    Everyone can be a .NET programmer.
    Imagine how worthless those positions will be in 20 years.
    This is exactly the point of my post. If I am going to make a living by building computer apps then I want to make sure I am also learning a skill. The apps that I build will be gone in a few years what of all the time I spent learning how to build them? I don't want to spend another 5 yrs building apps in vb and then find out that after losing a job: "Hey anyone can build us an app in vb how about a real language?". Oh great should have spent some more time learning how to program. This is why I am considering moving away from vb. Why waste my time building apps in vb just because its easier? Why not spend my development time learning C++ even if it is harder to begin with. Now is the time to do it not after I've lost a job. Maybe I will just load my version of VC++ 6 and start from there. It doesn't look like much of VC++ was changed in .Net anyway!

  23. #23
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Wow, cool, more people agreed than disagreed (2 vs. 0). Didn't expect that.

    Originally posted by crosbj
    It doesn't look like much of VC++ was changed in .Net anyway!
    Depends how you mean.
    The program "Visual C++.NET" can be used for .NET development and for non-.NET (Win32, MFC, etc.) development.
    For .NET development, it's vastly different.
    For non-.NET development, it's practically the same, though the compiler is slightly better (a few ANSI compliance bugs were fixed, though many are still there), and the IDE is much better (albeit its higher tendency of memory hogging).

  24. #24

    Thread Starter
    Hyperactive Member crosbj's Avatar
    Join Date
    Oct 2000
    Location
    Michigan
    Posts
    285
    WOW! Thanks too all for the feeback. I think I will look at C++ but should I start with .Net or begin with version VC++ 6 which I currently have? From the standpoint of learning the lanquage with the M$ studio tools which would be easier to begin with version 6 or .Net or does it matter?

  25. #25
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Well, depends if you want to learn C++ or "C++.NET".
    If you want to learn "C++.NET" , you'll have to use VC++.NET, of course.
    If you want to learn C++ , you can use either one. If you're using an older computer, use VC++ 6, since VC++.NET might be a little "heavy" (one instance typically uses 25-50MB of RAM while idle, and some more while compiling).

    I use VC++.NET (Pentium 3 450MHz, 512MB RAM, Win2k Pro) and it works fine. But it would probably be slow if I had less RAM and/or used Win9x.

  26. #26

    Thread Starter
    Hyperactive Member crosbj's Avatar
    Join Date
    Oct 2000
    Location
    Michigan
    Posts
    285
    Yonatan - I have about the same computer config... not too concerned with that as much as the examples, books etc available for learning. Probabaly more is available for VC++ 6 than .Net at this point. Have you done any database stuff with C++? Can I still acess stuff like ADO for database access?

  27. #27
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    You can, but it is, in technical terms, "icky".
    Using MFC makes it easier, but the easiest is with VB.
    I haven't messed much with databases, neither in C++ nor in VB.

  28. #28
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Originally posted by crosbj
    Probabaly more is available for VC++ 6 than .Net at this point.
    You'd be surprised. Books came out for .NET before even the beta was out. It was just sick.

  29. #29
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    The basic examples and tutorials for C++ are mostly for ANSI C++ (though often outdated) and there is therefore little difference between VC++6 and VC++7 (as is the inofficial name of VC++.NET). IntelliSense works better now and you have tabs showing you which windows are open, and you can convert your entire code into a tree-view which can be very useful, but that's about all.

    The creation wizards slightly differ, which might be a problem as most descriptions for them are for 6, but you can always come here for help.

    The CPU isn't important for the performace of 7, the RAM is. I have an Athlon 600 running Win2k. Used to have 128 MB RAM and 7 was sloooow...
    Upgraded to 384 MB and everything works fine (except 3DSMAX 5 )
    Don't use Win9x, you'd have to restart every 10 minutes once you get more into programming.
    Of course, if you start with VC++6 now there's a little bit of time you'll need to change from 6 to 7.

    Don't learn C++.NET ( = managed extensions for C++), it's quite useless. If you want to use the .NET framework C# is the way to go.

    To say it in one sentence:
    Pure C++ and pure WinAPI (the things you're going to learn first) are compiler- and IDE-independent, the code is the important thing.

    Database: I have used the mysql++ API to access a mysql database. This API was written for C++ and is very easy to use. The WinAPI provides functions to access any SQL compliant database, but those are C-style. DAO and ADO were written for VB - although it is possible they are quite tedious to use in C++ (I tried that once *shudder*) and all the documentation for them is written for VB, which you first have to translate. Not to mention they are rather slow.
    MFC provides you with wrapper classes for DAO which are (besides mysql++) the best C++ DB interface I've come across so far, but you should be very familiar with windows programming before you start MFC programming IMO.

    VC++7 also has something new, called the OLE Database templates. I haven't used them yet, but they seem quite good, though complicated.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  30. #30

    Thread Starter
    Hyperactive Member crosbj's Avatar
    Join Date
    Oct 2000
    Location
    Michigan
    Posts
    285
    Ok I think I have a pretty good idea of where to start. I think that ADO is available for C# probably the OLE providers you mentioned.

  31. #31
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    That's ADO.NET, part of the .NET framework.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  32. #32
    Addicted Member
    Join Date
    Oct 2002
    Posts
    241
    sorry if this is a bit of topic but, how much does visual studio .net cost?

  33. #33

  34. #34
    Addicted Member
    Join Date
    Oct 2002
    Posts
    241
    ouch

  35. #35
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    And I think those don't yet include license costs.

    I got VC++7 only Standard Edition (other companies would give out this version as free trial...) for about 100$, but I'm not sure if I may distribute the apps I write. I don't give a damn actually...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  36. #36
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394
    Dont be scared by database interfaces in C++. It is not extremely hard.

    Example:

    PHP Code:
    #import "C:\Program Files\Common Files\System\ADO\msado15.dll" \
        
    no_namespace rename("EOF""EndOfFile")

    //connect
            
    _RecordsetPtr pRc("ADODB.Recordset");
            
    _ConnectionPtr pCn("ADODB.Connection");
                
            
    //open connection
            
    pCn->Open(szDataRoot""""adConnectUnspecified);
            
    pRc->Open("SELECT * FROM hits"pCn.GetInterfacePtr(), adOpenKeysetadLockOptimisticadCmdText);
            
    FieldsPtr fld pRc->Fields;        

            
    pRc->AddNew();
            
    //add new items
            
    fld->Item["HitIP"]->Value  szIp;
            
    fld->Item["HitBrowser"]->Value  szUserAgent;
            
    fld->Item["HitSessionID"]->Value  szSessionID;
            
    fld->Item["HitReferer"]->Value  szReferer;
            
    fld->Item["HitPage"]->Value  szPage;
            
    pRc->Update();

            
    pRc->Close();
            
    pCn->Close(); 
    It is not as hard as it seems at first
    VS.NET 2003

    Need to email me?

  37. #37
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    the worse language the more you get paid
    thats why OOP gook works so well..
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  38. #38
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I think that's a special feature of VC++, asp. The #import directive is, and there are some parts in this code that don't work in normal C++ too.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

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