Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 19:42

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

Advertisement



Wich langauge is better?

Discussion on Wich langauge is better? within the CO2 Programming forum part of the Conquer Online 2 category.

View Poll Results: VB or C#
VB 7 25.00%
C# 21 75.00%
Voters: 28. You may not vote on this poll

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
Wich langauge is better?

Vote in the poll.

I know this is not the right section, but I want to know this from the pro's in this section, because the coding section is not an active section + they all talk german, so I will never understand their response, so please don't move this thread.

It is a polle C# vs VB, because I want to know wich is more efficient.
If you also can reply why. It would be appriciated alot.

Thanks.

Whats better, whats worse?
Why is C# better/worse then VB?

Thanks.

(Not Conquer Related!)
Syst3m_W1z4rd is offline  
Old 12/14/2010, 11:23   #2
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
I voted VB. Even though I don't really know how to handle VB I know that Microsoft uses it in more purposes than they do with C#...they must have a reason... Also, VB is a language supported by Windows directly, without needing to install any patches/.NET packs, so yea...VB.
-impulse- is offline  
Thanks
1 User
Old 12/14/2010, 12:04   #3
 
elite*gold: 0
Join Date: Feb 2006
Posts: 550
Received Thanks: 82
Companies use VB more because its faster to get work done = less money. they dont care about the quality of the code so they get noob vb coders to do their job.

C# is better though.
ChingChong23 is offline  
Thanks
1 User
Old 12/14/2010, 12:52   #4


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
VB is often used for small tools `cause of it`s simplicity, and you can`t really say C#>VB, all language choices should depend on the project IMO.
KraHen is offline  
Thanks
4 Users
Old 12/15/2010, 00:58   #5
 
Ian*'s Avatar
 
elite*gold: 0
Join Date: Nov 2006
Posts: 805
Received Thanks: 464


One is not better than another.
They are two of the same thing. Ask yourself which you are more comfortable with.

If you use like.. SharpDevelop it will convert your C# code into VB.NET and a few other languages. And usually it will compile successfully.
Ian* is offline  
Thanks
1 User
Old 12/15/2010, 01:47   #6
 
elite*gold: 20
Join Date: Aug 2007
Posts: 1,749
Received Thanks: 2,199
What Ian said. They're like 98% identical, if you're talking about VB.NET that is, the old Visual Basic 6 compiles directly to native code whereas VB.NET and C# both compiles to CIL code.

VB6 is out-dated though, you won't even get it to run on Windows 7 without struggle. The VB syntax is in my experience easier than C#, but it all comes down to what you prefer
IAmHawtness is offline  
Thanks
1 User
Old 12/15/2010, 03:06   #7
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
I voted D
_tao4229_ is offline  
Thanks
1 User
Old 12/15/2010, 05:01   #8
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
ok.
InfamousNoone is offline  
Thanks
1 User
Old 12/15/2010, 20:42   #9
 
elite*gold: 0
Join Date: Mar 2008
Posts: 348
Received Thanks: 366
In the past, different programming languages tended to do things in their own way. Programmers using C++ would, in all probability, make use of the types and routines provided by the MFC libraries; Visual Basic had its own built-in types and routines; non-Microsoft languages such as Delphi and Java used yet other class libraries, each of which was incompatible with each other. With the advent of .NET that has changed. No matter which programming language you use, you will have access to the same rich collection of classes and functions provided by the .NET Framework. Indeed, it is even possible to write classes in one language and derive descendant classes from them in another language. Your source code is not compiled directly into a machine code executable. Instead it is translated into MSIL.
Anyways as far as the .NET Framework is concerned, all programming languages are pretty much equal. In the past, you may have evaluated languages on the basis of their compilation and execution efficiency or their editing, design and debugging tools. But today they all would end up doing the same job for you no matter what you choose..
E.M.E is offline  
Thanks
1 User
Old 12/15/2010, 23:25   #10
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
Sorry but when it comes to pointer logic, C# take's the cake over VB .NET as VB .NET wasn't designed to support pointers (however, it can but once again -- it's not as "fast" or as "elegant" as C# when it comes down to this). At the end of the day though, I don't know any mainstream facilities that teach C# that would include pointers in the curriculum, or for that matter and tutorials (that are built to teach you C# from bottom up) that cover the matter.
InfamousNoone is offline  
Old 12/23/2010, 01:27   #11
 
elite*gold: 0
Join Date: Nov 2010
Posts: 1,162
Received Thanks: 370
Thanks all for the reply.
In the end result is c#, I guess.

Well dosn't matter anyways.

Thanks guys.
Syst3m_W1z4rd is offline  
Old 12/23/2010, 10:43   #12
 
elite*gold: 0
Join Date: Jan 2006
Posts: 158
Received Thanks: 20
yeap c# is the most complex and fully language i think c++ is the most but c# in framework 4.0 is the best with WPF interfaces try take a look here Windows Presentation Foundation - Wikipedia, the free encyclopedia
gorgone is offline  
Thanks
1 User
Old 01/01/2011, 10:44   #13
 
TekiJinn's Avatar
 
elite*gold: 0
Join Date: Jan 2006
Posts: 125
Received Thanks: 2
It's all preference, people can say one is better then the other but i've used both languages for quite awhile and they both have their merits. Visual Basic I use when I want to make my program as user friendly as possible. C# is good for multi-threaded work and what not. I voted visual basic because it is simple, effective, looks nice, and it gets the job done
TekiJinn is offline  
Old 01/01/2011, 12:00   #14
 
Lizziox's Avatar
 
elite*gold: 0
Join Date: Sep 2008
Posts: 47
Received Thanks: 8
The top 10 reasons for me why C# is better than VB.NET.


1. In C# the line ends when I type the semicolon. The practical offshoot of this is that I write code like this:

string sql = @"SELECT *
FROM SomeSuchTable
WHERE ID='WhatHaveYou'
ORDER BY ThisAndThatField ASC ";

So when someone hands you a SQL statement you can just paste it into your code and the output (i.e. carriage returns) will still keep the format. In VB.NET, you would have to write the following to keep the formatting.

dim sql as string = "SELECT *" & vbCrLf
sql += "FROM SomeSuchTable" & vbCrLf
sql += "WHERE ID='WhatHaveYou'" & vbCrLf
sql += "ORDER BY ThisAndThatField ASC "

And that's annoying.

2. Increments/Decrements. a++;a--; 'Nuff said

3. Money. No, not the data type. The green. C# developers make more money. Don't believe me? Here is the proof. Like Orwell said, War Is Peace, Freedom Is Slavery, Ignorance Is Strength and yeah, it's the same .NET framework, but Perception is Reality. Get over it. Learn it. Put it on the resume.

4. I am not sure whether this is a valid reason, but with C# I can use Borland C# Builder which sports my beloved SDI interface, a la VB3, so that you can code full screen. This interface was also available (though not by default), in VB4,5,6 and VS.NET 2002 beta 1. The SDI interface disappeared from the VS.NET product before it shipped though. Anyway, if you miss that kind of interface, you can use it in Borland C# Builder.

5. Error Catching. C# catches a lot more errors than VB.NET, such as uninitialized variables, dead code, etc...

6. You get to act really snotty to VB.NET developers, yeah! That's priceless.

7. The source code to the C# compiler is available from Microsoft and Novell. This means that you can theoretically develop apps for OSes other than Windows, such as Linux and MacOS. Thanks to Jai Lue for this tidbit.

8. C# has Operator Overloading (my favorite feature from C++). Though, via the grapevine, VB.NET will have this feature in VS 2005. Thanks to Aditya Vaze for this language delicacy.

9. Comments in C# are just better. You can do multiline comments, XML comments, single line comments, etc... Thanks to German Voronin for this.

10. Regions in C# are far better. The key here is that you can place a region inside a function, thus breaking up the implementation into logical pieces. I simply love this ability.



Here are the top 10 reasons why VB.NET is better than C#

1. # The amount of data casts and conversions in C# is gigantic. There are probably 10 casts per 50 lines of code. Most of the time these casts are totally unnecessary, like in this common example. I normally save the state of the form either to Ini file, Registry or XML file. So on application startup, I restore Form's state:

//get the form state from Ini File

//following line fails
FormWindowState eState = oIni.GetValue("FormState");

//must use cast (FormWindowState)
FormWindowState eState = (FormWindowState) oIni.GetValue("FormState");

//even this does not work
FormWindowState eState = 1;

//you have to use a cast even on simple numbers
FormWindowState eState = (FormWindowState) 1;

//finally set the value
this.WindowState = eState;

So here we have a case where Form.WindowState should accept value such as 1, but refuses to. IMO, the compiler should be able to convert on the fly. I don't mind strong typing. I do mind stupid typing. In VB.NET all the lines below work.

me.WindowState = 1
me.WindowState = val(oIni.GetValue("FormState"))



2. # The Intellisense in VB.NET is smarter than the one in C#. The most maddening example involves enums. Consider these screenshots:

C#

VB.NET

Note that in C#, you had to type out the enum type (FormWindowState), before Intellisense appeared. Which means you had to remember what it was. While in VB, the intellisense appeared right after the = sign, sparing you the having to remember the enum type belonging to the WindowState property.

Intellisense in vb.net goes beyond this. Let's say you declare your variables in mixed/Hungarian notation, and then type my code later all in lower case. VB.NET autocorrects the case. It is a quick visual confirmation that your syntax and variable names so far are correct. Thanks to Jai Lue for this insight.

3. # Optional Parameters. Even though it is syntactical sugar, it helps you code faster. 'Nuff said.


4. # With..End With construct. Does anything else need to be said? Really?


5. # Handles keyword. Currently in C# you have to setup the signature for the event handler and and then provide the function elsewhere. This is like C for god's sake. Where as in VB, you provide the description of what the function handles right in the function via the Handles keyword. The word is that C# will eventually provide anonymous methods (i.e. providing event code at signature). Will reevaluate this when we get there.

6. # In C#, you do a LOT more typing. The common consensus is that C# is much less verbose than VB.NET, That's a total misconception. Consider the following pieces of code and then count the bytes:


VB.NET


'instantiate a textbox
Dim a As New TextBox()

'Update some class
With MyClassName
.ThisProperty = "sss"
.ThatProperty = "sss"
.ID = 4
.Name = "Frank"
End With


C#

//instantiate a textbox - Word 'TextBox' had to be written twice
TextBox a = new TextBox();

//Update some class - count how many times MyClassName had to be typed???
MyClassName.ThisProperty = "sss"
MyClassName.ThatProperty = "sss"
MyClassName.ID = 4
MyClassName.Name = "Frank"




7. # Events. Extremely easy to both declare and raise in VB.NET. In C# you have to be a delegate expert. Consider the following code:

Class Example
Public Event SomethingOccured()
Public Sub Method1()
RaiseEvent SomethingOccured
End Sub
End Sub
End Class
Class Papa
Private WithEvents oExample as new Example()
Private Sub SomethingChanged() Handles oExample.SomethingOccured
...
End Sub

'or use AddHandler function
AddHandler oExample.SomethingOccured, AddressOf x
Private Sub SomethingChanged()
...
End Sub
End Class


As you can see extremely easy and no need to much with delegates which are a lot more code-intensive. Now, mind you, VB.NET still fully supports the delegates, but for 99% of the time standard events do the trick.

8. # More refined Error Handling using the Catch ... When block. See below

Do
Dim attempt As Integer
Try
' something that might cause an error.
Catch ex As IO.FileLoadException When attempt < 3
If MsgBox("do again?", MsgBoxStyle.YesNo) = MsgBoxResult.No Then
Exit Do
End If
Catch ex As Exception
' if any other error type occurs or the attempts are too many, do the following.
MsgBox(ex.Message)
Exit Do
End Try
' increment the attempt counter.
attempt += 1
Loop

Thanks to German Voronin for this.

9. # Another reason is the Switch Block(Select case) syntax. For very large state machines this comes in very handy. Reuse of a single case statement for multiple items and no break statement required.

c#

case 1
case 2
case 3
(...) // Do Action
break;
case 4
break;

vb.net

case 1,2,3
(...) ' Do Action
case 4

10. # Ah, I am still working on this...
Lizziox is offline  
Old 01/01/2011, 12:32   #15
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,001
1: I realize this is hardly a valid argument, but this could be handled easier(/less space taking) but then again you're using 'val' so...
PHP Code:
public partial class Form1 Form
    
{
        public 
Form1()
        {
            
InitializeComponent();
            
this.WindowState ParseEnum<FormWindowState>("2");
        }

        public 
T ParseEnum<T>(string Value)
        {
            return (
T)Enum.Parse(typeof(T), Value);
        }
    } 
3: C# also supports optional parameters since the release of the new .NET framework (4.0)

4:
PHP Code:
var = new TextBox
{
    
Name "Frank",
    
Text "Hello world!",
    
Location = new Point
    
{
        
10,
        
20
    
}
}; 
6:
PHP Code:
  public partial class Form1 Form
    
{
        public 
Form1()
        {
            
InitializeComponent();

            var 
Email = new Email("username""password")
            {
                
Host "imap.gmail.com",
                
Port 994
            
};
            
Email.Connect();
        }
    }
    public class 
Email
    
{
        public 
string Username;
        public 
string Password;

        public 
string Host;
        public 
int Port;

        public 
Email(string Usernamestring Password)
        {
            
this.Username Username;
            
this.Password Password;
        }
        public 
void Connect()
        {

        }
    } 
P.S I just realized I was fighting against copy/paste data. (Google: The top 10 reasons for me why C# is better than VB.NET.)
tanelipe is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Wich pets works and wich not??
08/19/2010 - SRO Private Server - 0 Replies
I was about to buy a White wolf but i remember that some pets doesn't work with bot so it would be great if someone post here wich pets works and wich doesn't with the DB-bot PD: Much as the attackers and grabbers and thx
wich bot?
07/20/2009 - Kal Online - 8 Replies
wich bots does ppls use at demon mad knights and demon armoured knights? they kill pick and behead really fast...ppls get 20k+ heads by that oO
Wich bot are u using for PWI?
03/15/2009 - Perfect World - 0 Replies
Good day all, I was curious wich bots ppl are using for Perfect World International. on the website there are a lot of bots listed (aggrobot, zPW1.26 etc etc). My question to u is, could anyone tell me wich one is working for autotarget mobs and healing ( please post link aswell). btw client for PWI is version 93, but readed that it can be helped with ntKid. Thanks in advance for ur trouble's With kind regards,
Wich Bot is the best
09/15/2008 - Silkroad Online - 5 Replies
I'm a new silkroad player and I need a bot :D wich is the best ?



All times are GMT +1. The time now is 19:43.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.