Results 1 to 28 of 28

Thread: What to do in VB and in C

  1. #1

    Thread Starter
    Banned
    Join Date
    Feb 2001
    Location
    Back to sh*tland
    Posts
    294

    Question

    Since I was ten that I'm acostumed to use basic language and Visual Basic. Now I have started to learn C and I see there are things similar and other diferent. I don't know what C can do that Visual Basic cant do.

    I suppose it's more "wise" to use C where Visual Basic fails. So, what should I try to learn better in C in order to use C language to complete VB?

    I'm not interested in doing things in C that can be also done in VB, I think it's a waste of time, no?

  2. #2
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    There aren't many until you get a good deep understandng of the language. In the beginning VB can make windows programs that C++ won't early on...but it will pay off later on

  3. #3
    Guest
    In the beginning VB can make windows programs that C++ won't
    C++ can make anything that VB can, faster and smaller. I think you were referring to the point that it takes longer to do the same thing in C++.

  4. #4
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    yeah thanks

  5. #5
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    It's not a waste of time using C to do stuff you could do in VB also. VB is slow and requires runtimes. VB is really just an abstraction from C, it is simpler but more clumsy.
    Harry.

    "From one thing, know ten thousand things."

  6. #6

    Thread Starter
    Banned
    Join Date
    Feb 2001
    Location
    Back to sh*tland
    Posts
    294
    What do you meen by clumsy?

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Erm...does about 2MB of runtime files count?
    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
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    VB generally uses more data and takes more execution time to do things that could be done in C.

    Using C you can write smaller, faster code to do the same thing. VB's runtimes contain lots of generic code that cater for all kinds of apps, most of which is unnecessary for an individual app. Another good example of superfluous code is the variant datatype. Variants are very large considering the amount of data they contain and I am sure there is a huge amount of code associated with accomodating different datatypes that goes with them. C doesn't have a variant datatype, but you could code one yourself if you wanted. It would be a lot of code but if you knew what you wanted then you could write a more efficient version for your particular requirements.

    I still think VB is very useful for what it does. I am more interested in games so I value the execution speed of C, the good support from graphics APIs and I don't much care about the fact it takes longer to write standard Windows apps since I make my own GUIs.

    Like a lot of things, it's horses for courses. If you're making a simple database app then there's probably not much point in using C to do it. If you're trying to find the value of Pi to a billion decimal places... well then you'd probably skip C and go for ASM. If you wanted to make Quake N then you would probably use C or C++. Well actually if you were making Quake N then you'd be an iD employee, so you'd definitely use C (maybe C++, I know Quake was written in C) and OpenGL
    Harry.

    "From one thing, know ten thousand things."

  9. #9

    Thread Starter
    Banned
    Join Date
    Feb 2001
    Location
    Back to sh*tland
    Posts
    294
    I know the runtimes detail. It is frustrating making a 90 Kb program and need to distribute a 2Mb file with it. Bah...

    So that's a really motivating reason to learn C. I have started to learn it some weeks ago. I think I like it. It seems more... mathematical, am I wrong?

    Talking about Quake -> 3D -> perspective

    Is there a game with an angle of vision of 360º (horizontaly and verticaly)?
    I'm studying by my own the idea of perspective in order to make something like that. No need to be a game, but just to see things diferently. Is there any thing like that?

    And thank you HarryW

  10. #10
    Guest
    In C, you have a lot more control over what you're doing as well. In VB, we deal with events indirectly, and after they occur. In C, we deal with it directly through the window procedure.

    I'm not sure if C is more mathematical, because calculations are the same in any language:

    BASIC:
    A = (A Or B) + 5

    C:
    A = (A | B) + 5

    Pascal:
    A := (A or B) + 5

    ASM: (I think this is right)
    mov ax, (ax or bx)
    add ax, 5


    A=(A Or B) + 5 is the same calculation in each language. Maybe the symbols can be a bit foriegn, i.e:
    Or = | (Bitwise) || (logical), but for the most part I believe it's the same.

  11. #11
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    No problem You should be able to make a scene with a 360 degree field of view, but it would look very odd. I'm not sure how you would define your view frustrum for such a situation though.
    Harry.

    "From one thing, know ten thousand things."

  12. #12
    Addicted Member substring's Avatar
    Join Date
    Feb 2001
    Posts
    148

    Smile

    Goodreams,

    I like to point out another angle...

    "classic" VB is going to be replaced by VB.NET and it is going to be very different. My prediction is that, by next year, there will not be a whole lot of new development in VB6, if not all gone. All left will be maintenance work and conversion.

    On the other hand, M$ is touting the brand new C#. Both C# and the "red hot" Java are very "C++ like". So do you get the picture?
    substring.

    VB6, C++, SQL, HTML, XML, ASP

  13. #13
    Guest
    Correct me if I'm wrong, but is VB.NET going to be more C oriented?

  14. #14
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    what does C# code look like?

  15. #15

    Thread Starter
    Banned
    Join Date
    Feb 2001
    Location
    Back to sh*tland
    Posts
    294

    Thumbs up

    I don't know if got it or not, but I did make an opinion in these weeks.

    For me, Basic was a marvelous thing when I started programming in QBasic. But, time passed, things were learned and I realised that Basic didn't fulfill my needs. It was good when I was a kid and that's it.
    It's more a human kind of language than a computer one. When I tell the computer what to do, I don't know what does it do. It seems to me that it does a lot of dirty work for me, to make me things easier, but I prefer to do it myself in order to 'see it'.

    Maybe I'm not making myself clear, so let's put things easier: I don't intend to make databases or simple programs, it's not my type. I want to go deeper or higher dependind on the point of view. My goal isn't being a high programmer. Programs are always tools and I want good tools for science and math.

    If you want your kids to learn programming, give them VB .net or .something, it will be always Basic.

    I said all this stuff, but the only thing I know to do in C is a Hello World program. Well, more a couple of things also...

    I hope I have chosen the right path.

    David

  16. #16
    Addicted Member substring's Avatar
    Join Date
    Feb 2001
    Posts
    148

    Smile

    SteveCRM,

    C# is very much C++ like in syntax. First thing you will notice are all the good 'ole curly braces. Its primary purpose, IMHO, is to combat Java, which is also C++ like. As a matter of fact, Java was partially created with C.

    Anyway, my point is that, if you have not learned VB6 by now, don't bother. People are already referring it as the "classic" VB. VB.NET is very different from VB6. Many people are questioning whether Microsoft should call it Visual BASIC.

    The .NET platform is going to abandon DLLs, and COM will be replaced by COM+ which is going to accept any kind of language and translate them into C#. It is pretty sure that all the VC++ people are going to switch (either voluntary or involuntary) to C#.

    Most of the new development next year are going to be in VB.NET or C#. It will be a great pain to migrate the VB6 application to the .NET platform, despite Microsoft promises a migration tool (I know because I got burn by Microsoft on that before). And don't expect the VB6 apps to be able to run on the 64bit Windows XP.

    Yes, of course not every company will switch to the .NET platform, but hey, some people are still using VB5 and Windows 95 for crying out loud, but I sure don't want to use them, do you?

    Goodreams, by the time I have a kid, I don't think VB will still be around anymore, ha. But even though it is, I rather my kid to learn C++ first. VB does a lot of things for you and it could be bad if you don't have a strong programming foundation. It can create sloppy programmers easily (yes I know because I have seen many of them). Learning C++ first make you a better programmer. And furthermore, if you truly understand C++, all these Java or C# or whatever comes along will be like childplay. You can pick them up easily.

    The programming landscape is going to change drastically in the next two years. Right now, nobody knows what language will come out ahead. That makes C++ is the safest bet.

    Just my 2 cents. Happy programming.
    substring.

    VB6, C++, SQL, HTML, XML, ASP

  17. #17
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    So, do you think Microsoft is going to be able to kill Java? I sure hope not...

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  18. #18
    Addicted Member substring's Avatar
    Join Date
    Feb 2001
    Posts
    148

    Smile

    sail,

    It is way too early to say because .NET is still in Beta 1. BY the time it is actually released, it might be very different from the Beta version.

    Java has its flaw. But it "grows up" a lot since the first version. And of course, thanks to all the tools like Forte and J2EE, it is gaining popularity. But Java still has a long way to go. Right now it is primarily used on the server side. It still has the I/O speed issue and the huge system/resource requirement problem.

    Microsoft's success depends mainly on its powerful marketing muscle and the humongous developer base. Keep in mind that the single most important asset to a software company is the pool of developers that use your technologies. Microsoft is so successful solely because they gain the all-important "Mind Share" of the developers.

    But since Java has already gain some solid ground among developers, it is very hard for Microsoft to "kill" it. But again, nobody can predict what is going to happen in the next two years.
    substring.

    VB6, C++, SQL, HTML, XML, ASP

  19. #19
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    I don't see C# as a substitute for C or C++ (both C and C++ are still used after all). C# is abstracted to a much greater level, just like Java (unsurprisingly), than C and C++. For performance programming, which is not a huge market but not a small one either, I think C++ is here to stay for a good few years yet.

    I haven't tried VB.NET so I can't really comment on it.

    I don't think M$ will be able to kill Java, or at least not easily. Much of the internet runs on non-M$ platforms, and AFAIK C# isn't going to be platform independant. Am I wrong?
    Harry.

    "From one thing, know ten thousand things."

  20. #20
    Addicted Member substring's Avatar
    Join Date
    Feb 2001
    Posts
    148

    Cool

    Harry,

    You are absolutely correct that C# will not replace C/C++, because C# is a high level language. It will *try* to replace VB and Java which are of the same level.

    "Microsoft" and "platform-independant" are two mutually exclusive terms, haha. Even though Microsoft claims the .NET is platform-independant, but it will be like shooting their own feet if it is true. They will never do anything to jeopadize their dominance on the OS.

    And C++ is still the king of all programming languages. Think about that, why do you think Java and C# have to "copy" C++?
    substring.

    VB6, C++, SQL, HTML, XML, ASP

  21. #21
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    So java and VB are of the same level? I always thought that Java was a much lower level programming language than VB.

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  22. #22
    PowerPoster sail3005's Avatar
    Join Date
    Oct 2000
    Location
    Chicago, IL, USA
    Posts
    2,340
    java, at least in my experience seems much faster.

    I know that doesn't have to do exactly with the lewel i don't think, but...

    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
    USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA

  23. #23
    Addicted Member substring's Avatar
    Join Date
    Feb 2001
    Posts
    148

    Cool

    Hmm, I think Java is slow because it requires translation... the down-side of being platform independant.
    substring.

    VB6, C++, SQL, HTML, XML, ASP

  24. #24
    New Member Mega Muffin's Avatar
    Join Date
    Mar 2001
    Location
    In a pear tree
    Posts
    10
    One question...if exe's are all machine code, how can a compiled VB and compiled C++ app be different? Maybe there is still more than 1 way to skin a cat, but why would MS write machine code twice, one that is slower. Makes no sense.
    Mega Muffin will rise again

  25. #25
    Guest
    VB is not true machine code. It needs the VB Runtimes to translate the language into machine code.

  26. #26
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Some of VB is still interpreted although most of it is compiled now.

    Java code is actually not necessarily that slow. Although the bytecode needs to be interpreted by a virtual machine, the dynamic nature of the bytecode way of doing things means that environmentally-aware compiler optimisations can be used, things which could not be done with statically compiled code.

    The biggest bottleneck in Java is method invokations, but the JVM can inline these at runtime if it helps to optimise the code. Java is actually faster than straight C in certain circumstances, although I wouldn't choose it for performance programming in general.
    Harry.

    "From one thing, know ten thousand things."

  27. #27
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Note that when I said 'Java is faster in certain situations', that is only true if the JVM is using the right optimisations.
    Harry.

    "From one thing, know ten thousand things."

  28. #28
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Such as HotSpot.
    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

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