2017-11-16 10:51:48

Hello.
There are several questions about C and C ++. Note. The questions are addressed to those who are not new to C and C ++.
So:
1. For whom is C ++?
In general, I are interested in your IMHO who need to learn C ++.
If I want to develop games, including those that do not require high performance, text-based online MUD games, while I do not want to write the engine from scratch, and use the ready one, can C ++ approach me?
I will explain more specifically. The matter is that I need to develop a server on Linux. There are 3 options. C / C ++ / Python.
C - Many MUD game engines are mostly just in C. But there is an opinion that C is harder to write than C ++.
C ++ - many engines are also there, but the capabilities of the language are wider, which slows down the learning process.
Python - as a whole is good, on syntax, on libraries, but it is not reliable. I want to avoid it, but I consider it in extreme cases. Low productivity.
2. The same question that was the first. Only with C. For whom C? Should I even consider C?
3. It is said that the development of C is much more difficult than in C ++. How much is true about application software?
4. Both with respect to C and C ++, how much should I know, if I do not intend to develop from scratch, but use ready-made tools?
In general, I saw the same circlemud of 2000, there is more than the base C variables, conditions, loops, pointers, not used. Basically the C library itself.
5. I do not know about C, but about C ++ they say that it takes many years to study it for the solution. On how much is this true in my cases? If I'm aiming at ready-made tools, do I need to know a lot?
6. Is it possible to study C and C ++ simultaneously?
In general, I think the topic you caught, because I will take any reasoning.
Thank you in advance!

2017-11-16 12:31:43

Hi,

lets get straight to the point and answer your questions:

jonikster wrote:

1. For whom is C ++?
In general, I are interested in your IMHO who need to learn C ++.
If I want to develop games, including those that do not require high performance, text-based online MUD games, while I do not want to write the engine from scratch, and use the ready one, can C ++ approach me?
I will explain more specifically. The matter is that I need to develop a server on Linux. There are 3 options. C / C ++ / Python.
C - Many MUD game engines are mostly just in C. But there is an opinion that C is harder to write than C ++.
C ++ - many engines are also there, but the capabilities of the language are wider, which slows down the learning process.
Python - as a whole is good, on syntax, on libraries, but it is not reliable. I want to avoid it, but I consider it in extreme cases. Low productivity.

MUD engines are mostly in C, because they are pretty old today and they started development in the 1980s or 90s, so they had to use the most professional language at those times, which was C. They probably wouldn't use C today if they had to develope a MUD engine all new.
You didn't tell us what kind of server it should be, but one thing makes me really sad here.
Python is the most easiest and straight forward to approach it, and still you say that it isn't reliable, whatever this means in your case, but its totally fine. Google developes almost all of their websites in Python (Google, YouTube and more). Thanks to already finished frameworks (like Twisted), server development using Python takes maybe a fourth of the development time you'd need with C++, and maybe a sixth of the time you'd need with C. Its also much more fun and stuff. But anyway, you asked for C++ right?
C++, as well as C, is for people you want to get most of the power possible out of their machines, for whatever they want to do. C++ and C are probably the most low-level programming languages (except Assembly) we got today. While scripting languages like Python come with a (compared to low-level programming languages) massive overhead, C and C++ are incredibly fast, but thus harder to develope. C++ already shields you from tricky problems like memory leaks, which C doesn't, but its still easy to brick things easily here.
C++ and or C are used in time-critical things like Graphics Drivers, emulators and stuff, where you want to get the most out of your machine, while Python (or any other scripting language) is used if you want a stable system, many tools you can rely on (frameworks built by other people for you to use). Development in scripting languages usually goes much faster than development in C/C++, because they got a far-fetched standard library which contains all the tools you need to build your App. Code which got 10 lines in Python might actually need 100+ lines in C/C++ in some cases, or even more.
I don't think that your server really needs C/C++ to function properly.
Note: even though MUD engines are written in C/C++, they mostly assemble an additional language to use while coding for this MUD engine (like LPMud requires you to use LPC to work with it), so knowing C/C++ won't help you very much with developing for such a MUD engine.

jonikster wrote:

2. The same question that was the first. Only with C. For whom C? Should I even consider C?

C is older than C++, as long as you aren't an expert and know a reason you need to absolutely prefer C over C++, I guess you should stick with C++ instead. It has OOP capabilities, more reliable data types and more. It should be fine to only know C++ in general.

jonikster wrote:

3. It is said that the development of C is much more difficult than in C ++. How much is true about application software?

All of this is true. Developing application software in C can take loads of time, and probably doesn't offer any advantages. You don't really do this anymore nowadays. Use C++ instead if you want to go low-level for your App.

jonikster wrote:

4. Both with respect to C and C ++, how much should I know, if I do not intend to develop from scratch, but use ready-made tools?
In general, I saw the same circlemud of 2000, there is more than the base C variables, conditions, loops, pointers, not used. Basically the C library itself.

Thats the problem with C/C++, the introduction is much harder. While you can learn languages like Python during 2 days and at least use any given library to do what you want, you'll probably only cause trouble if trying the same thing with C. Thanks to constructs like pointers, and pointers to pointers and what more, because they aren't understood that easily. C doesn't have that many keywords/constructs that Python got, but the few it has can be more complicated, and you don't need to know all possible things in scripting languages either to reach your goal. At least there are always multiple ways to get things going, and the most easiest way might still be a good one.

jonikster wrote:

5. I do not know about C, but about C ++ they say that it takes many years to study it for the solution. On how much is this true in my cases? If I'm aiming at ready-made tools, do I need to know a lot?

You know, the thing with "how long takes it to" always depends on the person learning it. I just needed a few days to get an idea of C++, but thats of course not all, because the real training starts. Just because you know the syntax and the constructs doesn't mean you're good with that language. It usually takes time developing things in this language so you get a glimps on how to do things right with it. And thats the time which differs from person to person. Some people never learn it, some people only need a few weeks.
I'd say to use ready-made libraries in C/C++, you'll need to learn more than in scripting languages like Python, Ruby or what else. You at least need to know alot, even for those easy things.

jonikster wrote:

6. Is it possible to study C and C ++ simultaneously?

Hm. All the C things can be done in C++ as well, because C++ is just built on top of C, but all C++ things cannot be done in C. And C++ got many better attempts for things C already knows. So yeah, you can probably learn both things simultaneously, but I wouldn't do it.

Hope that helped a bit.
Best Regards.
Hijacker

2017-11-16 17:58:57

@jonikster, I have no idea from where your getting Python's performance issues from. Python can be extremely fast if you write your programs correctly. Granted, there is always the overhead that you'll get since the language is interpreted, but just because Python is slower than another language doesn't make it unsuitable for everything it's used for. Also, might you stop restricting yourself so much? Don't just think C/C++/Python are the top languages for games -- because Python definitely isn't. C# is probably the second best programming language out there for developing games and things, and if you use .NET core, and so long as you stick to it and not dig into windows-specific APIs, you'll be fine.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2017-11-16 18:36:46

Hijacker, do you think Python is right for me?
I like Python, but I doubt it.

2017-11-16 18:42:12

Ethin, I've seen games written in Python. I've seen soundrts, which works well, I've seen Undead assoult, which has glitches.
I want to develop MUD and sound games. And if about MUD games, I can think of Python or Java, then if I want to develop the game as GTA, I can not use Python.

2017-11-16 20:45:09

hello,
first comparing c and C++
in C++ you have exceptions while in c you have to use setjmp/longjmp (we have them in assembly using jmp instruction) to throw exceptions
in C we dont have classes thus you have to use structs
c compiles faster, than C++
in C++ you can use c libraries (for memory management malloc/free is not recommended at all use new/delete instead) although you would better off using C++ libraries instead of C provided libraries
for your information, in C/C++ you can use inline assembly (but thats different on different compiler)
if you learn C++, you can use C but you are primary a C++ programmer because of using oop programming and these kind of things

2017-11-16 21:05:27

@jonikster, finally your understanding where I'm coming from! No, you can't develop a game lik GTA in Python... unless you want it to be unplayable, I mean. However, as I said, stop restricting yourself to C, C++ Java and Python. There are literally hundreds of programming languages out there, and I'd highly recommend C# as a good game development language.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2017-11-16 23:12:17

But I can not fully use C # in Linux!

2017-11-17 02:21:05 (edited by Ethin 2017-11-17 02:21:57)

jonikster wrote:

But I can not fully use C # in Linux!

Actually you can -- just use .NET Core and use the packages you need. For game development, try out a game engine like Unity or Xenko -- (I'd prefer Xenko, by the way) -- it lets you develop games for Linux, iOS, Windows, UWP and Android.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2017-11-17 04:31:46

Unity is not available for the blind.

2017-11-18 00:08:57

@10, irrelevant. Just because a product doesn't fully work with your screen reader doesn't mean you can't use it. And I didn't say you should use unity -- I was saying that it's a choice. Xenko is another choice, too, you know.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2017-11-18 10:15:55

Well, nothing is perfect. That's why most of audiogames found here support Windows only.

2017-11-19 13:20:37

What I would suggest you is that just learn one of the languages that you are trying to make a choice from. Once you understand whole concept of programming first, then you will not have that much of a problem for learning other programming languages. From what I have observed here,  You have been asking this kind of similar questions over and over again for quite  a while now, and still hadn't made your choice what exactly you are going to do. What I' mean is that understand first, then act on it. Nobody can make a complex game solely based on the tutorials, you need experience, and trials and errors that would come with learning programming. Believe me, every beginner has big purpose to build something big when they start, but it takes time and lots of patience to actually do the real work.

Often we have no time for our friends, but all the time in the world for our enemies.