Ok...i know a little bit of C++ (basics, like cout, cin, a little bit of classes ect) and realized something after watching a video from Chris Pirrilo...


I dived into C++ without researching other languages first. My question to you is...should i stay w/ C++ or switch to C#? Can you give me some pros and cons of each language? What do you prefer? Do you recommend another language besides C++/C#?


Thank you,
EpicAsian

Recommended Answers

All 11 Replies

If you like programming like I do.. why not learn both..?

If you like programming like I do.. why not learn both..?

i would like to learn both...but later...i'm saying that this is my first real programming language, before trying to learn c++, i fiddled around w/ python...and that didn't get me far, so i quit for about a year and then wanted to do it again. what is a suggested first language?

c++

you can do a lot of lower level stuff.. like handle pointers and memory addresses.

c#

you can make a lot of gui controls quite easily.. contains a lot of the same general constructs you would see in c++ (loops and if/else logic for example)


if you are an algorithm and data structure type of hombre, then I would suggest c++. if ye' would like to make them fancy user friendly gui programs, then I would suggest c pound.

I know you're waffling between C# and C++, but I thought I'd throw this out for you.

I started on FreeBASIC, you can find it at www.freebasic.net. It works on DOS, Win, and *nix systems. I'm still very new to C++ myself, but I've managed to learn concepts in FB and subsequently transfer them to C++ fairly easily.

There are IDE's available for it, but be sure the version packaged with them is 0.20.0 or higher. If it's not, you'll have to download the compiler separate and upgrade it.

Be sure to download the appropriate documentation for your system too. I use Win, so I have the *.chm formatted file and I'm very happy with it.

c++

you can do a lot of lower level stuff.. like handle pointers and memory addresses.

c#

you can make a lot of gui controls quite easily.. contains a lot of the same general constructs you would see in c++ (loops and if/else logic for example)


if you are an algorithm and data structure type of hombre, then I would suggest c++. if ye' would like to make them fancy user friendly gui programs, then I would suggest c pound.

yea...once i hit pointers in the C++ book i was reading, i was like,
'what does this mean and how is this applicable to a program i could write?!'
i had and still have NO idea why pointers would be needed, even though i googled about 2 hours out of my life...still no answer lol

what programming languages do you know? jw and thanks,
EpicAsian

This is all my opinion, but I think pointers were big in C due to its heavy use of c-strings (character arrays). Also in C, it requires the use of pointers to allocate memory for certain data types.

I believe in c++ it is possible to do most of these things either by passing values by reference, or use of the keyword 'new' to allocate memory.

So, in modern day c++ one would not expect to see a whole bunch of pointers, but in my opinion they are often taught in c++ classes just so you know how to use them.. if you needed to use them.

This is all my opinion, but I think pointers were big in C due to its heavy use of c-strings (character arrays). Also in C, it requires the use of pointers to allocate memory for certain data types.

I believe in c++ it is possible to do most of these things either by passing values by reference, or use of the keyword 'new' to allocate memory.

So, in modern day c++ one would not expect to see a whole bunch of pointers, but in my opinion they are often taught in c++ classes just so you know how to use them.. if you needed to use them.

thanks...i kinda am starting to understand pointers now,

what programming languages do you know? which ones do you recommend?

Thanks again,
EpicAsian

pretty good at basic, qbasic, intel x86 assembly, and c++.

i know a little c, and a little java.

i've been studying c++ for years that's like the only thing I really know.. and i'm still learning, so I'm kinda biased.

C#, Python or similar languages are good for attaining goals in the short term, when I did Python, I did it for about a quarter of a year, then got bored. But now I have been doing C++ for almost 2 years and I haven't gotten bored of it at all, so C++ is what I would recommend. This is just my opinion, you might not get bored of Python or C#.

<snip>

I believe in c++ it is possible to do most of these things either by passing values by reference, or use of the keyword 'new' to allocate memory.

<snip>

The new keyword dynamically allocates memory, yes. But it then returns a pointer to the first address within the allocated block of memory. If you want to use the information stored in that area you need to use pointer operations on the variable the result was stored to.

Unless I've missed something somewhere....

For PC desktop programming I use PowerBASIC from www.powerbasic.com.

For Windows CE I use C++, mostly because I don't have much choice. For both languages I use pointers extensively; both in PowerBASIC and C++. They are critical; however, until you become fairly advanced their need pretty much is hard to understand.

My personal preference in programming is to write low level code that is fast and small. Both PowerBASIC and C/C++ allow me to do that. I code exactly the same in both languages and I use the Win32 Api directly. If I want to put text in an edit control in a GUI app in C++ it looks like this...

char szBuffer[64];
strcpy(szBuffer,"Some Text To Go In A Text Box.");
SetWindowText(hWnd, szBuffer);

in PowerBASIC it looks like this...

Local szBuffer As Asciiz*64
szBuffer="Some Text To Go In A Text Box."
SetWindowText(hWnd, szBuffer)

Not much difference. That is the advantage of coding to the Win32 Api directly. Of course, if you are interested in Linux/Unix the Win32 Api won't do you much good.

C++ is a really neat and interesting language. However, you really need to be patient in waiting for results. It is very hard to learn, in my opinion. I suspect a lot of folks give up before achieving their goals. In that sense I think many folks here would be better off with some language that gives quicker results such as various dialects of BASIC or .NET.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.