Quantcast

Jump to content

» «
Photo

Is C better than vb

30 replies to this topic
Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#1

Posted 17 September 2011 - 04:55 AM

If I want to be a better programmer (especially on the gaming area) with a better job should I completely ditch VB and learn C++ or C#? I hear today's games are relying upon C# and Javascript (unity,XNA and other bla bla bla). So what are you thoughts? I have recently started learning C++ and it is a whole lot of different than VB and I had to learn right from the beginning.

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#2

Posted 17 September 2011 - 05:07 AM

Learn C. Then C++. You can switch to C# over from C++ rather painlessly later on if the job calls for it. Though, it helps a lot of if you also learn Java, since it shares a lot of design philosophy with C#. (Not JavaScript. That's fairly useless, and if you know how to program, you know how to program in JavaScript anyways.)

But anyways, ditch VB, learn C. If you want to be a good programmer, rather than just a code monkey with bottom tier salary, you'll also need to know a few things about Assembly. You don't necessarily need to learn how to program in Assembly, but you need to know how it works to understand C. And if you don't understand C, you won't understand any higher level languages either.

I started learning programming with BASIC, so naturally, I spent some time with VB. Time completely wasted. Yes, I learned many programming techniques, but I also picked up a few bad ones. Starting out with C would have saved me some time.


Old C++ compilers used to compile C++ code into C code, that C code would be compiled into Assembly, Assembly would be assembled into binary "objects", and only these would be linked into executable. In order to be a good programmer you need to understand every step along this chain. You need to be able to look at C++ code and know how you'd write that in pure C. To take a snippet of C and expand it into Assembly code. Assembly to binary isn't as critical. There you just need to have a general idea of what sort of instructions will be generated.

If you understand how this works with C++, you will easily understand how any other object oriented procedural language generates code. Knowing that is important if you are going to write anything worth crap, and that's the only way you are going to land a descent job, be it writing C# code for XNA, writing quality engines in C++, or going back to VB to work on some business software. Regardless of where you'll go with all of this, you have to start with C.

Edit: They really need to handle post queries made after topic has been moved better.

nightwalker83
  • nightwalker83

    Don't mind me

  • Members
  • Joined: 10 Oct 2004

#3

Posted 17 September 2011 - 05:14 AM

QUOTE (K^2 @ Saturday, Sep 17 2011, 15:37)
You can switch to C# over from C++ rather painlessly later on if the job calls for it.

How? Is it possible if you don't know c++.

@Swoorup,

Ditch VB it is a basic language if you really won't to be a developer you shouldn't use it. The only time I would use it is if I wrote a program in VB6 and needed to convert it to .NET. Since there isn't much difference (language wise) between VB6 and .NET rewrite the vb6 code/program in .NET then it is easy to convert to any other .NET language.

Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#4

Posted 17 September 2011 - 05:16 AM Edited by Swoorup, 17 September 2011 - 05:20 AM.

Ok thank you sir. I have searched the internet for company making VB 3d game programming and the result = none. But why are my colleges, also most of them teaching VB if its a bad practice. Is it pathway to world of programming?

Ok I would start out with C. But I find it very hard to even understand a bit of assembly language. Can you recommend me a book or software that can help me learn it?
Also sir in what aspect C is different from C++?

@Nightwalker I know both of them. I did extensive research on looking for the same functions for both VBs. But I think I have to quit them now.

@K2 How should I start sir
i) C
ii) Assembly
iii) C++ ??
Should I master in each of them?

nightwalker83
  • nightwalker83

    Don't mind me

  • Members
  • Joined: 10 Oct 2004

#5

Posted 17 September 2011 - 05:22 AM

Well VB takes the hassle, fun of coding and it make it easier to teach. Frm what I understand C# is based on C++ so it requires more understanding of what is happening and why.

Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#6

Posted 17 September 2011 - 05:38 AM

C looks very hard to understand too. Any suggestion about books or software to teach those interactively?

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#7

Posted 17 September 2011 - 06:22 AM

QUOTE (Swoorup @ Saturday, Sep 17 2011, 01:16)
@K2 How should I start sir
i) C
ii) Assembly
iii) C++ ??
Should I master in each of them?

You need to master C++. Starting with C++ is an option, but in my experience, people who learn C first are better at C++ later on, so it's better if you start with C. Don't expect to understand all of it right away, and it's not a requirement to start learning C++. But you need to know all of the basics. Nothing you learn in C will be a waste when you switch over, so don't worry about that. Most C programs can be compiled in C++ just like that.

Most texts and courses on C follow a fairly standard order of things. Once you learn binary trees in C, that's a good place to start learning C++. By that point, you would have learned structures, and that's a good introduction to C++ classes. You'll see later that a class is basically a structure with a namespace and some special inheritance rules.

Assembly, you just need to have the basic understanding in. You don't even need to actually do any programming in Assembly, unless you are planning to work engine optimization in the future. If you like it, though, by all means go ahead and learn it. What you need to understand is what happens in the processor when you call a function (subroutine), and how memory is allocated in different situations. Learning a little bit of Assembly is the best way to go about it.

So as far as starting, get a textbook for learning C. Unfortunately, I'm not the best person to recommend anything in particular. I learned C very long time ago. If you have an option to take a course, it's even better. Most courses teach C++. If it's between learning C on your own and starting with C++ in a course, later is better. But in that case, at least look through a C textbook so that you know what the differences are.


As far as VB goes, universities teach it because they get a lower rate of people dropping out from VB course than C/C++ course. VB is far more forgiving of rookie mistakes, and getting code to run on it is not as frustrating for beginners. For universities, this means that teaching VB is more profitable. Fact that your skills are less valuable afterwards is of little concern to them. That is an unfortunate reality of curriculum in all but the top universities. If you want to learn something useful, you'll always have to go beyond and above what the program teaches.

QUOTE (nightwalker83)
How? Is it possible if you don't know c++.

You mean, is it possible to learn C# without learning C++? Of course. The problem is that if you learn C#, you know C#, and switching to C++ will be a pain, because a lot of things just won't make sense. There are a lot of shortcuts built right into C# language which aren't there in C++. Some of them make your life easier, but they always come at a cost of not knowing what your program is really doing. If you just jump into C++ from C#, you don't know how to do without these shortcuts.

If you go from C++ to C#, you already know all the basics. Sure, like with any language, you will still have to learn all the nuances before you are truly proficient, but there'll be a lot fewer things you'd need to re-learn when going from C++ to C# as opposed to going from C# to C++.

There are some people who advocate learning only C# because you'll never need anything else, but that simply isn't true. C# has its uses, but they are limited. If you stick to C#, you'll be limiting yourself just the same. If you learn C++, you'll be able to switch over to C# or Java development if necessary. Learning C++ gives you the highest number of employment opportunities, so it's definitely the best language to invest time in.


It's also important to explore other languages along the way. A good programmer knows at least one esoteric language. And if you plan to work in AI, you absolutely must learn Prolog. That one's a brain-twister.

Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#8

Posted 17 September 2011 - 06:45 AM

Thank you sir. Your saying is really informative and clearly understandable. I just downloaded CodeBlock as I have read many of your post and I heard about it from there. I will begin to learn ASM in the later phase of my study. Right I will start right out with C and then join an institute that teaches cpp.

It really makes sense now why the colleges are on to VB now.

And lastly again thanks, I will stick to your points

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#9

Posted 17 September 2011 - 07:05 AM

Hmm... That's another difficult topic. IDE definitely helps when you are working on a large project. It might be worth your time to learn how to compile from command line without an IDE, but you can do that later, when you are a bit more comfortable with the language. To start you out, you need compilation process to be as painless as possible. I've heard good things about CodeBlocks, but I don't know how it is as far as beginner-friendliness. If you'll have difficulties with it, you might also try Dev-C++. It's very beginner-friendly, despite its many faults.

At some point, if you plan to work in game development, you'll need to learn Visual C++ IDE. It's a beast. Some things will be familiar from VB, but a lot of things are specific to C++. There are pages and pages of settings, and you'll need to know what a lot of them mean. You can get an Express edition of VC++ for free. It might not be your-first-program-in-C sort of thing, but you definitely need to learn how to work with it early on.

Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#10

Posted 17 September 2011 - 07:14 AM

I already have VS 2010 installed but I am confused with so many options available on the new project, I dont know which one should I start out with. I am willing to learn them definately in my later part.

Ok so how do i compile it through cmd?

So which is the best compiler out there? Should i use the compiler that came with dev c?

EDIT: WIll it be fruitful to learn c along with GBA programming? I think it will be interesting tok

nightwalker83
  • nightwalker83

    Don't mind me

  • Members
  • Joined: 10 Oct 2004

#11

Posted 17 September 2011 - 08:07 AM

QUOTE (K^2 @ Saturday, Sep 17 2011, 16:52)
You mean, is it possible to learn C# without learning C++? Of course.

LOL! No, I meant converting from C++ to C#. I consider myself knowledgeable of C# but I don't know how to code in C++.

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#12

Posted 17 September 2011 - 08:19 AM

Like I said, it works well from C++ to C#, but not in reverse.

nightwalker83
  • nightwalker83

    Don't mind me

  • Members
  • Joined: 10 Oct 2004

#13

Posted 17 September 2011 - 08:45 AM

QUOTE (K^2 @ Saturday, Sep 17 2011, 16:52)
There are some people who advocate learning only C# because you'll never need anything else, but that simply isn't true. C# has its uses, but they are limited. If you stick to C#, you'll be limiting yourself just the same. If you learn C++, you'll be able to switch over to C# or Java development if necessary. Learning C++ gives you the highest number of employment opportunities, so it's definitely the best language to invest time in.

Sadly, that seems to be the way software development is going! Microsoft, etc are moving away of developing programs to interact with hardware and are just concentrating on levels 5, 6 and 7 rather than 2, 3 and 4 (which, if I remember correctly are the hardware layers). I have ask my friend where he got the diagram he showed me with the levels on it.

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#14

Posted 17 September 2011 - 09:09 AM

Microsoft isn't always doing what they should be doing, and they'll have to make a lot of hard decisions later on because of it. XNA is... Well, it's a lot of good intentions, and we know how that goes.

The fact is, there is a serious dilemma. Modern programs are so complex that you cannot write them in low-level language, and so hardware-intensive that you can't write them in a high-level language. You either make a clusterf*ck that's full of bugs, or something that's so bloated it can barely run on high-end machines. Or both.

C# attempts to address that, but does so clumsily. Far better solutions have been floating around for a while. The idea is simple. Take a high-level scripting language, like Python, and use it to string together a bunch of low-level code written in C. You get all the benefits of garbage collection, simple debugging, and easy-to-read code on the top-level, while getting all the performance on the low level.

I've worked a bit with the guys who are building the Grit Engine, and I really liked working with it. It uses Bullet physics engine (C++), Ogre (C++), and Lua ( C ). Some additional custom code to handle numerical computations for physics and rendering is written in C++. All of this is held together with Lua scripts. And it runs damn well.

Basically, what I'm saying, is that you shouldn't be trying to make a Swiss army knife of programming languages. It's not necessary. Cross-language developments show us that there are much better ways to address diversity of requirements for different parts of the engine. Right now, you really can't beat C/Assembly combo for low level stuff. C++ is absolutely fantastic for intermediate wrappers. Number of good options exist for high level functionality. C# is not going to do better in all these areas at once.

The reason I'm not more aggressive against C# and XNA is because I've seen what it can do for indy gaming. Small teams that do not have resources to have several people working on each component of an engine, working in completely different development environments can definitely benefit from XNA platform and C#. For them, C# is a fantastic solution that lets one programmer take care of their high and low level stuff without slowing the code down too much, while XNA provides a number of prefabs to make physics and graphics portions entirely manageable.

nightwalker83
  • nightwalker83

    Don't mind me

  • Members
  • Joined: 10 Oct 2004

#15

Posted 17 September 2011 - 11:43 AM

Maybe Microsoft could come up with a cross between c++ and c#? Yeah c## as my dad put it. biggrin.gif

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#16

Posted 17 September 2011 - 02:28 PM

The only use of C# is that it's a cross of a high and low level languages. Diluting it further would defeat the very purpose. The problem is that it's realistically not needed. Assembly, C, and C++ fill out the low and mid-level niches perfectly. No reason to mess with that. What could be of some use are better high-level alternatives. Languages like Python are too rigid, and languages like Prolog are too obscure for most tasks. But I really don't think that sort of thing will come from Microsoft originally.

Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#17

Posted 17 September 2011 - 02:37 PM

Yes, I understand K^2's point here. Microsofts tends to make the solution of the problem easy for every people. Its like asking a microsoft for linux type OS. Am i right? Microsoft aims to make their software usable and understandable for everyone. So just dont expect it!

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#18

Posted 17 September 2011 - 02:45 PM

It's not really that. It's just that development of a completely new language is not terribly marketable. Making a development platform is. C# isn't innovative. It's an amalgam of existing ideas to fit the platform that Microsoft was pitching. If a new language is developed, and it is successful, I'm sure Microsoft will develop a platform either around that language or some variation of it. They just won't be the ones to develop a completely new language to begin with.

Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#19

Posted 17 September 2011 - 03:30 PM

So whatever they develop is based around a certain language heavily? I want to ask questions. Are most programming languages like Delphi, Pascal python coded in C?

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#20

Posted 17 September 2011 - 04:30 PM

You don't code a language. You code either a compiler or an interpreter, and you generally can write a compiler/interpreter for any language in any other language, as long as both languages are general-purpose languages. So I could write a C compiler in Python if I really felt like it. In fact, I'd be surprised if somebody haven't tried just that. And then compiled CPython under a Python C compiler script running on CPython. suicidal.gif

The distinction between interpreters and compilers is important. A compiler will produce code to be executed by processor later, while interpreter executes commands as it encounters them. There are also crazy hybrids, like Java. Java program is first compiled into bytecode, which is later interpreted by Java Virtual Machine on target platform. This allows compiled Java code to run cross-platform, so long as the platform has JVM running on it.

As far as writing compilers and interpreters, C tends to be the language of choice, sometimes with heavy use of Assembly. Very few modern programs are written entirely in Assembly, but early compilers obviously had to be. For interpreters, Java is also pretty common, because it allows for the same interpreter to run on different platforms utilizing JVM. Of course, that is very inefficient. A Python script running under JPython that's running on a JVM, that's running under some OS on some physical processor should not be used for heavy computations. But sometimes, computational efficiency isn't what you are looking for in a program.

nightwalker83
  • nightwalker83

    Don't mind me

  • Members
  • Joined: 10 Oct 2004

#21

Posted 18 September 2011 - 12:52 AM

QUOTE (K^2 @ Sunday, Sep 18 2011, 00:58)
The only use of C# is that it's a cross of a high and low level languages. Diluting it further would defeat the very purpose. The problem is that it's realistically not needed. Assembly, C, and C++ fill out the low and mid-level niches perfectly. No reason to mess with that. What could be of some use are better high-level alternatives. Languages like Python are too rigid, and languages like Prolog are too obscure for most tasks. But I really don't think that sort of thing will come from Microsoft originally.

Although, just using C# would mean you only have that concentrate on that rather than try and juggle two or three different languages at the same time. However, for learning purposes C# and other Microsoft languages don't allow as much as the open source stuff such as Java (yes, I am learning Java too). I just don't like having to learn multiple languages it becomes too confuses for me.

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#22

Posted 18 September 2011 - 01:20 AM

That's the reason C# actually turned out to be great for some independent gaming projects. For small teams, with just one or two programmers that have to juggle all the code, having multiple modules across several different languages just isn't an option. For a large project, this just isn't an issue. You'll have different programmers specializing in different languages.

Java is a good language to learn, certainly. It's also great if you want to work on mobile applications. Or if you are Notch, apparently. But for PC/console gaming it's not the way to go.

In any case, the more languages you learn, the easier it will be to pick up new ones. At some point, it's not even a matter of whether or not you know the language. Give me a manual and a few days, and I'll be an expert in whatever the project calls for.

Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#23

Posted 21 September 2011 - 05:07 AM

I have already started learning C in the free, but the progress is going slow, I am covering up all the things covered in Cprogramming.com site. I practice making programs in C that I used to be taught in VB in old school days.

From what I hear these days from most my friends that IT recession is going low, so there is high demand of IT professionals. I agree with what they said but I want know will it be again ups and downs in the IT field in the near future? How is IT career stable

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#24

Posted 21 September 2011 - 09:20 AM

I really don't know about IT in general, but game development is pretty stable, like most entertainment industries. The focus shifts more from high risk to low risk projects, which means you might end up working on less interesting games, but you should be able to find a job even when economy is on the decline. The need for entertainment is greater, if anything, when things are bad economically. At least, that's what I'm counting on.

Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#25

Posted 23 September 2011 - 12:53 PM

I think even if the industry is down, I think the salary is the same with little ups and downs.

nightwalker83
  • nightwalker83

    Don't mind me

  • Members
  • Joined: 10 Oct 2004

#26

Posted 06 October 2011 - 08:25 AM

QUOTE (Swoorup @ Friday, Sep 23 2011, 23:23)
I think even if the industry is down, I think the salary is the same with little ups and downs.

The differences in both languages aren't that significant anyway! There are companies that have developed software that will convert between the two languages.

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#27

Posted 06 October 2011 - 09:10 AM

Depends on what you're writing. In general, you can compile from any language to any other. But it always comes at cost of performance hits. If you writing a game engine, that matters.

Swoorup
  • Swoorup

    innovator

  • Members
  • Joined: 28 Oct 2008

#28

Posted 06 October 2011 - 12:53 PM

Seems that these days language does not matter and more programmers are sell-able?

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#29

Posted 06 October 2011 - 01:11 PM

The main thing is that any language has to become instructions to CPU at some point. To really understand a language, you need to understand what these instructions are going to be. And once you have that, any other language quickly falls into place. Once you picked up 2-3 languages and you know them well, then you basically know them all. At least the mainstream ones. Esoteric languages can be, well, esoteric.

RajuGrewal
  • RajuGrewal

    Raju Grewal

  • Members
  • Joined: 11 Nov 2011
  • United-States

#30

Posted 28 November 2011 - 02:08 PM

QUOTE (Swoorup @ Saturday, Sep 17 2011, 04:55)
If I want to be a better programmer (especially on the gaming area) with a better job should I completely ditch VB and learn C++ or C#? I hear today's games are relying upon C# and Javascript (unity,XNA and other bla bla bla). So what are you thoughts? I have recently started learning C++ and it is a whole lot of different than VB and I had to learn right from the beginning.

#include <stdio.h>

int main(void)
{
printf("RIP, Dennis Ritchie.\n");
return 0;
}


This program in in c not in c++ smile.gif

You can write this in c++ like this..

#include<iostream.h>
int main(void)
{
cout<<"RIP, Dennis Ritchie."<<endl;
return 0;
}

or like this also

#include<iostream.h>
void main()
{
cout<<"RIP, Dennis Ritchie."<<endl;
}


smile.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users