[QUOTE=Fourier;45826357]I forgive you
[editline]28th August 2014[/editline]
True, but you can always use C++ garbage collector library.
And doesn't (the new C++11 or whatever is it) support stuff like auto (var in C#) and also lambdas?[/QUOTE]
Maybe so, but most libs and code you encounter will still be heavily reliant on manual memory management. Some new features are tacked on, but it doesn't make C++ a whole lot closer to C#.
Wait, why are we arguing about C++ vs C#? I always find myself arguing this with some of my developer buddies.
My opinion about those two...
If you really need speed in some algorithm, use C++, compile to DLL and call from C#.
Everything else, C#.
[QUOTE=Fourier;45826435]Wait, why are we arguing about C++ vs C#? [/QUOTE]
People taught you where saying they where different because one is imperative and the other is functional :P Just a misunderstanding
[QUOTE=KillaMaaki;45826433]Maybe so, but most libs and code you encounter will still be heavily reliant on manual memory management. Some new features are tacked on, but it doesn't make C++ a whole lot closer to C#.[/QUOTE]
Well I think so too :)
Oh, and C++ compiles directly to assembly while C# uses IL. C# thus can be reverse engineered easily while C++, good luck.
They're both good for different uses.
Actually, that's what has me really excited about Unity's IL2CPP stuff.. the flexibility of C# with the raw speed and compiler optimizations of C++ (plus, as you mentioned Fourier, the inability to disassemble the code).
[QUOTE=cra0kalo;45825300]they are facial bones for controlling facial animation lol you should of seen them when i hadn't set a dynamic length.
[IMG]http://puu.sh/aW2Jc.jpg[/IMG]
[I][B]spiky![/B][/I][/QUOTE]
Edward Scissorhands + Pinhead
[QUOTE=Fourier;45826458]Well I think so too :)
Oh, and C++ compiles directly to assembly while C# uses IL. C# thus can be reverse engineered easily while C++, good luck.[/QUOTE]
You can decompile C++
To assembly yes, but that's besides the point :P
Does anybody know D?
It's kind of like a mix between C++ and C#, and I love it.
I'm writing a game engine in it, and I'm kind of scared of hitting the bottleneck called GC. It has a somewhat supid implementation with no aging system, but it can be disabled so whatever.
I played around with D a bit. (that sounds SO wrong). and it was kinda alright. It was indeed C++ meets C#.
Do you have any speed metrics on it by any chance? (in comparison to C#)
[QUOTE=Arxae;45826696]I played around with D a bit. (that sounds SO wrong). and it was kinda alright. It was indeed C++ meets C#.
Do you have any speed metrics on it by any chance? (in comparison to C#)[/QUOTE]
Not myself no, but according to this depending on the compiler you use you can get really close to g++.
[url]http://stackoverflow.com/questions/5142366/how-fast-is-d-compared-to-c[/url]
[url=https://github.com/GitExl/ChaosEngine]This[/url] is something I wrote in D. Granted, it's not a demanding game engine but it runs extremely fast. Garbage collection was never an issue, since I used an object pool-like system for object allocation (see src/util/objectlist.d), and avoided heap allocations in the game loop where possible.
[QUOTE=Cold;45818530][vid]http://a.pomf.se/mqotwk.webm[/vid]
Ported a fluid simulation from C to C#, really cool to play with.
C implementation runs at ~200 FPS.
C# implementation runs at ~120 FPS.
Performance drop is pretty huge, should have maybe kept it in C.[/QUOTE]
Can you also share the C# source?
I want to see if I can optimize it more.
who knows, maybe I could get it to run as fast as the C implementation!
[QUOTE=proboardslol;45825792]As someone who aspires to be a C/C++ programmers; why is that? I find C to be pretty simply in its syntax compared to higher level languages. Not that I don't like C# (it can do things that I wish I could do in C), but C is just so... elegant.[/QUOTE]
Some people prefer to do a lot of things without writing a lot of code, and others prefer to write elegantly and simpler, with less syntax to worry about and more precision and code required.
Microsoft decided that Windows Store Apps don't need to ever need to use serial connections so they removed all support. But only from Store Apps.
Time rewrite a winforms program to relay all serial data to the Store App...
[QUOTE=Fourier;45826458]Well I think so too :)
Oh, and C++ compiles directly to assembly while C# uses IL. C# thus can be reverse engineered easily while C++, good luck.[/QUOTE]
Unless you use [url=http://msdn.microsoft.com/en-us/vstudio/dotnetnative.aspx].Net Native[/url]. :v:
I mixed some old dynamic light stuff with destructible terrain stuff to make some line of sight stuff.
It's cool that I can get the area of the enemy/player which is visible, so let's say if enemy can see only a small part of the player it doesn't have to attack right away or something...
[img]http://i.imgur.com/752Xf76.png[/img]
[QUOTE=Felheart;45826888]Can you also share the C# source?
I want to see if I can optimize it more.
who knows, maybe I could get it to run as fast as the C implementation![/QUOTE]
[url]https://github.com/CFusion/RTF.NET[/url]
----
I am not completely sure where i would start if i had to optimize C# code, beyond functional optimization there is very little you could do.
C code on the other hand you could probably spend days doing micro-optimization.
[QUOTE=mastersrp;45826941]Some people prefer to do a lot of things without writing a lot of code, and others prefer to write elegantly and simpler, with less syntax to worry about and more precision and code required.[/QUOTE]
The thing is, "elegantly" and "more code required" are opposite terms to me
[QUOTE=Darwin226;45827822]The thing is, "elegantly" and "more code required" are opposite terms to me[/QUOTE]
The thing is, there will be more code required to write less code. Somewhere. Anywhere. As far as I know anyway, there isn't a straight forward way of making less code do more than it is, without having some underlying technology be more complex. So there's always that.
With C I don't have to worry too much about that in my head, so that to me is simplicity, and allows code to be elegant.
So here's my conclusion: LuaJIT is the best thing in the world.
[QUOTE=Fourier;45825497]People act like there is big difference between C++ and C#.
You know what is big difference? Imperative vs Functional.[/QUOTE]
idk I've just started Linux developing in school and C++ sure is different from when I was developing winforms applications imo.
[QUOTE=Cold;45827794][url]https://github.com/CFusion/RTF.NET[/url]
----
I am not completely sure where i would start if i had to optimize C# code, beyond functional optimization there is very little you could do.
C code on the other hand you could probably spend days doing micro-optimization.[/QUOTE]
I removed some of the unneccessary refs and outs, added some more inlining attributes and made LinearSolve use all of my cores (with Parallel.For -> no added lines of code), and I got double the framerate. I could probably optimize it further by multithreading more of it, but this was a simple 5-minute job. :v:
[QUOTE=mastersrp;45828137]The thing is, there will be more code required to write less code. Somewhere. Anywhere. As far as I know anyway, there isn't a straight forward way of making less code do more than it is, without having some underlying technology be more complex. So there's always that.
With C I don't have to worry too much about that in my head, so that to me is simplicity, and allows code to be elegant.[/QUOTE]
So, since you have NOTHING to worry about when writing assembly, shouldn't that be the most elegant?
[QUOTE=Simspelaaja;45828568]I removed some of the unneccessary refs and outs, added some more inlining attributes and made LinearSolve use all of my cores (with Parallel.For -> no added lines of code), and I got double the framerate. I could probably optimize it further by multithreading more of it, but this was a simple 5-minute job. :v:[/QUOTE]
Throwing more processing power at it by multi-threading the application, isn't the same thing as optimizing the existing code.
Hm, I'm developing a multiplayer game in Unity and one issue I'm encountering is that I'd like to ideally be able to run my game server on a separate device. My other machine is a Mac, and it seems to be absolutely allergic to file sharing with my Windows box, and uploading/downloading over Dropbox is proving to be a right pain.
There's two other options I have here:
1.) Use my tablet as the server (creating a custom build process which compiles a server-only variant of my game and pushes it to the device). In the past, getting Android to work over ADB has proven a royal pain, but if I get it working it could prove handy (hey, builtin screen for debugging!)
The downside is that my tablet is also... well, my tablet. It's got tons of other stuff clogging up the storage space, plus I'd have to connect over WiFi which isn't perhaps the fastest in my house.
2.) Pick up a cheap Android stick/board or maybe an x86 board. I'd probably load Ubuntu or something onto that and deploy a Linux build of the server to it. Problem with those is that it doesn't have a built-in screen, making debugging harder (although . The benefit is that it's a dedicated device that runs the server and really nothing but the server (well, that and the OS...), plus I could hook it up over Ethernet if I get the right board which is bound to be faster than WiFi.
[QUOTE=Cold;45828792]Passing big arrays by value rather then reference isn't gonna make it any faster, if anything its gonna make it slower, because now the whole thing is copied to the stack on function call.
Although even if you don't pass it by reference, its likely that visual studio notices, that you don't modify the data so that copying the whole thing to the stack is unnecessary, so it passes it by reference anyway.
Throwing more processing power at it by multi-threading the application, isn't the same thing as optimizing the existing code.[/QUOTE]
[URL="https://stackoverflow.com/questions/19257079/why-would-ref-be-used-for-array-parameters-in-c-sharp"]Arrays are passed by reference in C# by default[/URL].
[QUOTE=Cold;45827794][URL]https://github.com/CFusion/RTF.NET[/URL]
----
I am not completely sure where i would start if i had to optimize C# code, beyond functional optimization there is very little you could do.
C code on the other hand you could probably spend days doing micro-optimization.[/QUOTE]
Thanks.
Yeah I took a quick look at it.
There is definitely [B]a lot[/B] of room for improvement.
I'll see what I can do and report back then.
edit: Oh and as Cold said, multi-threading is just cheating. The code isn't more efficient, it just gets executed faster...
[QUOTE=war_man333;45828424]idk I've just started Linux developing in school and C++ sure is different from when I was developing winforms applications imo.[/QUOTE]
That is true. But it is because of different IDE and frameworks.
Mind that there is also big difference between C++ using framework X and C++ using framework Y.
I was talking about a syntax and semantics.
guys guys stop arguing
[I]COBOL[/I] is obviously the best language for all purposes.
[QUOTE=Simspelaaja;45828807][URL="https://stackoverflow.com/questions/19257079/why-would-ref-be-used-for-array-parameters-in-c-sharp"]Arrays are passed by reference in C# by default[/URL].[/QUOTE]
Oops. (Working in 4 language at a time can be a bitch at times)
[QUOTE=Felheart;45828895]Thanks.
Yeah I took a quick look at it.
There is definitely [B]a lot[/B] of room for improvement.
I'll see what I can do and report back then.
edit: Oh and as Cold said, multi-threading is just cheating. The code isn't more efficient, it just gets executed faster...[/QUOTE]
Please push the changes to GIT if you can be arsed.
Sorry, you need to Log In to post a reply to this thread.