473,320 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

C++ or C#?

Gaz
Now that Visual Studio 2005 Express final has been released, which language
should I go with, c++ or c#? I know c++ already but I haven't done any
programming for a year or two and C# seems a much cleaner language. Does
c++ code compile more efficiently? Is c++ more flexible?

Thank you.
Nov 17 '05 #1
7 1264
On Sun, 13 Nov 2005 10:47:20 -0000, "Gaz" <a@b.com> wrote:
Now that Visual Studio 2005 Express final has been released, which language
should I go with, c++ or c#? I know c++ already but I haven't done any
programming for a year or two and C# seems a much cleaner language. Does
c++ code compile more efficiently? Is c++ more flexible?


Yes to all questions. C++ has a much better optimizer, even when
compiling managed code (C++/CLI). Plus, you can access managed and
unmanaged code & data within the same function. But C++/CLI is
certainly harder to use and uglier than C#... and I don't think the
IDE is quite as nice, either (e.g. IntelliSense from XML comments).
--
http://www.kynosarges.de
Nov 17 '05 #2
C++ or C#, if it's managed it compiles to MSIL for both..
but C++ is much more clumsy.. akthough it gices much easier access to win32
API.

"Gaz" <a@b.com> wrote in message
news:OO****************@TK2MSFTNGP15.phx.gbl...
Now that Visual Studio 2005 Express final has been released, which
language should I go with, c++ or c#? I know c++ already but I haven't
done any programming for a year or two and C# seems a much cleaner
language. Does c++ code compile more efficiently? Is c++ more flexible?

Thank you.

Nov 17 '05 #3
"Gaz" <a@b.com> wrote in message
news:OO****************@TK2MSFTNGP15.phx.gbl...
Now that Visual Studio 2005 Express final has been released, which
language should I go with, c++ or c#? I know c++ already but I haven't
done any programming for a year or two and C# seems a much cleaner
language. Does c++ code compile more efficiently? Is c++ more flexible?


One of the fundamental design goals of the .NET Framework is that is
programmable via multiple languages, any one of which is (or, at least,
should be!) just as good as any other, because they all compile to CLI.
Which language(s) you choose to program in should be, to all intents and
purposes, irrelevant. Of course, each language is syntatically different,
and some have one or two capabilities that others don't - a good example of
this is C#'s support for pointers, which is not supported in VB.NET.
However, these differences are quite small and, for the vast majority of
developers, of little significance.

So, which one(s) to choose? For me, back in 2002, the choice was easy. I'd
spent the last 10 years or so making a living as a jobbing contractor using
Visual Basic and all its derivatives - VBA, VBScript, AccessBasic, WordBasic
etc - never wrote a line of C++ in my life - so for my first couple of .NET
contracts I used VB.NET. However, it soon became clear to me that my earning
potential would be exponentially increased if I knew C# as well as VB.NET -
a quick look at the IT contract developer market showed the massive increase
in jobs available only to C# developers - so I set about learning C# too.
Luckily, a lot of my previous work had involved web development which meant
I was very familiar with JavaScript and, since C#'s syntax in certain areas
resembles JavaScript a fair bit, I found it extremely easy to pick up and
learn.

After a little while, I found that I much preferred C# to VB.NET, which is
not to say that I thought it was any better or worse than VB.NET, just that
I preferred it. Luckily, the demand for C# contract developers (in the UK,
at any rate) has increased over the years, and this trend seems set to
continue with the arrival of v2.0 of the Framework.

So, to recap:

1) if, like me, you're a freelance developer, go for the language(s) which
will earn you the most money

2) if you're an independent programmer maybe writing your own software for
sale, go for the language that you're most comfortable / familiar with

3) if you're programming "just for the fun of it", learn as many .NET
languages as you can.
Nov 17 '05 #4
In your situation, you have a real dilemma there. Both are managed, and I do
find the C# syntax to be "cleaner" (as you put it), but if you're already
familiar with C++, you may prefer to stick with what you know.

The good news is, you can use either or both. So, make a decision, and if
time and desire warrant, learn both languages. Knowing more than 1 is almost
always useful at some point!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
There's a seeker born every minute.
- Dr. "Happy" Harry Cox

"Gaz" <a@b.com> wrote in message
news:OO****************@TK2MSFTNGP15.phx.gbl...
Now that Visual Studio 2005 Express final has been released, which
language should I go with, c++ or c#? I know c++ already but I haven't
done any programming for a year or two and C# seems a much cleaner
language. Does c++ code compile more efficiently? Is c++ more flexible?

Thank you.

Nov 17 '05 #5
C#. I think it is worth the initial learning curve. I would worry less
about which syntax you use (c#, vb, c++) and more about learning .NET. You
will be far better off in the long run.

Why is so much emphasis put on syntax? I see this more from degreed
programmers. Depending on how you look at it, the code (syntax) is easily
the most insignificant part. Especially with .NET.

--

Derek Davis
dd******@gmail.com

"Gaz" <a@b.com> wrote in message
news:OO****************@TK2MSFTNGP15.phx.gbl...
Now that Visual Studio 2005 Express final has been released, which
language should I go with, c++ or c#? I know c++ already but I haven't
done any programming for a year or two and C# seems a much cleaner
language. Does c++ code compile more efficiently? Is c++ more flexible?

Thank you.

Nov 17 '05 #6
In the past such a question would start a religous war :).

The PC answer was to use the language that works best for you, and if
you came from VB it might be VB.NET and if you came from C++ if might be
C# simply because the transition was easier and the MC++ _was_ really
clunky and without a visual designer. Initially, the attempt was made so
that the environment was language agnostic so that the different
languages could produce fairly equivalent MSIL.

With VS2005, the concept of a language agnostic enviromnent is well
questionable.

MC++2.0 is the low level language that can produce more optimized MSIL
and is the clearly the language for native interop... so if you plan to
call a lot of native methods MC++2.0 is the way to go. MC++ also
supports both compile time template programming and runtime generic
programming and the semantics of a ref class on the stack.

VB.NET has the MY namespace which lets you do RAD stuff like

My.Computer.Audio.Play("C:\Beep.wav")

If My.Computer.Network.IsAvailable Then
If My.Computer.Network.Ping("http://www.microsoft.com") Then
MsgBox("Microsoft's site is available.")
End If
End If

C# is the middle ground of the "pragmatic programmer".

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #7
> In the past such a question would start a religous war :).

Go Java... forget all this .Net stuff. It's for wussies.
"Jeff Louie" <je********@yahoo.com> wrote in message
news:uj**************@TK2MSFTNGP15.phx.gbl...
In the past such a question would start a religous war :).

The PC answer was to use the language that works best for you, and if
you came from VB it might be VB.NET and if you came from C++ if might be
C# simply because the transition was easier and the MC++ _was_ really
clunky and without a visual designer. Initially, the attempt was made so
that the environment was language agnostic so that the different
languages could produce fairly equivalent MSIL.

With VS2005, the concept of a language agnostic enviromnent is well
questionable.

MC++2.0 is the low level language that can produce more optimized MSIL
and is the clearly the language for native interop... so if you plan to
call a lot of native methods MC++2.0 is the way to go. MC++ also
supports both compile time template programming and runtime generic
programming and the semantics of a ref class on the stack.

VB.NET has the MY namespace which lets you do RAD stuff like

My.Computer.Audio.Play("C:\Beep.wav")

If My.Computer.Network.IsAvailable Then
If My.Computer.Network.Ping("http://www.microsoft.com") Then
MsgBox("Microsoft's site is available.")
End If
End If

C# is the middle ground of the "pragmatic programmer".

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***

Nov 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: William C. White | last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using cURL? Our website is hosted on a shared drive and the webhost company doesn't installed additional software (such as cURL)...
2
by: Albert Ahtenberg | last post by:
Hello, I don't know if it is only me but I was sure that header("Location:url") redirects the browser instantly to URL, or at least stops the execution of the code. But appearantely it continues...
3
by: James | last post by:
Hi, I have a form with 2 fields. 'A' 'B' The user completes one of the fields and the form is submitted. On the results page I want to run a query, but this will change subject to which...
0
by: Ollivier Robert | last post by:
Hello, I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9 system. The link succeeds but everytime I try to run php, I get a SEGV from inside the libcnltsh.so library. ...
1
by: Richard Galli | last post by:
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the...
4
by: Albert Ahtenberg | last post by:
Hello, I have two questions. 1. When the user presses the back button and returns to a form he filled the form is reseted. How do I leave there the values he inserted? 2. When the...
1
by: inderjit S Gabrie | last post by:
Hi all Here is the scenerio ...is it possibly to do this... i am getting valid course dates output on to a web which i have designed ....all is okay so far , look at the following web url ...
2
by: Jack | last post by:
Hi All, What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g. select x from y where z=:parameter Which in asp/jsp would be followed by some statements to bind a value...
3
by: Sandwick | last post by:
I am trying to change the size of a drawing so they are all 3x3. the script below is what i was trying to use to cut it in half ... I get errors. I can display the normal picture but not the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.