Register for your free account! | Forgot your password?

You last visited: Today at 07:29

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Stop Coding in C#

Discussion on Stop Coding in C# within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,215
Received Thanks: 4,121
Stop Coding in C#

F# is better for what we want to do in a lot of different ways.
It's 10% - 15% faster to execute and it's easy to use Async with them.
You can also use C# libraries and .NET Framework.



I'd upload my 10-minute F# project, but it doesn't do much.
I'm not going to work on it any longer either. College classes start tomorrow.

C++ is better but if you like C# and references, use F#.
Cyah.

Sincerely,
Fang
Spirited is offline  
Thanks
2 Users
Old 08/22/2011, 00:37   #2
 
elite*gold: 0
Join Date: Jan 2008
Posts: 221
Received Thanks: 45
I don't even know CO2 but if you still depending on C# libaries and you'll use them in F# it wont be faster!
PataxX is offline  
Old 08/22/2011, 00:41   #3
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,215
Received Thanks: 4,121
Quote:
Originally Posted by PataxX View Post
I don't even know CO2 but if you still depending on C# libaries and you'll use them in F# it wont be faster!
That's what I'm saying o.o
F# is faster. Thanks for the addition though because you're right.
C# libraries will be executed in the same way as regular C#.
Spirited is offline  
Old 08/22/2011, 02:19   #4


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
Beyond the improvements in parallel programming and async/similar systems the languages performance is near enough the same as C# only the syntax for it is awful, so chances are while you may be able to get improvements you wont be able to understand the code your trying to write anyway.

I looked at F# as a scripting language because apparently it can be used as one and a few people had suggested it and it is just a horrible language =/
Korvacs is offline  
Old 08/22/2011, 07:13   #5
 
xBlackPlagu3x's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 286
Received Thanks: 71
Quote:
Originally Posted by Korvacs View Post
Beyond the improvements in parallel programming and async/similar systems the languages performance is near enough the same as C# only the syntax for it is awful, so chances are while you may be able to get improvements you wont be able to understand the code your trying to write anyway.

I looked at F# as a scripting language because apparently it can be used as one and a few people had suggested it and it is just a horrible language =/
Totally right about the syntax. If you can understand it however, you should use whatever makes **** faster, right? As long as it is stable and you know what you're doing. (If I could make a server out of sarcasm, I'd have the best server on the forum for example)
xBlackPlagu3x is offline  
Old 08/22/2011, 07:16   #6
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Quote:
Originally Posted by Korvacs View Post
Beyond the improvements in parallel programming and async/similar systems the languages performance is near enough the same as C# only the syntax for it is awful, so chances are while you may be able to get improvements you wont be able to understand the code your trying to write anyway.

I looked at F# as a scripting language because apparently it can be used as one and a few people had suggested it and it is just a horrible language =/
F# syntax looks so ugly.

Stop coding in F#.
The performance in C++ is much better.
See where I'm going?

Also OOP in F# is really ****:


Also:


As c# is procedural and F# is functional, hence the name F#.

"C# has some implicit conversions that F# cannot afford because of type inference."
^ I use implicit conversion a lot.
BaussHacker is offline  
Old 08/22/2011, 12:14   #7
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Here's a nice idea, if u are really going to use F, use it only where its better than C# and import it into your solution. You are able to call from C# to F# and the other way around F# and C#. Apparently F# has better performance @ math. (I am not going to take this advice because I really don't like the syntax.)
-impulse- is offline  
Old 08/23/2011, 01:24   #8


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,434
Received Thanks: 1,147
Quote:
Originally Posted by -impulse- View Post
Here's a nice idea, if u are really going to use F, use it only where its better than C# and import it into your solution. You are able to call from C# to F# and the other way around F# and C#. Apparently F# has better performance @ math. (I am not going to take this advice because I really don't like the syntax.)
Yes, one advantage of .net is that you can use any language you want for your library and calling them. But for the faster thing. F# will produce a bytecode like C++/CLI or C#. I don't think it will produce something faster. Except if at the generation, F# will be more optimized than other language.

And yes, I agree, F# syntax is really ugly.
CptSky is offline  
Old 08/23/2011, 02:11   #9
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,215
Received Thanks: 4,121
Yah, I'm thinking that I'm going to do major math in F# and import them into my C# source using libraries. I really don't like F#'s syntax at all.
Spirited is offline  
Old 08/23/2011, 08:57   #10
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Quote:
Originally Posted by Fаng View Post
Yah, I'm thinking that I'm going to do major math in F# and import them into my C# source using libraries. I really don't like F#'s syntax at all.
No no. Stop coding C#. I want to see you do a source in F#.
BaussHacker is offline  
Old 08/23/2011, 09:02   #11
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,215
Received Thanks: 4,121
Quote:
Originally Posted by BaussHacker View Post
No no. Stop coding C#. I want to see you do a source in F#.
I don't think I can do an entire source in F# yet.
Plus, I'm starting C++ tomorrow.
.-.
Spirited is offline  
Old 08/23/2011, 09:14   #12
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Quote:
Originally Posted by Fаng View Post
I don't think I can do an entire source in F# yet.
Plus, I'm starting C++ tomorrow.
.-.
F# is really fucked, just look at the compiler source code. It's like lolwut.

And C++ is amazing :3







Teach Yourself C++ In 21 Days

(download)

Thinking in C++ vol1/vol2 (Get these only if you have some previous programming experience)



Microsoft Visual C++ Beginners Guide


Various C++ books:


Videos:





STL tutorial


Microsoft Visual C++ .NET tutorial


Windows compilers:





(I strongly suggest Code::Blocks or DevC++.)

Linux compilers:
BaussHacker is offline  
Thanks
1 User
Old 08/23/2011, 11:42   #13
 
xBlackPlagu3x's Avatar
 
elite*gold: 0
Join Date: Jan 2011
Posts: 286
Received Thanks: 71
Quote:
Originally Posted by BaussHacker View Post
F# is really fucked, just look at the compiler source code. It's like lolwut.

And C++ is amazing :3







Teach Yourself C++ In 21 Days

(download)

Thinking in C++ vol1/vol2 (Get these only if you have some previous programming experience)



Microsoft Visual C++ Beginners Guide


Various C++ books:


Videos:





STL tutorial


Microsoft Visual C++ .NET tutorial


Windows compilers:





(I strongly suggest Code::Blocks or DevC++.)

Linux compilers:
a7a, someone's a little happy huh? ^.^

I don't understand the logistics of C++ and why it's better, but not many will argue against that fact that it is better. (Except for some who say C is better) I personally find F#'s syntax like I find a pile of shit. Disgusting. Clean it up microsoft.
Let var program_langauges = enoughForOnce;

Like what I did there?
xBlackPlagu3x is offline  
Old 08/23/2011, 11:57   #14
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Quote:
Originally Posted by xBlackPlagu3x View Post
a7a, someone's a little happy huh? ^.^

I don't understand the logistics of C++ and why it's better, but not many will argue against that fact that it is better. (Except for some who say C is better) I personally find F#'s syntax like I find a pile of shit. Disgusting. Clean it up microsoft.
Let var program_langauges = enoughForOnce;

Like what I did there?
C++ can do almost anything C can and most C++ compilers compiler C perfect.
C++ was derrived from C. C does not support classes, but is struct-based, where C++ support both. Not too sure about C.

The performance in C++ is better than C#, because it's native and does not require any frameworks (Only if you use managed, which I don't recommend at anytime!). It can run on all OS's Windows, Linux, Mac etc. It has a huge library of a lot things + it can work with low level things, however C is better to work with, if you want to work with hardware. C++ is one of the main language in game developement, however Python has got a lot popular in game programming as well, games such as Battlefield is coded in Python and a lot other popular games. C++ is handling things much better, but it's also a harder language as well. I may not be 100% correct about what I say, but it's how I see the things. It doesn't matter much in private server development, because the performance may be 10% better or something, unless you really hard code the things. Those 10% are not something you really need here, because if you know what you do, then you can get a fine or almost as good performance in C#, but if you were serious about developing a game or whatever, then those 10% better performance can do a lot. C# is good for the reason you can develop something fast, where in C++ it will take much longer time, but once you get a grab around C++, then you will like it.
BaussHacker is offline  
Old 08/23/2011, 13:35   #15
 
unknownone's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
The stuff about F# being faster is really nonsensical - it compiles down to the same thing as C# (CIL) and runs on the same VM. The so-called performance gain is not some inherent property of the language - it's due to a shift in style of programming - one where you don't modify state.

The core concept of functional programming is that state is immutable. If you wish to modify a value, you don't, you instead call a function which returns the newer value. Even operations like adding an item to a list are immutable, so instead of mutating the list, you return a new list with the new element added. It might seem slow to do such thing, but there are numerous benefits to it. Mutable state is the devil and must be avoided, at whatever extra cost.

Well, not strictly true in F#, since it's mutli-paradigm and can use mutable structures you're familiar with in C#, and you *can* introduce mutable state into F# with the mutable keyword (although highly discouraged.)

There are reasons why F# syntax is the way it is, which is certainly alien to C# users. You do get used to it though, and at some point you'll not want to go back to C# - the syntax of F# is more compact, and you can do more in less.

As for the improved use of async in F#, that's largely true, although the next version of C# will have similar capabilities, which you can already try out with the - two new keywords, async and await, which add a lot of capability. The C# approach to this problem is a lot less flexible than the F# approach though - as async in F# is not a built in language feature, but an application of a more powerful feature, workflows. These can do a lot more than just async.

On using F# to write a server - someone has already mentioned that a mixed approach would be suitable. F# alone isn't really ideal for a game server, because a game server happens to be based on a huge collection of mutable state - something actively discouraged in F#. Although a message passing approach can be suitable for solving those problems (But then, there are better languages than F# for message passing.)

I would recommend every keen C# programmer also learns F# anyway, even if they don't intend to write complete applications in it.

Quote:
Originally Posted by BaussHacker View Post
C++ can do...
The problem with C++ is it's not type-safe, it only pretends to be. You can nuke the type safety anywhere. (Although the same is kind of true for C# with reflection.)

The other problems are lack of higher level features like lambdas, reflection, coroutines, and lack of a standard threading model. A lot of these features have been added and finalized, but the new specification is not yet published, and no compiler has fully implemented the new spec. You can get parts of the new version of C++ in MSVC++, GCC and Clang though.

And then comes the problem with libraries. There are many, but they are generally all incompatible with each other, or have some essential features missing. You end up juggling through many libraries to get exactly what you want. (And as for running on all platforms - that's a joke, due to the library situation). Actually C# is way easier to port between major platforms now, due to more consistent libraries.

To give a library example, take boost::asio for networking. It's been considered a defacto standard for async networking in C++ due to it's portability and ease to use. The problem? It uses boost::shared_ptr<>, which is incompatible with the now standardized (and massively improved) std::shared_ptr<>. Meaning, whenever you need boost, you can't use some standard library features which are incompatible.

I was trying to get back into C++ after years hiatus learning and using C#, but the number of problems just put me off. It's in an awkward state until the C++0x specification is implemented properly in compilers, and many libraries, particularly boost, shift to using the new smart pointers and other newer features of the standard library. Then there's the tooling - IDEs, debuggers, profilers etc need updating to work with the new language. If all that is done, the language will return to a state where it can compete with C# in terms of high level abstractions.

Oh, and as for Battlefield using Python - it only uses small amounts of it. The game engine will still be written in a low level language like C or C++, and languages like Python are only used to script some game logic, AI and such, which doesn't require intensive computation. Python is very slow compared to even C#, let alone C++, and you'd be lucky to get 1 frame per second of high quality 3d graphics in it alone.
unknownone is offline  
Thanks
7 Users
Closed Thread


Similar Threads Similar Threads
Stop people from hitting multiple stakes in TG/Stop weapon skill
12/06/2007 - CO2 Exploits, Hacks & Tools - 21 Replies
Let me start off by saying this is a pretty dirty trick! But if you really don't like someone you can stop them from getting their max exp in TG. Explained: When someone uses a club/wand/FOH/etc in TG, it hits multiple stakes. You can make it so it doesn't hit a certain stake(s). This is easiest achieved by using the #alone feature in proxy. Use the #alone feature and stack on top of the stake you wish for the person not to hit. That's it! Their skill isn't hitting the stake(s) for some...



All times are GMT +2. The time now is 07:29.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.