473,694 Members | 2,815 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 4418
On Jul 18, 1:52*pm, Pavel Minaev <int...@gmail.c omwrote:
On Jul 18, 1:36*pm, Daniel James <wastebas...@no spam.aaisp.orgw rote:
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.

I disagree about the "business logic in C++" part. In practice,
standard C++ tends to be too low-level, verbose, and overcomplicated
for many common patterns that arise when developing a typical business
layer in many desktop and LOB applications. I'd still recommend C# for
that.

Leave C++ for tightly optimized algorithm implementations , device
drivers, shell plugins, MSI custom actions, etc.
On the low level stuff. What exactly is the "lowest" level in Windows
C++. I don't mean assembly or machine language. I mean if I wanted
to know how graphics are really drawn on the screen. What would I
look at? I know I can use C++ to createwindow or something like it,
but how is it doing it? Is that part in C or C++? Is that the hidden
source code that Microsoft uses?

Thanks.
Jul 18 '08 #31
On Fri, 18 Jul 2008 11:00:29 -0700, jmDesktop <ne***********@ gmail.com>
wrote:
On the low level stuff. What exactly is the "lowest" level in Windows
C++.
First, let's straighten out some terminology: I don't feel that there's
any such thing as "Windows C++". C++ is a language, Windows is an
operating system with an API (or, a lot of different APIs, depending on
how you look at it :) ).

The majority of the Windows API has nothing at all to do with C++. It's
all accessible by C or other similar purely procedural, non-OOP
languages. Even where the Windows API starts to look like C++ (e.g. COM,
GDI+), you can in fact get by without C++ albeit with more complicated
code (since you have to write explicitly the things that C++ would do for
you).

So it's important to be clear about whether you're talking about the
Windows API and if so what part, or if you're talking about a language and
if so, why it is a particular language is of particular interest.
I don't mean assembly or machine language. I mean if I wanted
to know how graphics are really drawn on the screen. What would I
look at?
That's a pretty vague question. The most literal answer is "the graphics
driver". That's the part of the operation system that actually interfaces
directly with the video hardware, and it's the only thing that really
knows "how graphics are really drawn on the screen".
I know I can use C++ to createwindow or something like it,
CreateWindow() doesn't draw graphics. It just sets up an OS object that
provides for a specific kind of way to draw graphics.
but how is it doing it?
How is what doing what? That's a lot of pronouns without any clear
antecedent.

Pete
Jul 18 '08 #32
David Wilkinson wrote:
Ben Voigt [C++ MVP] wrote:
>ATL/WTL follow modern C++ principles much better than MFC, and should
probably be the library of choice for C++ Windows-only GUI.

Ben:

Yes, I think about this sometimes. But I am not sure that WTL
provides as many features as MFC, and it is not supported by
Microsoft, which makes me nervous. I also have a huge investment in
MFC, both in knowledge and code base. I wish MFC were more elegant,
but I have gotten used to it.
I guess I didn't actually say "for new C++ code". I meant to though. There
are certainly good reasons to keep an existing MFC application as MFC that
probably outweigh any benefits of WTL.
>
If this old programmer is going to learn something new, I think it's
going to be C# and .NET.

Jul 18 '08 #33
On Jul 18, 2:20*pm, "Peter Duniho" <NpOeStPe...@nn owslpianmk.com>
wrote:
On Fri, 18 Jul 2008 11:00:29 -0700, jmDesktop <needin4mat...@ gmail.com*
wrote:
On the low level stuff. *What exactly is the "lowest" level in Windows
C++.

First, let's straighten out some terminology: I don't feel that there's *
any such thing as "Windows C++". *C++ is a language, Windows is an *
operating system with an API (or, a lot of different APIs, depending on *
how you look at it :) ).

The majority of the Windows API has nothing at all to do with C++. *It's *
all accessible by C or other similar purely procedural, non-OOP *
languages. *Even where the Windows API starts to look like C++ (e.g. COM, *
GDI+), you can in fact get by without C++ albeit with more complicated *
code (since you have to write explicitly the things that C++ would do for*
you).

So it's important to be clear about whether you're talking about the *
Windows API and if so what part, or if you're talking about a language and *
if so, why it is a particular language is of particular interest.
I don't mean assembly or machine language. *I mean if I wanted
to know how graphics are really drawn on the screen. *What would I
look at?

That's a pretty vague question. *The most literal answer is "the graphics *
driver". *That's the part of the operation system that actually interfaces *
directly with the video hardware, and it's the only thing that really *
knows "how graphics are really drawn on the screen".
I know I can use C++ to createwindow or something like it,

CreateWindow() doesn't draw graphics. *It just sets up an OS object that *
provides for a specific kind of way to draw graphics.
but how is it doing it?

How is what doing what? *That's a lot of pronouns without any clear *
antecedent.

Pete
How is a windows drawn on the screen? Is that where the OS provided
APIs come in (we don't need to know how they work)?
Jul 18 '08 #34
Ben Voigt [C++ MVP] wrote:
I guess I didn't actually say "for new C++ code". I meant to though. There
are certainly good reasons to keep an existing MFC application as MFC that
probably outweigh any benefits of WTL.
No, I'm certainly not going to rewrite my existing MFC applications. But even if
I were to start a new GUI application, I would probably go with MFC because I
know what to do, and have a bunch of supporting code ready to go, etc.

To use WTL or C#/.NET I would have to learn a bunch of stuff, and of the two I
think I would go with C#.

Fortunately most of my consulting work is cross-platform non-GUI C++, si I do
not need to worry about this. The code is developed in Visual Studio, but runs
as a console application in various linux/Unix systems, as well as Windows. My
client also wraps it in C++/CLI for Windows GUI with C#, but I am not
responsible for that.

--
David Wilkinson
Visual C++ MVP
Jul 18 '08 #35
On Fri, 18 Jul 2008 11:59:48 -0700, jmDesktop <ne***********@ gmail.com>
wrote:
How is a windows drawn on the screen? Is that where the OS provided
APIs come in (we don't need to know how they work)?
Again, it depends. The question is too vague to answer, because there are
a variety of ways a window could be drawn on the screen.

That said, for the typical, mainstream Windows application, yes...the OS
itself provides the implementation that actually draws the window-specific
graphics on the screen. This includes things like the frame, titlebar,
menu, scrollbars, etc.

An application uses this built-in functionality, and then optionally
provides its own customized drawing for the "client" area of the window.
Where it doesn't provide customized drawing, it usually simply adds "child
windows" (in a .NET Forms application, this is in the form of Control
sub-classes) to the main window, and each child window implements its own
drawing (again, as part of the OS API and implementation) .

Pete
Jul 18 '08 #36
Daniel wrote:
What is MSI? What do you mean by "MSI custom actions"?
http://www.google.com/search?q=MSI+custom+actions

The very first hit explained it to me, who hadn't heard
the term before either.
Daniel
Schobi
Jul 18 '08 #37
Actually, VB.NET usage has surpassed C#. Thought I would point that out,
this came from a forester survey if memory serves me correctly.

--

Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Download OWC Black Book, 2nd Edition
Exclusively on www.lulu.com/owc $15.00
Need a free copy of VSTS 2008 w/ MSDN Premium?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
"Larry Smith" <no_spam@_nospa m.comwrote in message
news:#q******** ******@TK2MSFTN GP02.phx.gbl...
>I meant which of the two languages C++ or C# should I pursue, if I don't
already have projects I have to support in either one. If I I have to
give support for an application I created in one of those two languages,
then that is the language I have to be most familiar with. Once I use
the language in a substantial project I have to support, I am committed
to that language.

This is a religious issue and it really depends on what you plan on doing.
That said, for "general-purpose" programming in the Windows world, C# is
usually the way to go these days IMO. I believe the trend has been
strongly moving in that direction for a period of years now. Note (FWIW)
that I spent many years in the C++ trenches.
Jul 19 '08 #38
Pavel Minaev wrote:
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).
There are several type of code where C++ is either better or
plain necessary.

But is "write MSI custom actions for installers" really a common task ?

Arne
Jul 19 '08 #39
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.
AFAIK then no code at all in Mono comes from Microsoft.

Arne
Jul 19 '08 #40

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

Similar topics

17
3427
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
3697
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
45989
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
9414
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
4043
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
2848
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
4107
by: abhi | last post by:
hi everybody am new to this group and help me to learn C
31
2606
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
3138
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
5254
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
8552
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8971
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
8818
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
8812
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7650
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...
0
5825
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
4332
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...
1
2992
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
1970
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.