2016-06-13 04:23:28

Hello!
Interested in this issue:
What to choose? C ++ or C #?
I know the basics of both languages.
I would like to develop a sound playing under the windows, but not engaged in hard work. For example, the work of memory.
Tell me, what are the pros and cons of C ++ and C #, and it is better to use.

2016-06-13 06:16:37

I had a little trouble understanding what you hope to do with the language, but you mentioned "work of memory".  C# handles garbage collection (clearing unneeded objects from memory) for you, which might be what you are referring to.  Unless something has changed, C++ still requires you to handle your own garbage collection, which can be intimidating or annoying depending your experiences with it.

Besides the garbage collection, I don't think you're going to run into many differences between C++ and C#.  Yes there are differences, but few developers really do things that are going to be affected by that short list.

- Aprone
Please try out my games and programs:
Aprone's software

2016-06-13 06:21:48

sound games do not require working memory?

2016-06-13 07:29:15 (edited by magurp244 2016-06-13 07:30:08)

All programs require memory, the difference here is whether you have to write all the code to specifically allocate and clean it up yourself or not. From what I understand C#, like Python, has a garbage collector and allocates and cleans up memory for you, though you still need to declare what type I believe. C++ however does not, you'd have to manage all the memory allocation and deallocation yourself, this can give you alot of control but can be complicated.

If your looking to design a game that has a low memory footprint or is very efficient, then you'll have to find ways to cut down on memory usage and more efficient ways of doing things through optimization, which generally comes with trail and error, research, and experience in programming.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2016-06-13 10:34:40

When you want to choose between c++ and c#, i recomment you c++. It give you more advanced control with memory and so on. With c++, you have to know, what you are doing there. But you can do with c++ most all, what you can do...
C++ have "smart pointers" for memory managing.
Well, I haven't coded many programs in c#, because with c++ I can better code my programs, but that is realy my own opinion. When you think c# is better, use it.

sorry for my english, I hope you have understood me.

2016-06-13 11:09:20

hello,
i myself use C++ as C# requires .net framework
secondly, in C++ you have smart pointers and you have more control

2016-06-13 12:17:07

and if I do not want to think about memory?

2016-06-13 22:50:41

For a example.
In java, you haven't think about memory, the garbets collector eat the not used data.
But in c++, you can clean the memory when you not use the data.
You can use smart pointers, which are pointers but the pointers delet the data and himselfs, when you leave a block or somethink else.
That is a very powerful feature, in java games you can see, when the garbet collector is working, the game will have lags.
In c++, when you do all right, it doesn't happen so stupid lags.
I think c++ can all do, what c# can and c++ can do more!!!
That is my opinion

sorry for my english, I hope you have understood me.

2016-06-13 23:14:40

C# handles a lot of the memory management for you but you still need to explicitly declare what kind of memory for it to allocate, such as Integers or Floating Point. Python goes the little extra step and handles that for you too, so you just have to pick a variable name and stuff something in it. Regardless of what you choose, its still a good idea to have some idea of what memory your working with, if only for performance reasons.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2016-06-13 23:27:31

back when I was working for other people, I used C++ for several reasons.

1. I have never liked .NET, so I actively avoid it whenever possible.
2. It is my feeling that more people know C++ than C# because C++ is everywhere while C# is an exclusively Microsoft thing. Eventually someone else will have to maintain my code. It will be a lot easier for my employer to find C++ than C# programmers.
3. There's no need to install .NET which takes up a lot of space. Although these days, .NET comes prepackaged as a part of Windows.