WANT TO KNOW BEST LANGUAGE OF .NET

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

33 Replies - 9921 Views - Last Post: 13 October 2011 - 07:56 PM

#16 blue_elephant  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 15-September 11

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 15 September 2011 - 12:46 AM

View PostMANASWIMEHARKURE, on 20 July 2011 - 07:56 PM, said:

ANY IDEA OF TUTORIALS !!!!!!!!!!!
I MEAN BEST BETWEEN VB.NET,C# AND ALL THAT...


Learn C# then VB.net will be just a walk to a park for you, I'm sure :)
Was This Post Helpful? 0
  • +
  • -

#17 zem107  Icon User is offline

  • D.I.C Head

Reputation: 7
  • View blog
  • Posts: 84
  • Joined: 10-April 11

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 15 September 2011 - 01:00 AM

C# is better than VB in the long run. VB is easier to learn right away and of course you can do plenty with it but it won't be the best to create full fledged applications. You can start off with it, but I wouldn't recommend it. Now C# on the other hand gives you much more power. Plus it's easier to make sharp turns with it. This is a programming language that will allow you to do more. Also, it is easier to get hired by a company if you know C#.
Then there is C#'s and VB's little brother over there in the corner, F#. F# is a functional programming language, which means you would be steering a way from common programming habits and tactics. Things are done differently in F#, but if you do it right, it can be just as powerful as C#. But companies don't really look for people who know F#. So if you are going to go with F#, as Jason Derulo once said, you'll be riding solo.
Was This Post Helpful? 0
  • +
  • -

#18 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 15 September 2011 - 05:05 AM

View Postzem107, on 15 September 2011 - 04:00 AM, said:

C# is better than VB in the long run. VB is easier to learn right away and of course you can do plenty with it but it won't be the best to create full fledged applications.


The company I work for has written numerous, "full fledged" applications in VB.Net. These include projects that cost more than $200,000 to develop. That statement is a crock.

Quote

You can start off with it, but I wouldn't recommend it. Now C# on the other hand gives you much more power. Plus it's easier to make sharp turns with it. This is a programming language that will allow you to do more.


VB.Net can do 99% of everything C# can do. C# can do 99% of everything VB.Net can do. Also, what does "sharp turns" mean? Are you driving a car with C#?

Quote

Also, it is easier to get hired by a company if you know C#.


Go look at the job market. There are PLENTY of jobs for both C# and VB.Net developers.

Neither language is "better" than the other. It's simply personal preference to the syntax. Both can do almost the exact same things the other can do(with a few exceptions both ways).
Was This Post Helpful? 2
  • +
  • -

#19 ???  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 48
  • Joined: 25-November 10

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 16 September 2011 - 02:05 PM

Thank you! I am an amateur VB.NET programmer and I've always been annoyed be people who say C# is better, if someone uses C# because they like the C-based syntax that's just fine but as I said before

Quote

Microsoft Intermediate Language (MSIL)


They both compile to MSIL and neither language uses MSIL's full potential, such as:
  • VT Tables for unmanaged exports
  • Directly referencing/linking modules (.netmodule)
  • Specifying any method as the entry point
  • Certain OpCodes such as calli or ldftn
  • Directly inheriting from System.ValueType (Structures)


And until either C# or VB.NET can do these I treat them as equals!
Was This Post Helpful? 0
  • +
  • -

#20 Frinavale  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 203
  • View blog
  • Posts: 776
  • Joined: 03-June 10

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 13 October 2011 - 08:36 AM

I work professionally with VB.NET
All of my side projects are done in C# so that I'm familiar with the syntax etc.

I know I should probably ask this in my own thread but this question just came to mind while I was reading this thread...it's for the C#ers out there.

When I'm working in Visual Studio on a .vb code file, there's 2 comboboxes just under the tabs for the files that are open. When I'm working in VB.NET the first combobox contains all of the objects/controls/variables declared for the code. If you select one, the second combobox is populated with the events for the thing selected. If you select an event, then either a code block is generated for you that handles the event you selected or you are taken to the code block that handles the event.

When I'm working on a .cs file it's different...I'm unable to quickly generate a method that handles the event that I want to handle while I'm in the .cs file. I either have to look up the event to see what method parameters are required to handle the event, or I have to do something like double click the button in the designer to generate a method that handles the event.

Is there a way to quickly generate a block of code that handles an event while working in a .cs file...similar to how I can achieve this while working in a .vb file?

-Frinny

This post has been edited by Frinavale: 13 October 2011 - 08:37 AM

Was This Post Helpful? 0
  • +
  • -

#21 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 13 October 2011 - 09:47 AM

View PostFrinavale, on 13 October 2011 - 11:36 AM, said:

Is there a way to quickly generate a block of code that handles an event while working in a .cs file...similar to how I can achieve this while working in a .vb file?

-Frinny


If I need to quickly do an event, I will just write the code to manually subscribe to the event, which will create the event handler method. Then I delete the line of code. Now I have my event handler.

Other times, I will just manually subscribe to the method in the constructor and leave the code there so I don't have to go into the designer.
Was This Post Helpful? 0
  • +
  • -

#22 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8363
  • View blog
  • Posts: 31,059
  • Joined: 12-June 08

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 13 October 2011 - 09:51 AM

If I am feeling particularly lazy I just double click the event I need in the control's properties on the designer (yes.. yes.. not in the cs).
Was This Post Helpful? 0
  • +
  • -

#23 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 13 October 2011 - 11:09 AM

My work PC is pretty slow, so for me, bringing up the designer can take upwards of 30 seconds for it to render and allow me to click.
Was This Post Helpful? 0
  • +
  • -

#24 Frinavale  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 203
  • View blog
  • Posts: 776
  • Joined: 03-June 10

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 13 October 2011 - 02:33 PM

I rarely work with in designer mode...it's slow.

View Posteclipsed4utoo, on 13 October 2011 - 04:47 PM, said:

If I need to quickly do an event, I will just write the code to manually subscribe to the event, which will create the event handler method. Then I delete the line of code. Now I have my event handler.


This sounds like what I'm doing currently?
Maybe I'm missing your point.

If I want to handle the ... I donno... the DataGridView RowsAdded Event for a DataGridView called "myGrid", in C# I would have to manually type out the function to do it.

Like So:
private void myGridView_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
  //stuffs
}


In this case e is not simply an EventArgs and so I had to go to the MSDN documentation on the event and find out what e is so that my method parameters are correct.

I find this time consuming and get kind of annoyed because in the IDE for VB.NET I don't have to do this.
There has to be an easier way of doing this.

-Frinny
Was This Post Helpful? 0
  • +
  • -

#25 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 8363
  • View blog
  • Posts: 31,059
  • Joined: 12-June 08

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 13 October 2011 - 02:45 PM

Wow.. what sort of ancient beasts are you people working on?! Put down the 1996 Gateway towers and enjoy the new tech!

The only other option would be where you add event handler to the object.. if you start typing:
button3.Click += 

and then right there.. right after the equals sign.. I hit tab twice I generates the rest of the event handler, names it, and makes my method for me.

        public Form1()
        {
            InitializeComponent();

           button3.Click += new EventHandler(button3_Click);
  }

        void button3_Click(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }




FYI Visual Studios Pro 2010.
Was This Post Helpful? 2
  • +
  • -

#26 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2216
  • View blog
  • Posts: 9,351
  • Joined: 29-May 08

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 13 October 2011 - 04:23 PM

View PostCodingSup3rnatur@l-360, on 23 August 2011 - 07:41 PM, said:

Quote

..and offers some keywords not available in VB .NET such as 'yield').


The iterator pattern through the use of yield is actually now supported in VB.NET (about time too I think!) as part of the new async pattern download. I personally recommend C# though, of course. VB.NET's syntax doesn't agree with me ;)


vb.net allows Await inside of a Try ... Catch block, C# doesn't

C# has to use the old implementation of iterators, to keep backwards compatibility, whereas VB.Net uses the same infrastructure used for its async implementation. This has allow it to do something C# (currently) can't do of Iterator Lambdas.

A simple example of an Iterator Lambda
    Dim numbers = Iterator Function()
                    For x = 0 To 99
                      Yield x
                    Next
                  End Function
    Dim ave = numbers().Average()



Nor does C# have XML Literals, and VB.net does. Try work with XML in C# and then in VB.net, you'll possible experience a conversion.

This post has been edited by AdamSpeight2008: 13 October 2011 - 04:28 PM

Was This Post Helpful? 0
  • +
  • -

#27 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 13 October 2011 - 04:50 PM

View PostFrinavale, on 13 October 2011 - 05:33 PM, said:

If I want to handle the ... I donno... the DataGridView RowsAdded Event for a DataGridView called "myGrid", in C# I would have to manually type out the function to do it.

Like So:
private void myGridView_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
  //stuffs
}


I do exactly what modi123_1 states. Using IntelliSense helps with completing the Event handler with the correct Event Args.

View Postmodi123_1, on 13 October 2011 - 05:45 PM, said:

Wow.. what sort of ancient beasts are you people working on?! Put down the 1996 Gateway towers and enjoy the new tech!


I have been begging, but no dice. My home PC is a quad-core with 8GB RAM which can open VS2010 from a cold start in under 10 seconds. At work, that same process takes almost a minute. I've asked for me(and the other developer) to get a new PC, but I get shot down every time. It sucks that my home PC, which I built for $550(keeping a lot of old piece I didn't need to replace) will run circles around the PC I get paid to use.

View PostAdamSpeight2008, on 13 October 2011 - 07:23 PM, said:

View PostCodingSup3rnatur@l-360, on 23 August 2011 - 07:41 PM, said:

Quote

..and offers some keywords not available in VB .NET such as 'yield').


The iterator pattern through the use of yield is actually now supported in VB.NET (about time too I think!) as part of the new async pattern download. I personally recommend C# though, of course. VB.NET's syntax doesn't agree with me ;)


vb.net allows Await inside of a Try ... Catch block, C# doesn't


I've seen it demoed. Possible that it didn't allow it in the developer preview, but it's been added. I swear I watched a video where they specifically talked about how using the new await keyword allows you to do try/catch just like synchronous code. I think it was one of the BUILD sessions.
Was This Post Helpful? 0
  • +
  • -

#28 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2216
  • View blog
  • Posts: 9,351
  • Joined: 29-May 08

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 13 October 2011 - 05:55 PM

eclipsed4utooI'd be interest to watch that session video if you can find it. I got my information for the follow MSDN Magezine Article

This post has been edited by AdamSpeight2008: 13 October 2011 - 05:57 PM

Was This Post Helpful? 0
  • +
  • -

#29 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 13 October 2011 - 06:27 PM

Here you go...

http://channel9.msdn...D2011/TOOL-810T

About 33 minutes in, they show code with awaits inside of a try catch.

Also this link..

http://msdn.microsof...e/hh456403.aspx

If you scroll down to the asynchronous methods section, it shows code with await in a try/catch.

lol...we linked to the same article on MSDN. Notice down in the "Asynchronous Methods" section, it has this code...

static async Task<byte[]> TryFetchAsync(string url)
{
  var client = new WebClient();
  try
  {
    return await client.DownloadDataTaskAsync(url);
  }
  catch (WebException) { }
  return null;
}


Was This Post Helpful? 0
  • +
  • -

#30 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,957
  • Joined: 21-March 08

Re: WANT TO KNOW BEST LANGUAGE OF .NET

Posted 13 October 2011 - 06:42 PM

Even this link shows that it was available almost a year ago. So I am not sure where you got that await can't be used inside a try block in C#.

http://www.interact-...sync-exceptions
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3