Page 2 of 2

Re: Learning C++

Posted: 03 Apr 2019, 23:47
by unelsson
I've had to learn a lot of C++ recently, so I think I have something to say as a peer. :)

I have to say though, that I had previous programming experience before I started to code things with OpenMW. I had written some stuff with various languages (including some C++), but I still considered myself very much a beginner. I do agree that C++ might not be the easiest language to learn, but I also think that straightest way to learn C++ is learning C++ straight away, not other languages. This does depend on your starting understanding though, if you think you know absolutely nothing about coding, then maybe learning some other languages can help you understand coding in general.

Other advice, based on what has worked for me:
- Jump straight into C++. Get working on something regarding OpenMW. Try to understand what a limited piece of the code does. Hack it to see how it really works. This is a bit tough if you know nothing of coding, so expect to progress slowly at first.
- Read developer checklist at OpenMW wiki, and related...
- Browse through the issues at gitlab, and try to solve them. If you think you've created a solution, make a merge request / pull request. Make them early, and if possible, keep them small and limited. I think I'm breaking the latter advice all the time though.
- There are some OpenMW related standards, and it helps to stick with them. Try to understand why OpenMW coding standards are as they are.
- Ask help, there are skilled people around, and many are willing to help. There are some people who really know their stuff, then there are people like me, who might want to help, but have limited understanding, and then there are all other sorts of people too.
- Albeit there might be better options, I like to use std::cout all the time to check statuses and values of various variables. C++ variable types and their interactions, pointers, references, casting types etc. can get complex. Nobody gave me this advice, but it has helped me personally a lot.
- Learn the basics of keywords: pointer, reference, casting... also, operators. You don't have to learn all of them at once though.
- For C++, I think that reading about "Rule of Three", "Rule of Five" and "Rule of Zero" has increased my understanding of memory management. Learn at least first what's a class constructor and class destructor.
- Whenever using some set of libraries (Qt for example), read the docs, and pay attention to memory management. Many frameworks tend to do automatic memory management too, so you don't have to write malloc/free or new/delete all the time after all.
- I like to use Atom to code. There are other options, can't really say why one is above other, but personally I like Atom because it's free, clear and simple to use, it feels intuitive, and there are advanced features under the hood, but still not cluttered, and it works straight out of the box - you get to code straight away (you don't have to do any extensive setup on coding software).

Re: Learning C++

Posted: 04 Apr 2019, 14:30
by sirherrbatka
I think that racket scheme is fairly decent, educational environment. It is interactive, not file oriented, simple, has some useful libs to build practical stuff and decent environment that includes everything you will need to start.

Re: Learning C++

Posted: 08 Apr 2019, 15:34
by lazyblue
i know c++ up to structure and file input output .. i am reading data structure and algorithms .. then where .. i mean i want to fully contribute to this project so .. what are the tools and topics i should know and what and where or which books i should read .. i get scared by { #define }
i opened a few open source projects and i was totally lost is there any way for me to be an expert and contribute to this project so i can enjoy it .. it is a question i guess for many millons of people .. i want to self taught as much as possible .. so please give me a deep guide .. i can guide a few more people here { .. but they are lost like me .. so plese please please please please help me

Re: Learning C++

Posted: 08 Apr 2019, 20:49
by raevol
lazyblue wrote:
08 Apr 2019, 15:34
i know c++ up to structure and file input output .. i am reading data structure and algorithms .. then where .. i mean i want to fully contribute to this project so .. what are the tools and topics i should know and what and where or which books i should read .. i get scared by { #define }
i opened a few open source projects and i was totally lost is there any way for me to be an expert and contribute to this project so i can enjoy it .. it is a question i guess for many millons of people .. i want to self taught as much as possible .. so please give me a deep guide .. i can guide a few more people here { .. but they are lost like me .. so plese please please please please help me
Being able to figure things out on your own is one of the most important skills to have as a programmer, and is absolutely essential to be able to work in open source. I understand the frustration of being lost and confused as a beginner, but there are a ton of resources out there. Even if you don't find exactly the right one the first time, any learning that you do will eventually lead you to the right place.

Sorry if this comes across as harsh, but it's an important lesson to learn. You can do it!

Re: Learning C++

Posted: 01 Sep 2019, 18:39
by danny95623
I would say "Yes". Our shop is/was a Java shop but I've found that while Java has its place, if you really have to get a job done, we use C++. Basically you can use it for anything from low-level device control to CGI backends.

For some smaller projects where performance doesn't matter you can save some time using a P-language (PHP, Perl, Python) but for the bread-and-butter we use C++ now. Our goal was pure Java but it has turned into such a memory hog with slow startup times. And, unless you use a serial garbage collector and are willing to accept occasional lag times, the memory usage for a long running (manga zuki) process can easily grow to a gig or more. As an example, our web server is written in Java and it easily approaches the 1 gig mark after a few days. You can keep it lower by using a serial GC and free heap limits but then you get lags while the GC is running. The C++ version stays at around 800K and never experiences lags.

So, if you want it to work reliably and efficiently, C++ is the language that is still used and will be for a long time to come.