Recommended Free C++ tutorial

Java is halfassed garbage, C++ is also halfassed garbage :slight_smile:

: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, ā€¦)

https://www.youtube.com/user/antiRTFM

This guy teaches you everything and explains very well.

[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. :wink:

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

Founded in 2004, Leakfree.org became one of the first online communities dedicated to Valveā€™s Source engine development. It is more famously known for the formation of Black Mesa: Source under the 'Leakfree Modification Team' handle in September 2004.