473,803 Members | 3,095 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

learn C++ or C#

If I haven't made substantial investment in either C++ or C#, which language
would the experts recommend I become well acquainted with?

Daniel
Jul 17 '08
151 4531
On Thu, 17 Jul 2008 21:28:11 -0700, Daniel <ne******@cable one.netwrote:
Does C# have as much meticulous control over the micro matters as
C++ does?
"Meticulous control" and "micro matters" are not well-defined terminology
in the field of programming. It's not possible to answer that question
without you providing it in a more detailed, less ambiguous way.

In any case, I doubt that's a question you really need an answer to. As
has been explained previously, it really has more to do with what you're
trying to write. While there are specific differences between each
language, with only some exceptions what you can do in one, you can do in
the other. But C# is generally better-suited to dealing with .NET, while
C++ is likely to be better suited if you're having to deal with unmanaged
APIs.

So the proper choice of language has more to do with what you're going to
use it for than in differences between the languages in the abstract.

Pete
Jul 18 '08 #11
MC <fo************ **@www.ai.uga.e du.slash.mcwrot e:
"Daniel" <ne******@cable one.netwrote in message
news:OZ******** ******@TK2MSFTN GP03.phx.gbl...
If I haven't made substantial investment in either C++ or C#, which
language would the experts recommend I become well acquainted with?

Java. :)

C++ is well past its heyday. C# is (in my opinion) the best-designed of the
3 languages but is very similar to Java, which is more widely used; you
should at least be acquainted with it.
Java 1.4 and C# 1.0 were very similar, but the languages have diverged
significantly since then. Almost all the new features in C# 2.0 and 3.0
either have no real equivalent in Java (e.g. iterator blocks, nullable
types) or have very significant differences (e.g. generics).

--
Jon Skeet - <sk***@pobox.co m>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon_skeet
C# in Depth: http://csharpindepth.com
Jul 18 '08 #12
On Jul 18, 2:31*am, "Daniel" <newso...@cable one.netwrote:
If I haven't made substantial investment in either C++ or C#, which language
would the experts recommend I become well acquainted with?
It's well worth knowing both, but knowing C++ well is going to take
much more time and energy. I'd suggest learning C# first, still -
moving from C++ to C# is often more of a pain than it seems.
Jul 18 '08 #13

"Arne Vajhøj" <ar**@vajhoej.d kha scritto nel messaggio
news:48******** *************** @news.sunsite.d k...
First I will make a prediction: the .vc guys will suggest C++ and
the .csharp guys will suggest C#.

:-)
I'm a .vc guy :-)

If you want to write general business apps, then I will suggest C#.
I agree with that.

If you have special requirements for real time, embedded, device
driver programming and similar then go for C++.
Moreover, if you want to build Windows shell extensions, you should use C++.

If you want crossplatform code, you should use C++ (with proper libraries
like wxWidgets for the GUI).

If you want to build small .exe's easy to deploy (no need of huge runtime to
distribute), you should use C++ (with CRT/MFC/ATL statically linked).

If you learn C++ first, then moving to C# is a very easy path, as others
wisely wrote.
Instead, the opposite is not true.

Both languages have pro's and con's: choose the better tool for your
particular job.

Giovanni

Jul 18 '08 #14
On Jul 18, 2:31*am, "Daniel" <newso...@cable one.netwrote:
If I haven't made substantial investment in either C++ or C#, which language
would the experts recommend I become well acquainted with?
By the way, one reason why a .NET developer might want to learn C++ or
at least C is to be able to write MSI custom actions for installers
(while it's possible to create managed actions, there is a number of
issues and technical difficulties associated with them).
Jul 18 '08 #15
In article news:<OZ******* *******@TK2MSFT NGP03.phx.gbl>, Daniel wrote:
If I haven't made substantial investment in either C++ or C#, which
language would the experts recommend I become well acquainted with?
It depends what you want to do, and where you want to do it.

C++ is the more powerful language but there is more to learn, C# is
relatively simple but less powerful. OTOH there are more productivity
tools for C# (largely because it has a simpler syntax, so the tools are
easier to write).

C++ can be used to write software for a huge range of systems -- not
only Windows but also Mac, linux and others (including mini and
mainframe computers, and embedded systems). C# targets a virtual machine
architecture, so C# programs can run only on computers for which such a
runtime (a JIT compiler or an interpreter) is available -- that means
Windows, certainly, and platforms that support Mono (an Open Source
NET-compatible runtime); but not nearly so many as can run C++
programs.

C++ can be used to write system-level code: operating systems, device
drivers, etc.. Although there are research projects and proof of concept
implementation that use C# for these things, current C# implementations
do not allow C# to be used for this kind of work with mainstream OSes --
you can't write even a Windows device driver in C#. If you want to do
driver work then choose C++ (or even C).

A good implementation plan is to write your back-end code -- the
business logic of your application -- in a fast portable language (such
as C++) so that it can be built to run on the maximum possible number of
platforms, and then to write a GUI wrapper around it for each platform
on which you want to ship ... you might choose to write such a GUI
wrapper in C# for a Windows version of your software, though other
possibilities (including VB, Java, Python, etc) exist.

Alternatively you could write your application logic in a webserver
format and use your platform's browser for the GUI, which would save you
writing any platform-specific GUI code at all.

Personally, I usually write the application back-end in C++ and then
write the Windows-specific GUI wrapper in C++ using MFC ... but then I'm
from a C++ background and I just do what comes naturally.

Cheers,
Daniel.
Jul 18 '08 #16

"Daniel James"
C# targets a virtual machine
architecture, so C# programs can run only on computers for which such a
runtime (a JIT compiler or an interpreter) is available -- that means
Windows, certainly, and platforms that support Mono (an Open Source
NET-compatible runtime);
I've heard about Mono before. But I wonder: what is the level of
implementation of Mono?
Is Mono as robust as the Microsoft .NET framework implementation?
Does Mono fully support C# 3?
Does Mono fully support .NET Framework 3.5 ?

Thanks,
Giovanni
Jul 18 '08 #17
On Fri, 18 Jul 2008 11:46:56 +0200, Giovanni Dicanio wrote:

I've heard about Mono before. But I wonder: what is the level of
implementation of Mono?
Is Mono as robust as the Microsoft .NET framework implementation?
A lot of the .net framework is directly from Microsoft. A lot is
implemented a totally different way. I expect that it will be very
compliant as time progresses just not now.
Does Mono fully support C# 3?
I cannot compile anymore:

[Task:File=/home/ken/projects/Capture/Capture/inMatch.cs, Line=266,
Column=32, Type=Error, Priority=Normal , Description=Fea ture `query
expressions' cannot be used because it is not part of the C# 2.0 language
specification(C S1644)]
Does Mono fully support .NET Framework 3.5 ?
definitely not.

Mono is about portability you have to build with that in mind and you can
be fully portable. I write my test classes on Console and run them on
Linux as well. I have socket based tests and I need two machine to make
it work.

Ken
Jul 18 '08 #18
Daniel wrote:
If I haven't made substantial investment in either C++ or C#, which language
would the experts recommend I become well acquainted with?
Daniel:

As you are posting in dotnet groups, you should know that there are actually
three languages

C++
C#
C++/CLI

Up to now you have been using C++/CLI, which is the wrong choice if you want to
write GUI Windows applications, because Microsoft no longer recommends C++/CLi
for writing GUI .NET applications.

Assuming that you want to write GUI applications for Windows, you need a library.

If you use native C++, you will probably want to use the MFC library (which does
not come with VC Express. by the way). MFC is old, and not very elegant, and has
quite a learning curve. But there is a huge base of available code samples for
it, and Microsoft is once again working on improving it (after many years of
neglect). MFC is not portable to other platforms, but if you separate the
back-end of your application from the GUI, you can port the back-end to other
platforms such as MAC/linux. For me, one of the advantages of going the MFC
route is that you can use static linking, which means that you can deploy
without installing any components on the target machine.

[Note that the main newsgroups for standard C++ are microsoft.publi c.vc.language
and microsoft.publi c.vc.mfc]

If you use C#, you will use the .NET library, which is more elegant, and
probably easier to learn than MFC. If you go this route, you need to make sure
that the appropriate version of the .NET framework is installed on the target
system.

There are also hybrid methods, where you write your back-end in standard C++,
the GUI in C#, and build an interface layer using C++/CLI. This may be
appropriate if you have a large amount of legacy C++ code, but it means you have
to learn and understand three languages.

Feel free to ask more questions. This is an important decision, and you should
be sure you make the one that is correct for you.

--
David Wilkinson
Visual C++ MVP
Jul 18 '08 #19
Ken Foskey wrote:
On Fri, 18 Jul 2008 11:46:56 +0200, Giovanni Dicanio wrote:

>I've heard about Mono before. But I wonder: what is the level of
implementati on of Mono?
Is Mono as robust as the Microsoft .NET framework implementation?

A lot of the .net framework is directly from Microsoft. A lot is
implemented a totally different way. I expect that it will be very
compliant as time progresses just not now.
>Does Mono fully support C# 3?

I cannot compile anymore:

[Task:File=/home/ken/projects/Capture/Capture/inMatch.cs, Line=266,
Column=32, Type=Error, Priority=Normal , Description=Fea ture `query
expressions' cannot be used because it is not part of the C# 2.0
language specification(C S1644)]
Sounds like a command line option, or lack thereof, put you in C# 2
compatibility mode. Certainly the compiler wouldn't be describing a feature
such as LINQ query expressions if it didn't understand it.
>
>Does Mono fully support .NET Framework 3.5 ?

definitely not.

Mono is about portability you have to build with that in mind and you
can be fully portable. I write my test classes on Console and run
them on Linux as well. I have socket based tests and I need two
machine to make it work.

Ken

Jul 18 '08 #20

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

Similar topics

17
3434
by: Rob | last post by:
i know javascript, vbscript, asp css and alot more and im only 14 i was wondering which is easier to learn php or cgi. any help?
42
3722
by: Bicho Verde | last post by:
I have now free time and money to do what I want :-) I have some basic skills in programming (C, Pascal, Macromedia Actionscript) but don't know exactly what to do in the world of programming. And also I don't know exactly why would I learn Python rather than C#, C++ or Perl. Basicaly I don't know where to start, if there is much to do or if it is has it seems and there is software to everything nowadays and so doesn't make sense to spend...
55
46019
by: Elijah | last post by:
I have read many of the topics on learning C++ or Java first. It seems like everyone says something different. I would like to know if I should learn C++ or Java. First a little about myself. I know PHP, BASIC, and of course HTML. I'll be 15 years old in September. I am interested in programming GUI applications. I am also interested in programming games. I know that I should learn C++ to program games, but would learning Java make the...
30
9433
by: Rhino | last post by:
I am giving some thought to applying for some jobs that want people with Java and C++ experience. I have been writing Java for several years and am fluent enough that I don't have to get help with Java very often. I have no real C++ experience and not much C experience for that matter. However, the core Java statements are "borrowed" from C and C++ has often been called "C with classes". It seems to me that it shouldn't take very long to...
8
4053
by: Hermawih | last post by:
Hello , I want your opinion about this . In order to say it clearly , I think I have to describe it in long sentences . I could consider myself as Intermediate/Advance Access Developer ; Intermediate/Advanced Database designer . Because of the requirements , I must create Web Application . Access Pages is not suitable for that so I think about learning VB Net / ASP Net . I am
21
2865
by: TAM | last post by:
Hi, I read that ASP.NET uses VB.NET instead of VBScript. I also read that ASP.NET is a subset of VB.NET. So if I learn VB.NET first then do I have the knowledge for programming ASP.NET applications or do I need to learn both VB.NET and ASP.NET. Thank you. TAM
85
4167
by: abhi | last post by:
hi everybody am new to this group and help me to learn C
31
2637
by: anand devarajan | last post by:
hi friends, im anand im just a beginner in c learning for the past two weeksnow i can write simple prgs can anyone help me to get well known to c lang so that i should able to write even tough prgs in c
34
3164
by: pandit | last post by:
hai all, i want to become a good programmer. one of my friends ( named "arnuld", he posts here infrequently), taught me Lisp. so i am not a programming beginner. i have heard these 2 points. i want to know how : 1. C gives you a strong base of Procedural style of programming which forms the basis of learning other paradigms e.g OOP
65
5300
by: Chris Carlen | last post by:
Hi: From what I've read of OOP, I don't get it. I have also found some articles profoundly critical of OOP. I tend to relate to these articles. However, those articles were no more objective than the descriptions of OOP I've read in making a case. Ie., what objective data/studies/research indicates that a particular problem can be solved more quickly by the programmer, or that the solution is more efficient in execution time/memory...
0
10550
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10317
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5633
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2972
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.