Help - Search - Members - Calendar
Full Version: Is it worth it to learn C/C++
Pixel2Life Forum > Help Section > Desktop Programming
zingyGecko
Is it worth it to learn C/C++? I enjoy making programs and stuff in VB6, and I've been wondering lately if I should switch over. I know the basics of C; like I can make a command-line app with if/then statements and while/for loops, etc. But from what I've seen, just to make a simple window with some text takes a ton of code. In VB you basically... click and you have a form. I also like how in VB6, when typing a function, like MsgBox, it'll remind you what arguments it takes. Are there IDE's for C that work like this?
Another thing is: I see people asking VB questions all the time, like "How do you do an API call" and stuff, but never a question like that for C++. Once you have it down is it easy to figure out that stuff? And how the hell do people memorize all this stuff! Like making a winsock, or a window with a label! It doesn't seem humanely possible, with all those lines of code.

So I guess to sum it up: What I want to know is: Is there any reason to use C or C++ over VB6 or another high-level language? And if so, is OOP really needed, or is it safe to just stick with C rather than C++. And lastly, how do they do it (memorization, or help from IDE, etc.)!?

edit: oh yeah, and could someone explain to me how pointers are useful, and maybe show a VB6 example where a pointer could make things easier (even though I'm sure vb6 has no pointers).
Net-Margin
I won't pretend to have any knowledge on the C language as I have am literally still working on learning the basics in C++ but I have a fair bit of Visual Basic .NET 2005 experience.

C++ is basically a more complex and 'better' language which is supposedly a faster compiler and more of the bigger programs you see for windows are coded in C++ like mIRC and I think Mozilla Firefox is based something around C++, but don't hold me to that.

The IDE that are commonly used are DevC++ and Visual C++, I don't know if they are cross-OS compatible as I use Windows & Linux and program on Linux as I use Microsoft Visual C++.

I think in C++ people use the WinAPI or something but I cannot and will not go into detail on that as it's difficult for me as I have no grasp on any experience in the language, while Visual Basic use API's for MSN to create their own Bots or Clients.

I'm not sure about Databases in C++ like SQL Server 2005 in Visual Basic 2005 but you may be able to use that.

If you use the Microsoft version of C++ there are beginner video tutorials for free from LearnVisualStudio.net and they're brilliant, they will lead you through the basic properties and OOP, it will tell you about Database structuring in C++ and how to use it for general things.

I would personally learn it as it's a good saught after language. Good luck.
Anarkial
I personally feel that C is a better language to start with, mainly because it's more basic, and will force you to create cleaner programs. OOPs take a long time to run through, especially in math programs, so starting with those can create bad programming habits.
Net-Margin
QUOTE(Anarkial @ Oct 10 2006, 06:25 AM) *
I personally feel that C is a better language to start with, mainly because it's more basic, and will force you to create cleaner programs. OOPs take a long time to run through, especially in math programs, so starting with those can create bad programming habits.


I haven't learnt C but many people believe that for an easier programming option then you should learn PASCAL, I have never used it. Never even created the Hello World script with it but it's supposed to be easy.

C++ is a powerful language and I think it's brilliant, but I can't get the grasp of it with being a continuous Visual Basic .NET 2005 programmer.
Wybe
No, it isn't.
joe
I learn C++ now and i'm so glad to learn it.....
Coz, benefit to learn C++ is cross platform.... and VB only can run under Windows... sad.gif sad.gif

about pointer, you can find it in : www.cprogramming.com

Cheerrsss....
Boom_
C++ is industry standard, should you want a career in programming, you'll more then likely need to know some C, c sharp or plus plus unless your into web development.

I personally think its an outstanding language and with myself using basic for such a long time, I now see the power I been missing out on. The benefits outweigh the difficulty.

Also I use Dev-C++ but on the subject of GUI's, doesnt microsoft's C sharp give you the option to making easy interfaces.
Scabies
i like c++ better i think delphi is easy to work with and well set up not too big of a fan of vb
Jynxis
Im learning C++ right now, and to be honest, although its a real pain, its quite fun to learn.
MetalSkin
The biggest problem with C++ is that it allows you to do sloppy coding ala C style. There is no memory management (which causes the dreaded memory leak that you may see mentioned) and the ability to have buffer overflows is a never ending problem.

Why do you wish to learn another language? What are your goals? What platforms do you wish to program on and do you wish to write games, write business software, program portable devices, contribute to open source projects, do some neat stuff on windows or on a linux GUI front end, etc... the list is endless but where you wish to go will have a big impact on what to learn.

Btw, C is useful but only if your writing very low level stuff. Admittedly the standard SDK for Gnome is in C while the competition is C++. But for Windows development C# is the standard. For the latest version of Pocket PC you cannot develop in C or C++ but you have to use C# (plus maybe a few other options that I'm not familiar with).
awesty
I have just started learning C# and I recommend learning that instead of C++. It is slower, but it is so much easier.
Mezzo
QUOTE(MetalSkin @ Jun 25 2007, 06:17 AM) *
Btw, C is useful but only if your writing very low level stuff. Admittedly the standard SDK for Gnome is in C while the competition is C++. But for Windows development C# is the standard. For the latest version of Pocket PC you cannot develop in C or C++ but you have to use C# (plus maybe a few other options that I'm not familiar with).


I totally disagree with the very low level stuff. While you cannot program GUI's using C (you can with C++). C is extremely useful for backend apps. This past year I've written a mouse/keyboard driver, a backend GPS program, and a game entirely in C.

I would totally advise learning C and C++. C will teach you memory management skills, good programming practices and help you get a solid understanding of the basics for other languages (Java, C#). C++ is great for OO programming.

The other good thing about both languages is that their not OS specific like VB, C# or any .NET applications. This means you can port your programs to Unix, OSX or Windows (with little to no changes to your code).

That being said I would also advise learning Java since it's being used more and more in the industry and will rpobably be the standard really soon.
MetalSkin
QUOTE(Mezzo @ Jul 11 2007, 01:46 AM) *
I totally disagree with the very low level stuff. While you cannot program GUI's using C (you can with C++). C is extremely useful for backend apps. This past year I've written a mouse/keyboard driver, a backend GPS program, and a game entirely in C.


Well I would have said that a driver and a backend GPS program is all low level. Sure you can write an entire app in C, but why would you? Most modern games are written via scripting languages, a fair few of them now use C# as their scripting language or they have developed their own. The back end high performance stuff is written in a combination of C and C++, but the front end is normally via another language.

Also if you write for Gnome then you will write in C. Gnome is C based, sure there is a C++ SDK for Gnome but most people write for Gnome using C. So that is the main exception to C being low level. So you can write a GUI app with C, but as far as I am aware only Gnome is focused on C. Windows it would be C# and possibly C++, Windows Mobile is C# only (correct me if I'm wrong). Unix is mainly C, though front end will be C or C++ depending on which front end you use. I don't know about OSX.

But at the end of the day it is a question of what you want to do. C/C++ is fine for low level and some GUI programming, and by low level I mean drivers, back end integration with hardware, etc, but for business programming it is close to useless.

QUOTE(Mezzo @ Jul 11 2007, 01:46 AM) *
I would totally advise learning C and C++. C will teach you memory management skills, good programming practices and help you get a solid understanding of the basics for other languages (Java, C#). C++ is great for OO programming.


Well C++ may help you with Java and C# but C would help you as much as Javascript would. C doesn't enforce good programming practices, and I would argue that C++ is better than C in this regard, but still allows for slack programming practices. C# and Java both enforce stronger programming practices and are better for learning OO programming.

QUOTE(Mezzo @ Jul 11 2007, 01:46 AM) *
The other good thing about both languages is that their not OS specific like VB, C# or any .NET applications. This means you can port your programs to Unix, OSX or Windows (with little to no changes to your code).


Sorry mate but that just isn't true. C and C++ are compiled for a platform and you use SDK's available for that platform. For windows you use the Windows SDK's for gui development. The low level stuff is all different between platforms, etc. Unless you purposely write for a cross platform SDK then there is a lot of work to get an application running on OSX, Linux and Windows. From what I have heard the cross platform SDK's aren't all that perfect either. It is not a trivial task and requires a lot of effort when compared to Java.

Anyway, all said I have always enjoyed programming in C++, it's a language I enjoy that gives you all the power you need to get the job done, which Java, C# and the like take away from you (for a good reason). So if you just wish to learn programming for fun, then C and C++ are quite okay. Just don't expect to make a career from it.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.