Java is halfassed garbage, C++ is also halfassed garbage
:lol:
also c++ is an awesome programming language.
@Quaker: why wouldnāt you use streams? theyāre really easy and maybe better to understand for beginners.
Not to mention you can overload them really easily to extend their functionality.
The extensibility doesnāt matter here; you can always write a serialization method and use it with printf.
C++ streams are badly designed; your typical implementation is fatter than stdio, theyāre also overly verbose:
std::cout << std::hex << std: :s etfill('0') << std: :s etw(8) << x << std::dec << std::endl;
vs
printf("0x%08xn", x);
Typically, using stdio is no more error prone than using streams; non-POD types cannot be passed via varargs and even if you fuck up, the fix is always trivial. But thatās of course no problem if you actually look at what you are printing.
I want to learn C++ because that, in my limited knowledge, is the most useful language for video games and ordinary computer software, which is my realm of interest. I tried starting out on C++ before but ran out of determination, Iām starting back up because I now have one and a half hours of free time every school day in which I get to do whatever the fuck I want. I ofc have a powerful machine that will have no trouble. As a few have pointed out, I started this thread not because I have trouble finding tutorials, but because I donāt know which tutorials are good, and I didnāt think the top google result is a good enough standard of quality.
Anyway, long story short, thanks I"ll try out a couple of these tuts and see which I like. I understand that C++ may not be the best to start out with but I am bright (imo and according to statistics) and I have a shitload of time.
C++ is a fine language to start with. Donāt let anybody tell you different.
In an attempt to quell any fears over which language is the best one to learn, let me impart some advice: learn how to program, not just necessarily the intricacies of any specific language. There are tools and skills that are applicable to any computer programming language.
What Jethro and Snoogins said - Once you know how to program, picking up the different languages is easy.
The realm of C++ is pretty complicated though, with C++, VC++ (CLR/C++) and all that entails. Iām still getting started on it though, but the best way to learn is to think of a program to make and do it! If originally started with Visual Basic, nice easy way to get in to it all.
Iām actually in the process of making a little app that allows people to enter and store their expences and view a history of what theyāve spent (with different users, expense types, amount, date search etc all stored in an Access database).
C++ is not a good language to start with; yes, it is useful, but no, itās NOT a good language. It has so many corner cases itās almost unbelievable, many duplicate, half assed features, carries bloat all around, is hostile to parsers (not context-free and often ambiguous). These are mostly given by its history; it had to keep compatibility since the late 90ās. The only advantages of C++ are these days performance and availability of good toolchains, which is why itās still used (I use it in my engine myself), but its share is steadily decreasing. These days implementations of other native languages can reach the performance level of C/C++ while being more modern, less half assed, parser friendly and without corner cases and duplicate features everywhere, and I expect these to grow more, much more (like D, Rust, Clay, Go, ā¦)
[COLOR=āRedā]#[COLOR=āBlueā]include [COLOR=āRedā]
[COLOR=āBlueā]using namespace std;
[COLOR=āBlueā]int main()
{
cout << [COLOR=āRedā]āJava sucks.ā << endl;
cout << [COLOR=āRedā]āTrue story.ā << endl;
system([COLOR=āRedā]āpauseā)
}
eww, system().
#include <stdio.h>
int main()
{
printf("C++ sucks.\nTrue story too.\n");
getchar();
return 0;
}
I dunno quaker, but I think you shouldnāt be here if you hate C++ so much.
Also op asked for tutorials and you didnāt contribute any.
gross
gross
The function āmainā is an int. Why didnāt you return one?
Quaker, C++ has its faults, but so does every single other programming language out there, including the ones you mentioned. C++'s prevalence in modern computer science is probably the main reason it gets so much flack, coupled with the fact that it can be difficult to master and as such is off-putting to those with weaker constitutions.
As Bjarne Stroustrup once said, āThere are only two kinds of programming languages: those people always bitch about and those nobody uses.ā
I donāt know, āusing namespace std;ā looks fine to me. Beats having to write āstd::coutā instead of just ācout.ā
āUsingā entire namespaces is just a bad practice as it opens up all of the items in the namespace, which can create problems as std contains a lot of names you may not think about, leading to conflicts, etc. This is exacerbated if youāre working on a team and it messes up one of their namespaces. If you really hate the std:: in front of everything (and letās be honest, I think we all do) use something like āusing std::cout, std::endl , etc;.ā In this example, itās probably not going to create any problems, but it is a bad habit, and those are easier to weed out early. I would say NEVER declare a namespace globally or in a header; stick them in the scope of the function instead.
Ah, fair enough. I work almost exclusively with Perl these days so I forget the nuances of other languages.
Sure other languages have faults, but in case of C++ the amount of corner cases is almost unbelievable (ranging from half assery of various kinds through parser hostility and ambiguity to verbosity).
If you ever tried to lex/parse C++, youād know well that C++ does anything but making it simple (because its grammar is not context free and ambiguities like the retarded template syntax get in the way).
The only reason C++ is still being used is availability of many good toolchains and resources. In this, the better languages still canāt compete. With C++ you can be sure you can always get a good compiler for every platform, lots of libraries and books. This is pretty much the reason I still use it, too. Iām preparing to migrate at some point, however.
As for return value from main, itās not required to return from it in C++ (even though return value of main is always int). The value is implicit.
Could you explain what those corner cases are? You keep referring to them without providing any real examples.
C++ isnāt exactly renowned for its simplicity. At the same time, however, itās fast, powerful, and you can do pretty much anything with it. I agree, however, that a language change is coming, probably sooner rather than later. Thatās why itās important to learn programming and computer science and not just C++. That being said, I think that knowing C++ is pretty necessary for a career (in most cases) as a software engineer.
I feel like weāve shifted away from the original intent of this thread.
1: If he doesnāt know how to google, iām sure C++ isnāt the thing for him.
Simply because it is not a good beginner language
2: Right? The MSDN doc sucks, but the language is a good thing between C++ and fx Python, because itās simple to use mainly because there is no dealing with pointers and memory management at all. And itās very easy to create graphical applications because you have a high-level and flexible API (Win Forms) in contrary to C++ where you have numerous GUI libraries which all basicly sucks due to the low level API with hundreds of constants and pointers. And then itās fast which no script language is except Node.js.
3: Iām not trying to be a dick, but seriously; only a few people will grasp C++ without any programming knowledge. And another thing is that C++ may be widely used BUT it have no future.
The best thing would be to invest his time to learn all the web technologies and develop some cloud solutions, it is, whether we like it or not, the future