2017-06-22 20:27:18

Hello.
My question to C ++ programmers.
For a very long time I have chosen a programming language.
Initially, I chose between Python, C#, and C++.
And I decided that Python is not my assistant, but my choice for C # and C ++.
In the future, I want to develop 1 big project, that's why I chose C # and C ++, because these are the best options for my situation.
Below I will indicate my tasks and what I expect from C ++, in addition I will ask some questions. Who has the opportunity, please help to solve the situation and tell me whether C ++ is suitable for my tasks or not.
My main task is the development of audio games. As an additional task, I need to decide whether my programming is or not, and whether it is worth making programming my main profession.
I decided to focus on C ++, because:
1. Any complexity, you see, this is not unrealistic. That is, any complexity can be overcome.
2. If you overcome these difficulties, those who work with C ++ understand that I have great opportunities! And most importantly, when implementing these opportunities, logic develops, algorithmic thinking, and of course the experience is accumulated! And even more so in C ++, I do not need to be afraid for the fact that it will have a small speed, there will be some error at the level of the language, etc.
Here are my tasks:
1. Development under Windows. And as for games, most likely, the server will work under Linux.
2. You need tools to work with the keyboard.
3. You need tools to work with sound. I think there are such solutions, such as DirectSound, Bass, and if I do not find simple already developed solutions for these libraries, I can use the same Urr klan.
4. Interested in working with the network. And it is desirable that everything be at a simple level, so that before programming, you do not need to become an expert in the areas of sockets, TCP / UDP, etc. By the way, I'll ask the question right away. I know that the client and the server can be written in different programming languages. How much is this more difficult and difficult to implement than if you write everything in one language?
I will immediately say that I have always looked in the direction of simple solutions, towards simple means, simply because of my laziness! Now I decided that this way I can not get to anything. And in the end, simple means of complex differ only in complexity. And if you understand once, then it will be only easier and more interesting!
What I need from C ++:
1. A fully compiled language! That there were no restrictions.
2. A large number of libraries! To never have their shortage. I'm sure that in cases with C ++, this is not a problem!
3. So that nothing restricts me when developing. That I had the opportunity to solve different tasks in different ways, so that I had the right to choose on my own how, what and what.
4. Less mathematics!
I will say that I decided to go the hard way. There are probably no simple books on C ++. For this reason, I study C ++ on sites and stuff, and I consolidate my knowledge with practice.
I'm interested in the following questions:
Is it possible, knowing the basics, such as variables, conditions, loops, arrays, pointers, classes and objects, to start looking for solutions to my problems and trying to implement something? If not, what needs to be taught so that you can already practice and experiment?
To implement the tasks I described earlier, is it necessary to seriously consider low-level programming, is it necessary to be a specialist in the technical field? Or is it not necessary for my tasks to use complex C ++ tools?
Is it difficult to use C ++ and Python in a bundle?
Another low level. I imagine the computer work superficially, I imagine the memory. But I would not want to be too hard on programming for C ++ programming.
Now for me the most difficult topic is C ++ pointers. I just can not understand them. Because I have no idea how and for what it is used, for what purpose. But I think that this is not such a problem to give up C ++.
And here your opinion as a whole interests, whether approaches to me a C ++?
O sorry my verry bad english. I hope that you understood the essence of my thought.
Thanks in advance!

2017-06-22 22:11:48

hello,
i will try to answer your questions, maybe i will forget to answer some of them
about keyboard input and audio management, there are libraries exist which are cross-platform
i recommend you to look at sdl for your input and low-level audio needs, and SoLoud as your audio library which supports sdl so you can use soloud with sdl
for network programming, boost has a library called asio (which is available independently), and another library called eNet exists
about pointers:
pointers are addresses of variables to memory
for example:

int x=1234; //x is 1234
int *y=&x; //y points to x which might be 0x2398 or anything else)
*y=0; //x will be 0 also because we change pointer and variable changes due to change in memory, but the address is the same

and for memory management i recommend to use smart pointers like shared_ptr, unique_ptr, etc
look at boost.org, it has plenty of libraries to use which some of them are available in the C++ standard
in C++, you can use assembly eaven!
in msvc, i will give an example which works prety well!

asm
{
mov eax, 100
add eax, 2 //eax is 102
mul eax, 10 //eax is 1020
}

so you are not limited
about knowing basics and studying other things and try to program them, yes for some of them you can do it
and remember, C++ apps cant always be fast, due to coding things incorrectly or managing memory incorrectly
also be aware of memory leeks (because of this i recommend you to use smart pointers)
you might not get errors and your app might crash
also we have run-time errors beside compile-time errors so keep these in mind
now talking about math:
as i've said in the previous topic, you won't calculate, you ask computer to calculate things for you
mathamatics (calculation) is only required when you want to implement a 3d graphics engine or a database engine (which more expert people have implemented already for you so implementing them is reinventing the weal)
but mathamatic thinking is required
and keep in mind, we have different fields of programming so i cant say which of them requires mathematics fully which of them dont
the thing is, you must be aible to solve problems

2017-06-22 23:36:47

I don't want to discourage you from using C++, but if you take this route, you should know that writing an AudioGame will be significantly harder than using a higher-level language such as BGT, Python, etc. Oh, and memory management is inevitable. I enjoy it because of all the reasons you listed in your original post, but writing an game engine requires some thinking that you wouldn't normally have to do in other programming languages. As already suggested, SDL is probably your best bet for developing all kinds of applications. However, SDL is written in C, so you might have to find guides out there that focus on SDL from a C++ perspective. SDL also has some co-libraries such as SDLNet and SDL Mixer that can aid you in handling networking and panning of sounds. Finally, pick out a good book that teaches good object-oriented practices. There is a bit of an art to dealing with allocation and deallocation of memory via pointers. But if you manage to learn it, things will be a lot simpler. It also makes your code a lot nicer. Particularly, I'm talking about making use of class constructors and destructors. Good luck!

2017-06-23 07:38:25

About C ++, pointers and other complex topics I just need to understand. The question is whether C ++ is suitable my first post.

2017-06-23 11:30:47

it can be, it depends on your needs
as i said, for memory management smart pointers help you, but you must write more codes, there are many libraries also to help you
checkout sdl (written in c), sfml, boost, SoLoud, zLib (a compression library maybe you want to compress your files), physics fs (written in c, thats a filesystem library), and these websites for reference:
http://cplusplus.com
this has a great C++ tutorial
http://cprogramming.com
you can learn c and C++ from here
http://cppreference.com
here has a great c and C++ reference, and it has a page that lists many libraries to use

2017-06-23 15:31:46

jonikster,

You ask all of these questions about can I do this or that in all of these different languages? The short answer is yes, unless you're talking about BGT. BGT has major limitations but, thats a post for a different topic. You can do everything you're asking in c++ or c#. I won't reiterate things people have already said and have already told you in other topics, but I would like to point something out that I think is a bit misunderstood.

It is a big misunderstanding that programmers need to know lots of advanced math like calculus and beyond. While this is certainly a benefit, computer science programs don't make you take math for the math itself. Its problem solving. You need to know how to brake a problem up into little pieces to be able to solve the whole thing. You don't eat a huge pizza in one big bite, you sit down and eat little pieces off the ends. eventually if you are hungry enough, you might eat the whole thing. the same thing goes for games or any program you are making you don't write everything in one big chunk. you write the stuff for the player on this day. the second day you might do work on the sound. the third day you will do something else. This isn't math. its problem solving. This is the main thing they are meaning to teach you with all of the math related classes.

that being said, there are somethings that require math. Player rotation and movement in an FPS is trigonometry. VisualStudio is correct to a certain point. you can ask the computer to calculate for you like a calculator. pow(), sin(), cos(), and tan() are all functions you can use in c++ or another language. But if you have know idea how to use them or how to apply them to solve the problem in your game, it does nothing for you. You need to be able to take all of the little pieces and be able to assemble them into a progressively larger and larger algorithm to eventually make up your whole program.

Questions are good, but when you're just throwing questions up here on the forum and they seem to be the same ones over and over and over, we wonder if you're actually learning any of this. When you're asking all of these questions, you aren't problem solving. many many of your questions can be answered with a very simple search in your favorite search engine of choice. I am searching how to do many things all the time. I'm reading people's answers and figuring out how I might adapt them into my program I'm writing. I don't feel like you have this mentality of proactive problem solving. This just makes the whole coding process much much much more difficult.

did I mention programming is hard? it is very difficult. This isn't to scare you off, its just a word of warning. I've seen people tell you to just buckle down and learn a language. I would like to just reiterate that. All of this jumping back and forth between python, BGT, c++, and c# is just dead time when you could be learning. sit down and devote yourself to a language, even if it is BGT. if you sit down and actually learn the intricacies of a language, who knows you might actually begin to understand pointers.

I don’t believe in fighting unnecessarily.  But if something is worth fighting for, then its always a fight worth winning.
check me out on Twitter and on GitHub