2018-03-02 00:33:29

Hello.
No, today I will not ask what is best for developing audio games, C# or Python. My choice is C#.
Today I want a holivar.
C# vs Python. What is cooler?
My opinion:
There is no one good game in Python.
Python is a good language, but Python is an interpreted language. Python has lower performance than Java.
Python does not have a convenient development environment.
I don't argue. Python is steeper in WEB. But in the development of audio games ...
But Python and C# have difficulties. For example, in Python Decorators, in C # delegates and events. This is for me.
For those who worked with BGT, C# would be easier, because the C # syntax is very similar to the BGT syntax. Irklang is similar to sound_pool, stopvotch is similar to BGT timer, etc.
C# is the best language for easy development under Windows.
That's it.

2018-03-05 00:03:38

Hi all,
heh, as I see noone standed up for the Python, so I will do it myself. smile
My post will probably not be that objective to C#, because I never used it, I will however compare with other programming languages in general.
But first, @Jonikster, what I disagree with:
1. What do you mean by a good game? I think it matters opinion. From audiogames for example Sound RTS is made completely in Python, and imo it is the most complicated audiogame made ever, just think about all modding, translating and playing features, I don't know any audiogame with that like capabilities joined together, like in Sound RTS. But as I said, it matters opinion.
2. Be careful when writing about Python and the speed. By saying 'Python', you're not referring to the one concrete snake, but rather to a full family of snakes Pythonidae, which includes Cpython, but also Cython, Jython and many others. And from Cython for example is possible to compile directly to the native code by to C conversion. In this case, an Python program would be faster than not Java only, but also C#one I think.
Of course it's not easy and not manageable by beginner. But if you are a professional dev and you need to get maximum speed from Python, what is btw not needed in many cases, Python will not leave you.
3. About convenient enviromment I don't know, I am not using ides in general, but as far as I know there is an Pydev for Eclipse, which is popular in the Python community. But as I said, I can't judge its quality against Visual studio for example, because I don't see an advantage of any from them. big_smile

And now, my argumentation for Python:
- multiplatformity, making the same code usable on all platforms, including Raspberrypy is very pleasant.
- Pypy. I have never seen more useful development tool, to manage some kind of problems I think. It allows programmers to just gain support for routine tasks in few minutes, and lets them concentrate directly to the problems they want to solve.
I was for example experimenting some time ago with integrating eeg mind based control into the audiogame environment. When I obtained the device, there were two problems to solve in one time. First to connect eeg together with computer and read values from it correctly, second to use values to do something.
First what I did was a look on pypy, if there isn't a package to manage the first problem, so I can be sure it is solved, and correctly solved, so I can focus to the experiments. And there was one, so all I needed to do was to download it by the one command and import in one line, using was very straight forward, what is typical for Python in general, what I see as a big plus too.
Later I have get the task to port it to Android. And that task is still not finished.
Where do you think I have stopped? big_smile
In Python, I needed few minutes to get familiar with Bluetooth, in Android...
- You can now say: "Okay, but C# can do all of this too." True is I don't know, as I said I never looked into C# and I don't know, what's the state of libraries available for it. But one thing I know is, that Python, according to
https://madnight.github.io/githut/#/pul … sts/2017/4
with 15% is the second most used programming language on Github, the greatest code database in the world. C# is on 9th place, with about 3.5%.
And I have also read somewhere, that Python is the fastest growing programming language in the world, what does not sound that unreal, when we take in the Github language statistics.

So, in summary, I think the main factor deciding, whichone language is better is the taste of the user. Both languages are usable, with more or less advantages on both sides on the specific kind of problems.
For example, I develop primary in C++, because it is nearer to what I am used to than Python. There however are some situations, when problems are extremely complicated to do in C++, Speech recognition is a great example. When such problems appear, I use Python, because its massive code base will give me all needed stone blocks like microphone module, upload module, encoding module etc. already prepared and all I need to do is just to connect them in the right way, to obtain a suitable product in very short time.

Best regards

Rastislav

2018-03-05 23:51:27

There's official support for Python in Visual Studio, I think it was available since VS2015.
However, you can't compile Python to .exe with Visual Studio, you need to do it manually with PyInstaller, Py2Exe or CX_Freeze.
I'm currently learning C#, which is not a problem for me since I'm using Java at work, and these two are quite similar.
Regarding speed, I don't know. I haven't used Cython, but comparing to normal Python speed, may be C# is a bit faster and the size of executable is smaller. Python freezing tools such as Py2Exe should also include all Python libraries along with the executable, and that's why Python app distributions will be somewhat larger comparing to C# application where only executable is distributed. Dotnet is now a part of every currently maintained Windows version since Windows Vista, and thus it doesn't need to be installed separately or shipped with the application, it only needs to be updated which is done via Windows Update or your app's installer.
Regarding decorators and some other extra features, I'll just tell you one thing. I'm using Python since 2009, and I've learned decorators in 2016. The point is, you can't, and you don't need to learn every single language feature in a fiew weeks until the moment when you think that it can be useful in solving your coding problem.
I will personally always love Python because of it's clear syntax, many libraries and easy to read code. I'm experimenting with other languages mostly because I want more experience as a developer, and I don't wanna limit myself to only one programming language, because if there's something that you don't learn from one language, you will probably learn it from another.

2018-03-07 00:27:37

On my case, I love c# environment, but for various things, python every time is my second instant option when i have to think witch language I want to use.

Generally, for larger projects, i use c# because you're more ordered with your files and coding practices, but for making a scripts python is a very powerful tool, specially because you can write in a few lines a complete program, and run directly with the command line to perform or automatize these task.

In general, I don't have problems with any of these two languages. Both are powerful, both are compatible with visual studio, and both works very well with any type of project.