Newbie question about different languages and what they can do (mainly C++)

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Newbie question about different languages and what they can do (mainly C++)

Hey

I have been testing different languages for a while now. I have
built up a good amount of knowledge in web page design (nothingtoo fancy though) and I have tried some C++. I am in high
school and I want to learn a language that I can use as a base. I have read that C++ is the language to learn because you can
adapt from it to whatever language your company uses. I know
some of the basic (Functions and Classes...) but it seems to be
a completely console programing language? When I was trying
Android development, it used Java in the background and used XML for the display. Would I be right in saying that C++ is meant to be used with another language for making better looking programs in
the same way that XML and Java work in android?

Re: Newbie question about different languages and what they can do (mainly C++)

Indeed C++ doesn't provide any libraries for GUI by default. In Windows you can use WinAPI and MFC for GUI but in this case you'll lose portability. There are third-party widget toolkits for C++ - Qt, wxWidgets, Ultimate++ to name a few. They are implemented in C++ but they are not part of the language standard.

Java primarily uses AWT for GUI, not XML at least for desktop apps. If you need a language with GUI routines I'd peek Java or C#. (I'm using Java heavily.) It's useful for research projects etc.

If you just need to get familiar with modern trends in programming C++, Java and C# are overall very similar. If you want to try something significantly different, try Haskell or Prolog.

Re: Newbie question about different languages and what they can do (mainly C++)

Originally Posted by SenatorMagenut

I have been testing different languages for a while now. I have
built up a good amount of knowledge in web page design (nothingtoo fancy though) and I have tried some C++. I am in high
school and I want to learn a language that I can use as a base. I have read that C++ is the language to learn because you can adapt from it to whatever language your company uses.

If you want to have a career in programming, C++ is certainly a very valuable language to learn. Many other mainstream languages become relatively easy to learn once you have a good understanding of C++; the other way round is often not the case. Also, I believe that the fact that many errors in C++ lead to undefined behavior can help you to learn to write high quality code.

However, C++ is not an easy language to learn. It is certainly not something you can learn by trial-and-error or just following an online tutorial. The language is pretty large, some parts of it are complicated, there are many books and people teaching it in a stupid way and the language library is quite limited, meaning you will have to learn to use third-party libraries if you want to develop a useful program. Most prominently, if you want to create GUI programs, you will have to learn to use one of the GUI libraries or application frameworks (Qt, MFC, wxWidgets,...), which is not really something you can do until you have a reasonable understanding of the basics of C++. If you want to learn C++, I'd advice trying to stick to more mathematically oriented problems to practice with at first.

Cheers, D Drmmr

Please put [code][/code] tags around your code to preserve indentation and make it more readable.

As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky

If you're interested in a future in programming you shouldn't do too much programming in high school. Instead concentrate on getting good grades. Then go to college and get a degree in computer science.

Re: Newbie question about different languages and what they can do (mainly C++)

It's not true that Android dev is done in Java. The SDK is java, most apps are written in it, but the system supports libraries that can be written in any language. Games are usually written in C++ and only the part that interacts with the OS is ported to the native language (java for android, cocoa for iOS.) This is how Angry Birds works on both Android and iOS, even though I'm sure that there is one code base.

Statistics like this make me chuckle. I wonder how they got to their ratings and what "popular" in this context means.

If it means "what would a programmer pick as preference", then it's pretty much a moot statistic, there are real life concerns at stake when picking a language, and often your "preference" isn't even an option for a certain project.
This would seem to be the case, as a language like COBOL and Fortran aren't even in the list when they are quite present in real world scenarios. At the same time, some languages seem to be overly present when their "real world" use is much more limited than what would be listed here.

And if it's "user preference", then whatever statistic they have come up with is going to be entirely biased towards their user base.

Going by code produced in a year wouldn't even help, some languages are considerably more verbose than others. That's assuming you could even get at this statistic, the majority of code being produced is proprietary. You could potentially count all the open source projects, but open source projects tend to focus around development with open sourde tools, so again, is going to be biassed.

Bottom line:
Pick a language... Any language, and learn how to master it. Accept that your language of choice will be (very) good at some things, and lousy or impossible at others. That's why it's good to know several languages. And it's especially good if you know languages that work well together and are good at solving different things. Nobody says a good project needs to be done in a single language. And a lot of 'bigger' projects will be a combination of several languages. A main UI language, a backend language, a database language (SQL is by far the winner here), and you probably will end up with some form of scripting in more complex/larger projects.

Statistics like this make me chuckle. I wonder how they got to their ratings and what "popular" in this context means.

If it means "what would a programmer pick as preference", then it's pretty much a moot statistic, there are real life concerns at stake when picking a language, and often your "preference" isn't even an option for a certain project.
This would seem to be the case, as a language like COBOL and Fortran aren't even in the list when they are quite present in real world scenarios. At the same time, some languages seem to be overly present when their "real world" use is much more limited than what would be listed here.

And if it's "user preference", then whatever statistic they have come up with is going to be entirely biased towards their user base.

Going by code produced in a year wouldn't even help, some languages are considerably more verbose than others. That's assuming you could even get at this statistic, the majority of code being produced is proprietary. You could potentially count all the open source projects, but open source projects tend to focus around development with open sourde tools, so again, is going to be biassed.

Bottom line:
Pick a language... Any language, and learn how to master it. Accept that your language of choice will be (very) good at some things, and lousy or impossible at others. That's why it's good to know several languages. And it's especially good if you know languages that work well together and are good at solving different things. Nobody says a good project needs to be done in a single language. And a lot of 'bigger' projects will be a combination of several languages. A main UI language, a backend language, a database language (SQL is by far the winner here), and you probably will end up with some form of scripting in more complex/larger projects.

Re: Newbie question about different languages and what they can do (mainly C++)

Originally Posted by OReubens

Statistics like this make me chuckle. I wonder how they got to their ratings and what "popular" in this context means.

Well, I prefer any statistics over handwaving. You'll find the TIOBE rating methodology at the site.

The OP didn't ask for general language selection principles. He's in highschool and wants to "learn a language that I can use as a base". Apart from the dangers of becoming too interested in programming flunking everything else, I think Java is the best choise overall. My main motivation is that it's widely used in education. It's the language the OP will benefit the most from knowing well where he's at.

Re: Newbie question about different languages and what they can do (mainly C++)

Originally Posted by nuzzle

Well, I prefer any statistics over handwaving. You'll find the TIOBE rating methodology at the site.

I don't. A statistic should always make clear what its exact purpose is in order for it to be meaningful ( and the term "popularity" definitely doesn't convey any specific aim ). The reason being that a statistic is a kind of compression method where you lose information to focus on specific global fature of a bigger population. As OReubens pointed out, by dropping the right amount of information you can prove quite everything making vaguely-aimed statistics at best meaningless and at worst misleading, indipendently of how rigorously the statistics has been calculated. The purpose of a statistics is most important, then how it should be computed follows trivially by application of probability theory.

Re: Newbie question about different languages and what they can do (mainly C++)

Originally Posted by superbonzo

I don't.

Well, in line with my argumentation, I would feel more confident you were right if one thousand people agreed with you.

Lots of independent people from all walks of life are more likely to be closer to the truth than one person alone. And the more different, direct and indirect indicators you weight in the more likely you are to spot trends correctly. You can measure almost anything to get conclusive information about almost everything. Check out the faschinating field of Multivariate Statistics if you want to know more.

For example after having consulted TIOBE I'm very confident Java is still very popular and Objective-C is advancing. More so than I would ever be after hearing it from any one handwaving expert, how ever renowned.

Re: Newbie question about different languages and what they can do (mainly C++)

Re: Newbie question about different languages and what they can do (mainly C++)

Originally Posted by nuzzle

You can measure almost anything to get conclusive information about almost everything. Check out the faschinating field of Multivariate Statistics if you want to know more.

I wonder what do you mean by this because, read literally, it's wrong both in theory and practically ... anyway, I don't want to fire a new discussion on this, so I'll take it for good.

Originally Posted by nuzzle

I would feel more confident you were right if one thousand people agreed with you.

Yeah, it's called conformism and it ruled the world from the very beginning of mankind ... personally, if I need to take a choice based on some other opinion I consider the quality of the reasoning behind his decision more important than merely counting how many people support it ... anyway, not a big deal though

I find your argumentation unfocused. Do you consider exactly the TIOBE index irrelevant or do you disqualify statistics in general as a source of information for decision making? Do you dispute the ability of statistical methods to mine information out of large data sets or have you maybe even lost faith in the law of large numbers? You seem in need of a compass.

Re: Newbie question about different languages and what they can do (mainly C++)

Originally Posted by nuzzle

Do you consider exactly the TIOBE index irrelevant or do you disqualify statistics in general as a source of information for decision making?

I consider good statistics the sole and only source of information for decision making, but I consider statistics good if and only if they are based on the precise statement of their purpose; in other words, what's the exact question they are trying to answer, defined in a sufficiently rigourous way in order to make the translation into a probabilistic statement straightforward. The very idea of "popularity" does not fulfil the latter requirements.

Conversely, bad statistics gives at best no information and at worst could convey false meaning, making it potentially worse than liberally acquired opinions ( or "handwaving" as you call it ).