2019-06-25 17:41:04

Hello.
I'm creating an audio lesson for a Russian audio gaming site about C#.
I don't speak English enough to record such a lesson in English. For this reason, here for beginners, I'd like to tell why C # is better than Python in programming audio games.
In the beginning, I want to say. Those people about whom I will speak, don't judge me, because you know that I'm right.
Many developers here advise Python as a programming language for audio games.
I agree that this is a simple, good programming language. But I believe that every tool should perform its tasks.
Those who advise you to use Python have not developed a single game.
SoundRTS, Undead Assault, is the most popular games developed in Python.
But if you ask me if there are any good games in Python, at least one good game, I'll answer you, no!
Are there any games in C#? Yes.
3-D velocity, A Hero's Call, Tactical Battles, Entombed, should I continue?
I'll tell you 3 things. Only 3 things that I believe should lead you to the truth. If this is not enough, I'll be happy to answer your questions in this topic. Or go with Python, but you may regret...
1. Performance.
Python is slow. It's true.
In order for your code to be fast, you need to optimize it. Use libraries that are already optimized. Use cython, but I'll please you, it will not help in all cases.
While you're creating small games like Redspot, Ultrapower (I think these games are small games), this problem may not disturb you.
But if you want to create a game like STW or more, like video games like Call Of Duty, or even more so Grand Theft Auto...
In short, in this case, I'll not feel sorry for your housemates who will hear your curses.
For offline games, you can use BGT. But for Online ...
Do you know that networking in C# is better than networking in Python?
The cost of network input / output is so high that the performance of the runtime environment doesn't matter at all. High-quality Python code does an excellent job with c10k. But CLR is much better at utilizing resources than Python VM, so for a very large application under very serious workloads, using C# is more profitable.
2. Cross-platform.
With Python, you can't develop for Android. No, you can, but with Python, this is not enough.
C# has Xamarin. C# has Mono, Monogame, with which you can develop applications not only for Android, but also for iOS.
3. Python teaches improper programming.
Don't tell me that in most European and American schools and universities, Python is used to teach the basics of programming. I know about it.
But for the basics of object-oriented programming, for some reason use such programming languages as Java. Have you ever wondered why?
Because there is no object-oriented programming in Python!
Rather, like this: Because in Python there is no proper object-oriented programming!
Dear developers, I'm sober. I understand what I'm saying now.
In Python, everything is an object. I know, I remember.
Have you seen encapsulation in Python? If not, ever learn it. If yes, I'll not continue...
In C#, you can learn proper object-oriented programming and more. More difficult things, pointers, as you wish.
P.S.
Python is a good programming language. I'm still learning this for web applications. But I'll never use it for audio games ...

2019-06-25 18:26:22

I'll just say this.
Talking about which language is better clearly shows that you are still a beginner.
A developer is damn free to use what he wants to. Python may be slow, but you seriously can not compare an interpreted language with a compiled language. It would be like comparing a car with a bicycle.
On top of that languages are made for different reasons and with different architectures.
Java and c# share a common architecture which is the object oriented  paradigm.
Python does not focus on OOP as much as c# does, but this doesn't mean that you can not make OOP applications with it.
Only because private properties in a class can be accessed does not mean that python's inheritance does not work.
And of course python isn't good  to make games suchas GTA since it would be slow as hell. It was not made for this. For that you would purely need speed and performance which can be obtained by compiled languages such as c, c++ and c#.
But, for audiogames is different.
I ensure you that audiogames in python are not slow at all (if developed correctly). And I also ensure you that a c# audiogame or game could be slow (if not developed correctly). There are soo many factors to the table that you can not come here and say "oh this is better and this sucks so stop using it."
Please, use google, I ensure you that is really useful. But search deeply.
Sorry if I sounded arrogant, but I tried to explain as much as I could.

Paul

2019-06-25 18:53:51

jonikster wrote:

because you know that I'm right.

You are wrong, because you don't know about python (and I'll tell you why you are wrong).

jonikster wrote:

Many developers here advise Python as a programming language for audio games.

this is their matter of preference, and they are happy with it.

jonikster wrote:

Those who advise you to use Python have not developed a single game.

so Did you?

jonikster wrote:

SoundRTS, Undead Assault, is the most popular games developed in Python.
But if you ask me if there are any good games in Python, at least one good game, I'll answer you, no!

This is again a matter of preference. it doesn't matter if you like a game or not.

jonikster wrote:

Are there any games in C#? Yes.
3-D velocity, A Hero's Call, Tactical Battles, Entombed, should I continue?

But it doesn't mean that a programmer should just stick to c#.

jonikster wrote:

1. Performance.
Python is slow. It's true.
In order for your code to be fast, you need to optimize it. Use libraries that are already optimized. Use cython, but I'll please you, it will not help in all cases.

so, you are saying you should write an optimized code. this is true for each and every programming language.
back to the performance of python and I want to give you evidance that shows you are entirely wrong.
Checkout tensorflow, Pytorch, mxnet, etc. all of these libraries work with python (these are deep learning libraries).
Training neural networks is slow, because of tooning parameters of neural networks etc (which is not for this post), and unfortunately (or fortunately), every programmer does this in python. this was the first reason that shows you are wrong.

jonikster wrote:

While you're creating small games like Redspot, Ultrapower (I think these games are small games), this problem may not disturb you.
But if you want to create a game like STW or more, like video games like Call Of Duty, or even more so Grand Theft Auto...

Toontown is written in python (which is a multi player game) and we have many great libraries for video game development in python (pygame, pysdl2, panda3d, etc).

jonikster wrote:

For offline games, you can use BGT. But for Online ...

You can use bgt as well. it has support for UDP protocol (it doesn't have support for tcp) (and most of the online games use udp).

jonikster wrote:

Do you know that networking in C# is better than networking in Python?

Again this requires evidance. Why and how it is better, what it has to offer that Python or other programming languages can't?

jonikster wrote:

The cost of network input / output is so high that the performance of the runtime environment doesn't matter at all.

the cost of network depends on many factors such as connection, distance with the server, etc.

jonikster wrote:

High-quality Python code does an excellent job with c10k. But CLR is much better at utilizing resources than Python VM, so for a very large application under very serious workloads, using C# is more profitable.

Why it is more profitable? How did you compared these?

jonikster wrote:

2. Cross-platform.
With Python, you can't develop for Android. No, you can, but with Python, this is not enough.
C# has Xamarin. C# has Mono, Monogame, with which you can develop applications not only for Android, but also for iOS.

python-for-android is made for development for android. also, you can use jython, which compiles your python code to java's Bytecode.

jonikster wrote:

3. Python teaches improper programming.
Don't tell me that in most European and American schools and universities, Python is used to teach the basics of programming. I know about it.
But for the basics of object-oriented programming, for some reason use such programming languages as Java. Have you ever wondered why?
Because there is no object-oriented programming in Python!

so, you know what is object oriented programming and others don't
now, let me tell you that it has proper support for it, (pytorch and mxnet use it to represent neural networks).

jonikster wrote:

In C#, you can learn proper object-oriented programming and more. More difficult things, pointers, as you wish.

pointers are used for memory management (at least in C/C++), and they don't have anything related to oop.

jonikster wrote:

Python is a good programming language. I'm still learning this for web applications. But I'll never use it for audio games ...

in your previous post, you were talking that python is not good for web applications (I don't know how you changed your mind).

2019-06-25 18:57:26

@2, python can be used to develop huge games, and games like toontown are written in it.
it is fast enough to code scientific applications in it.

2019-06-25 19:09:43

To the original poster. Until you have created an audio game that is in the community's hands, you have no room to judge what is or isn't a quote unquote good language for creating games in.

Much less active on this forum than in the past.

Check out my live streams: http://lerven.me
follow me on Twitter: http://twitter.com/liamerven

2019-06-25 19:13:09

@4 I know,  just wanted to send the point across.

Paul

2019-06-25 20:09:29 (edited by Rastislav Kish 2019-06-25 20:10:37)

Hi there,
there are more things to address, but I don't want to criticise. It wouldn't have any sense at all, I think there were enough wars about this kind of topics on this forum.

I will address just one statement, regarding Python and oop. Not because of criticism, but because it reminded me one thing, that I haven't seen mentioned here yet and which is imo important to mention for beginners, if they read this topic.

It's not true, that there is no encapsulation or other oop principles in Python. But it is also true, that Python isn't so strict about them.
That is because Python developers do they work in style: "We are all adults. We know, what we're doing."
And that is also the nature of Python. In C#, Java and other languages, you are restricted to certain patterns to emforce good programming style. For example marking types of arguments in methods. it prevent you from mistakes.
But in Python, there is no need to mark types of arguments. It's because you are adult and you are expected to know, what will your method receive and if you make a mistake, it's your fault.
And the same principle goes for nearly everything in Python, for encapsulation, inheritance, oop usage etc.
Python doesn't force you to use classes at all. but that doesn't mean you shouldn't use them. You are just expected to do so, or not if you have a reason for it.
And that reason in case of beginners could be potentially their lack of knowledge.
Yes, Python is choosen by many beginners, because it has nice syntax. But if they aren't taught to proper coding styles, then its freedom and dynamic nature could lead into a disaster.
That is why imo C# is more suitable for them, because its strict syntax clearly shows connections between things, something, that expected programmer is supposed to see without marks.

I don't want to say of course that beginners shouldn't learn Python. Although I personally recommend C#, you can go this way as well. Just be carefull and keep in mind, that you're dealing with much more power and responsibility, than you might think for the first look.

Best regards

Rastislav

2019-06-25 20:19:05

C# is much much better than Python IMO. But the stuff you talk about Python are stupid.

If you want to contact me, do not use the forum PM. I respond once a year or two, when I need to write a PM myself. I apologize for the inconvenience.
Telegram: Nuno69a
E-Mail: nuno69a (at) gmail (dot) com

2019-06-25 20:29:14

Rastislav Kiss, Thank you. In fact, I also wanted to say this, but I couldn't.
nuno69, Do you know what the main argument is about the performance of those developers who advise Python?
***
Python has been used in big projects. Google uses Python, etc.
***
But they forget that there Python is not the only programming language.

2019-06-25 20:39:55

So as others have pointed out, this is... majorly flawed to say the least. I've seen several audio games that people really like that were coded in python. For example, great toy robbery, Oh Shit, etc. And others to come soon. Python also has good code protection if you use cython to convert your code to c first, which also makes it run much faster because that makes it semi compiled. And lets not forget about all those extensions written in C. As for most of python's stdlib, a lot of the core stuff is builtin. Most of the things you mentioned here you have done so with nothing to base your claims on. Your more or less claiming C# is better and tasking people to please believe you. Howabout this. They both work, they both have ups and downs, and they both can be used to develop audiogames. If you can personally get more done in C# than you can with python, more power to you and I wish you luck. But that doesn't mean you should try convincing others it is better because of what you personally prefer. There is no perfect programming language. You may personally be much more comfortable with C#, but I promise you there is someone in the world who can make a better audiogame in python than you could make in C#. And if you know what your doing and can code, I can also promise that there is someone in the world who's game in python would be nothing when compared to your game in C#. It's certainly fine to post your opinions, but please please don't mislead people with invalid facts that could cause them to make the wrong decision when choosing a language. What many people need to understand is that it's much more about the coder than it is the language they code with. The language plays a part certainly, but we don't want someone using C# and having a hard time with it when python would have been much easier for that particular person. And we also don't want someone to make the decision of using python and having a hard time because C# would have been easier for that particular person. But that will happen more and more with topics like this where we provide baseless facts about this or that language without proper evidence, thus misleading them. And I'm sorry, but the "You know I'm right" comment in particular just makes me cringe with the implied dickishness. If you think C# is what will work for you, that's awesome. And it's fine to post that in an opinionated form. As I said, more power to you if you've selected a language and can work with it. But others have different opinions, and you shouldn't try swaying potential devs to this or that with facts that I'm sorry, but are in some cases very wrong.

I am a web designer, and a game developer. If you wish see me at http://www.samtupy.com

2019-06-25 21:01:21

Sam_Tupy, Guy. First, learn to act independently. Learn to independently calculate formulas for the RotationPack, etc., and not use the tips of teachers.
You have been developing Redspot in Python for a year or more.

2019-06-25 21:03:18

I'm sorry for another post, but I'd like to tell one more thing.
Python is simple. Only because of this, many use.
So this thing:
You need to be a professional, really professional in Python to write simple and efficient code using this.

2019-06-25 21:24:06

Lol so I probably won't post after this in this topic so as to not start an argument, but I will still defend myself. This is all you can come up with? When I tell you your wrong all you can think to do is mention something I wrote in 6th grade? Lol bro. I don't think we have to worry about this topic being an influence anymore big_smile #TrueColors or something lol. Think what you wish, but just FYI I didn't get a tip from anyone telling me to post my last post, or this one. Also, isn't #11 somewhat contradictory? You tell everyone to use C# instead of python and then tell me that I shouldn't take tips. Lol whatever I'm just amused at this point. The rotation pack thing was written many many years ago when I was trying to figure out just enough to piece something together that would at least somewhat work, and then I released it because I was just trying to help others. Actually it was pretty good for my age at the time. Anyway I'll go now, if you can't stick to your topic but instead need to jump to attack others when someone mentions something wrong with your post rather than fixing the problem or even continuing to discuss it, it's clearly not worth talking to you about it. As mentioned above, python looks simple, but because of it's dynamic typing it's really not. People don't just use python because it's simple. There are many other reasons to use python, and to use C#. Anyway I'm pretty much out of time, I eagerly await your next post where you attack some other thing I've done 4 years ago because you can't defend your own points.

I am a web designer, and a game developer. If you wish see me at http://www.samtupy.com

2019-06-25 21:29:33

visualstudio wrote:

the cost of network depends on many factors such as connection, distance with the server, etc.

input/output will always be orders of magnitude slower than executing code. Even if it is writing one byte to a local socket versus a complex algorithm.

2019-06-25 21:31:58

@11, it doesn't matter how he calculate stuff, because it is not related to you at all.
someone should teach the formula for rotation stuff. noone knows everything when they are child!.
@12, about being professional: you are wrong as well. because they are many people around which python is their first language, but they work in data science.

2019-06-25 21:32:09

Sam_Tupy, I'm glad if at this time you really think so.
What is happening here, holywar, I'd say so.

2019-06-25 21:35:35

Hey. At least Sam ya know. Actually released something. Just saying.

Much less active on this forum than in the past.

Check out my live streams: http://lerven.me
follow me on Twitter: http://twitter.com/liamerven

2019-06-25 21:37:39 (edited by visualstudio 2019-06-25 21:38:34)

@16, I don't know why you don't want to answer my questions and clarifications, and you just want to insult Sam.

2019-06-25 21:42:05

visualstudio, read 14

2019-06-25 21:42:16

ancient anger I guess.
Or maybe just jealousity. heh who knows.

Paul

2019-06-25 21:48:31

jonikster wrote:
visualstudio wrote:

the cost of network depends on many factors such as connection, distance with the server, etc.

input/output will always be orders of magnitude slower than executing code. Even if it is writing one byte to a local socket versus a complex algorithm.

You know that it is not related to python and it's speed. and as you are saying, reading and/or writing to files and pipes etc should be slow, because they are input/output. while they are not.
as i mentioned, network programming is dependent on many factors such as protocol, connection speed, (upload and/or download), traphic, and so on.

2019-06-25 21:52:53

visualstudio, You have not said anything new here.

2019-06-25 22:06:01

jonikster wrote:

visualstudio, You have not said anything new here.

the fact is, all of the socket layers use the underlying os functions. no matter if python calls them or c#. but the question is, why python should be slower in terms of sockets than c#? what are your benchmarks?

2019-06-25 23:35:41

@jonikster, who do you think you are? I have not seen anything but words from you, pointless, bickering, and almost always unhelpful comments that waste people's time. You have posted topics of this nature before and were proved wrong again and again. Stop. Release a good game and then talk. Thank you.
Also, seriously? Insulting somebody's code they wrote 4 years ago? Yeah no, that just caused me to lose any respect in relation to you. Did you write excellent and efficient code when you started to write applications? Oh wait, I don't even know that you can code because again, I have seen nothing from you.
And yes, I do speak Russian, so if you actually have to show something do so, please, language barrier is not an issue here.

2019-06-25 23:58:19 (edited by pauliyobo 2019-06-25 23:58:41)

@24.
If that's the case please, please could you tell us how are his actual video lessons? this is genuinely making me curious.

Paul