C++ : Is it lots harder than c# and VB

Hi everyone,

I learned Java whilst at university and have taught 
myself c# and VB.net. I think I am ok at it.

I was thinking, these languages will probably be bigger 
in the future so I better get ready for them. But then, I 
also realised that COM is still quite important and so is 
C++. So I thought I better just try and have a look at 
C++ and COM.

And now I'm scared.

So my question is - why does C++ look so much harder than 
c#? For example :

1. The methods all have really stupid names that are hard 
to descern a function from.
2. You need to think about pointers and cleaning up 
memory.


But in my preffered languages, I dont even need to think 
about that. Why do I need to worry about these things in 
C++ and is C++ really that hard - at the moment, it looks 
as scarry as my Gran

Oh, and just how hard is it to learn COM - I've been 
looking all over the place and even the com section on 
MS's site doesnt really have that much for absolute 
beginners!

Thanks all

Simon
0
sh856531 (3)
10/4/2003 1:47:37 PM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
1431 Views

Similar Articles

[PageSpeed] 55

If you enjoyed Java, you'll probably have no problems with C++.  If looking
at it scared you, it was probably ugly source code (which you can see in
Java BTW...)  Get a good book on C++, the old "Interactive" series was great
as was the old "Object Oriented Programming in C++."  These are good books
for starters.  If you've really learned Java then you've got the major C++
hump out of the way, learning about why/what/how objects work.

    WTH

"Simon Harvey" <sh856531@microsofts_free_email_service.com> wrote in message
news:110a01c38a7e$122ff0f0$a101280a@phx.gbl...
> Hi everyone,
>
> I learned Java whilst at university and have taught
> myself c# and VB.net. I think I am ok at it.
>
> I was thinking, these languages will probably be bigger
> in the future so I better get ready for them. But then, I
> also realised that COM is still quite important and so is
> C++. So I thought I better just try and have a look at
> C++ and COM.
>
> And now I'm scared.
>
> So my question is - why does C++ look so much harder than
> c#? For example :
>
> 1. The methods all have really stupid names that are hard
> to descern a function from.
> 2. You need to think about pointers and cleaning up
> memory.
>
>
> But in my preffered languages, I dont even need to think
> about that. Why do I need to worry about these things in
> C++ and is C++ really that hard - at the moment, it looks
> as scarry as my Gran
>
> Oh, and just how hard is it to learn COM - I've been
> looking all over the place and even the com section on
> MS's site doesnt really have that much for absolute
> beginners!
>
> Thanks all
>
> Simon


0
spamsucks (94)
10/4/2003 3:50:23 PM
Simon,

> 1. The methods all have really stupid names that are hard
> to descern a function from.

I'm not sure why you say this. When writing C++ code, you can call the
methods whatever you like.

> 2. You need to think about pointers and cleaning up
> memory.

Yes, and this is a bit confusing for some. However, memory you allocated
needs to be freed--it isn't all that complicated.

> But in my preffered languages, I dont even need to think
> about that. Why do I need to worry about these things in
> C++ and is C++ really that hard - at the moment, it looks
> as scarry as my Gran

Well, if you want easy--you might try something like Visual Basic. If you
want more power and control, then you'll need to use a language that
requires you to be aware of a few more things.

C and C++ are, by far, my favorite languages. It's a personal thing so that
doesn't mean to much but what I like about them are the simplicity and
flexibility--things that don't always go together.

However, that said, I'm not sure if I'd choose to learn those languages at
this time. While COM is still important, it is on it's way out. And there
will undoubtedly be something else after .NET. So I personally think it
makes more sense to be learning things that are on the way in rather than
out. But, in the end, it depends on exactly what you want to accomplish.

Jonathan


0
jwood (1292)
10/4/2003 6:27:59 PM
Simon Harvey wrote:

> Hi everyone,
> 
> I learned Java whilst at university and have taught 
> myself c# and VB.net. I think I am ok at it.
> 
> I was thinking, these languages will probably be bigger 
> in the future so I better get ready for them. But then, I 
> also realised that COM is still quite important and so is 
> C++. So I thought I better just try and have a look at 
> C++ and COM.
> 
> And now I'm scared.
> 
> So my question is - why does C++ look so much harder than 
> c#? For example :
> 
> 1. The methods all have really stupid names that are hard 
> to descern a function from.
> 2. You need to think about pointers and cleaning up 
> memory.
> 
> 
> But in my preffered languages, I dont even need to think 
> about that. Why do I need to worry about these things in 
> C++ and is C++ really that hard - at the moment, it looks 
> as scarry as my Gran
> 
> Oh, and just how hard is it to learn COM - I've been 
> looking all over the place and even the com section on 
> MS's site doesnt really have that much for absolute 
> beginners!
> 
> Thanks all
> 
> Simon

Java and C# and VB all need huge libraries.  The libraries define the 
language and what it can (and can't) do.

C++ needs no such library.  The CPU and Win APIs define what it can and 
can't do.  C++ programs the "real" computer, which depends fundamentally 
on things like pointers and "cleaning up" memory.  The library-based 
languages program an abstract machine that is implemented by the 
library.  The abstract machines are deliberately designed to make things 
simpler, at the cost of some loss of power and performance.

Yes, C++ is lots harder.  It is most appropriately used to do work that 
is lots harder.  If all you have to respond to is user clicks then you 
probably don't need it.

-- 
Scott McPhillips [VC++ MVP]

0
scottmcp (342)
10/4/2003 6:55:43 PM
Well C++ is a lot harder, because C*, Java etc are designed to be easier.

In those languages, you are basically writing scripts which are then 
read by a real program which does the actual execution.

There is nothing wrong with this if it achieves the results you want, 
but you are limiting your potential for ever writing real programs in 
other environments.

Using pointers, freeing up memory and interfacing with devices etc are 
an integral part of the art of programming.

Simon Harvey wrote:
> Hi everyone,
> 
> I learned Java whilst at university and have taught 
> myself c# and VB.net. I think I am ok at it.
> 
> I was thinking, these languages will probably be bigger 
> in the future so I better get ready for them. But then, I 
> also realised that COM is still quite important and so is 
> C++. So I thought I better just try and have a look at 
> C++ and COM.
> 
> And now I'm scared.
> 
> So my question is - why does C++ look so much harder than 
> c#? For example :
> 
> 1. The methods all have really stupid names that are hard 
> to descern a function from.
> 2. You need to think about pointers and cleaning up 
> memory.
> 
> 
> But in my preffered languages, I dont even need to think 
> about that. Why do I need to worry about these things in 
> C++ and is C++ really that hard - at the moment, it looks 
> as scarry as my Gran
> 
> Oh, and just how hard is it to learn COM - I've been 
> looking all over the place and even the com section on 
> MS's site doesnt really have that much for absolute 
> beginners!
> 
> Thanks all
> 
> Simon

0
isemmel (236)
10/4/2003 6:56:01 PM
Excellent answers guys

Thanks very much

Simon
0
blah5928 (43)
10/4/2003 7:43:42 PM
Jonathan makes good points, but as an aside, until another method for
providing components to more 'managed' languages comes along to replace COM,
it isn't likely going anywhere soon...

    WTH

"Jonathan Wood" <jwood@softcircuits.com> wrote in message
news:ON8FTUqiDHA.1940@TK2MSFTNGP09.phx.gbl...
> Simon,
>
> > 1. The methods all have really stupid names that are hard
> > to descern a function from.
>
> I'm not sure why you say this. When writing C++ code, you can call the
> methods whatever you like.
>
> > 2. You need to think about pointers and cleaning up
> > memory.
>
> Yes, and this is a bit confusing for some. However, memory you allocated
> needs to be freed--it isn't all that complicated.
>
> > But in my preffered languages, I dont even need to think
> > about that. Why do I need to worry about these things in
> > C++ and is C++ really that hard - at the moment, it looks
> > as scarry as my Gran
>
> Well, if you want easy--you might try something like Visual Basic. If you
> want more power and control, then you'll need to use a language that
> requires you to be aware of a few more things.
>
> C and C++ are, by far, my favorite languages. It's a personal thing so
that
> doesn't mean to much but what I like about them are the simplicity and
> flexibility--things that don't always go together.
>
> However, that said, I'm not sure if I'd choose to learn those languages at
> this time. While COM is still important, it is on it's way out. And there
> will undoubtedly be something else after .NET. So I personally think it
> makes more sense to be learning things that are on the way in rather than
> out. But, in the end, it depends on exactly what you want to accomplish.
>
> Jonathan
>
>


0
spamsucks (94)
10/4/2003 8:59:48 PM
WTH,

> Jonathan makes good points, but as an aside, until another method for
> providing components to more 'managed' languages comes along to replace
COM,
> it isn't likely going anywhere soon...

Can you clarify this? Hasn't .NET done exactly this already?

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com


0
jwood (1292)
10/5/2003 2:27:34 AM
Reply:

Similar Artilces:

Fast SQL Server Stored Procedure runs slow in VB.NET
Our application uses VB.NET 2008 and SQL Server 2000. I can run the SP fast in the SQL Server Management Studio or SQL Query Analyzer window. But, when running it in the VB.NET program, it is very slow. Why is it slow in the program ? Is there anything else that I could do ? Thank you This is the VB6.NET code: Sql = "exec GetData1Min @Symbol='EUR/USD',@SeqNumLow='20100324-0000'" connectionString = "Data Source=" & _settings.DataSource & ";Initial Catalog=" & _settings.Database & ";User ID=" & _setting...

Socket sample with VC++(MFC) and C#
How can I create a simple sockets sample using a VC++ 6.0 ( MFC ) client and a C# server. Thanks. Marcelo Duarte ...

Will MS ever learn that the lost a lot of browser market share, because the MS websites and Addons are horrific?
Hello, 3 days ago I decided to stop using IE7pro, because I think this great project is dead. Therefore I try to search for addon replacements. I must admit that I had the hope that something changed on the MS websites and the Addon handling in IE, but I became very disappointed. Ask yourself MS, why a lot of users switch to Firefox, Opera, Chrome? Speed and HTML/CSS? It's only my opinion, from an IE users, but IE is faster than some other browser and apart from some stupid websites with a filter for the IE, that not allow IE users to see the site, I know only a few site that no...

Can i run VB code when a user changes Worksheets within an Excel Workbook
I have a Excel Spreadsheet with 6 worksheets in it The first sheet contains all the data and the other sheets do various things with the data (graphs etc) On the first sheet i have buttons above some of the table colums which sort the data by that colums. The buttons run VB code Now what i would be able to accomplish is if a user clicks on one of the other sheets, firstly I want to sort the data in Sheet 1 by the first column to get the data back in the correct order, otherwise the graphs are all wrong on the other sheets I need some kind of way to enable the following code to run when the...

how to move the mouse in Visual C++ 2005
Hey, I need help with this. I want to know what is the mouse position (x,y) and move the mouse (anywhere in the screen) in Visual C++ 2005. I have found a LOT of code in internet but doesn't works in my pc. I have tried SetCursorPos and GetCursorPos but I receive errors (I don't remember exact error right now...) Thanks a lot for any help...I will really appreciated. Regards, Marcelo. Those are the functions I use. Here is a snippet of code I wrote to "jiggle" the mouse to get read of a wait cursor that won't go away because the user hasn't moved the cursor....

vb for no color or transparent
I have a textbox with a fill color of white. How do I change it back to transparent/no fill using vba? Using ppt 2007. ActivePresentation.Slides(2).Shapes("MainChar").Fill.ForeColor.RGB = ? -- Mike Mast Special Education Preschool Teacher Hi, You could try, ActivePresentation.Slides(2).Shapes("MainChar").Fill.Visible=msoFalse Cheers Andy On 20/04/2010 14:34, Preschool Mike wrote: > I have a textbox with a fill color of white. How do I change it back to > transparent/no fill using vba? Using ppt 2007. > > ActivePresentation.Slides(...

Common Controls disabled VS2008/C++
Hi folks, When running the VS2008 (not SP1 Beta) C++ (MFC) Dialog Editor, the Dialog Editor controls are all enabled. However, the controls on the "Common Controls" tab of the Toolbox (and actually, it seems like all of the other tabs) are dsabled (greyed out). If I create a VB project, however, they seem to be enabled. Per some MSDN posts about the same problem, I tried both "Reset" 'ing the toolbox, and also deleting (actually, just moving) the cached toolbox files in the Local Settings folder, but nothing changed. I checked a different box with VS2005 SP1...

C#.net click event associated with database error
I would like to know what to do to solve the problem listed below: When I am debugging a C#.Net 2008 windows application and click on the 'next' button, I am getting the following error: 'An unexpected error has occurred. The 'Microsoft.jet.oledb.4.0'provider is not registered on the local machine'. I think that I may need to change some setting I have in the visual studio.net 2008 professional edition to solve this problem prior to clicking on the 'next' button. I am working on an workstation that is 64 bits, XP operating syste...

vb.net Datagridview RowValidating
Greetings, The code below never sets the current cell to the error location, allowing user to correct the mistake (see below), though does display the error message. This is activated when they press tab to leave the row (RowValidating) and the next row is populated with values from DefaultValuesNeeded I was wondering where my logic and code have failed me, instead of setting the focus to the cell containing the error it moves to the next row with the default values set but the error logo and text displayed? Thanks Rob 'Validation for day of weekends Select Case Dir...

OWC chChartTypeColumnStacked Example (Pref C#)
Hi, I am trying to built several charts for reports using OWC. I want them to be stacked column charts that would display data for a table/matrix such as Browser U1 U2 U3 Total Internet Explorer 2 6 0 8 Netscape 0 3 3 6 Other 0 6 4 10 Total 2 15 7 24 Browser type would be the category and U1, U2, U3 would be the stacked series for each browser. I have not been able to find a single example on how to create the series' correctly. I can get the chart displayed but adding series' has me stumped. I have something like this but I only ge...

Money 2000 compatible c Windows XP Professional?
Is Money 2000 Standard Edition Version 8 compatible with Windows XP Professional? Thanks. ...

Working with Excel 2003 from a Visual C++ program
I am quite new to programming. Despite that I have to write a C++ program that opens an .xls workbook, selects a specified worksheet and puts data in specified cells of the worksheet. I have found a document in the Internet that describes how to use the Excel COM model. Based on this I created a program that is able o open a specified .xls workbook and put data in specified cells in the active sheet. However I do not know how to select a specified worksheet so that I do not put the data in the worksheet that ust happens to be active when opening the workbook. How to do that? H...

Using IM with XML source adapter & VB scripting
How can you reference a field in the XML source with VB? I tried to qualify the entire path specifying the nodes ex. SourceFields ("APInvoices.InvoiceList.Invoice.InvoiceItems.LineItem.Amount) but that was not recognized by IM. Any suggestions would be helpful! ...

C# callback from native code
Hello, There's an example in .Net docs where C# delegate is called by native code ( EnumWindows - http://msdn.microsoft.com/en-us/library/d186xcf0(v=VS.71).aspx ). The doc states: >>>PASTE>>>>>>> 4.Ensure that the garbage collector does not reclaim the delegate before the callback function completes its work. When you pass a delegate as a parameter, or pass a delegate contained as a field in a structure, it remains uncollected for the duration of the call. So, as is the case in the following enumeration example, the callback function comp...

Money 2005 'C' Column
I have several bank accounts that I track on my computer using Microsoft Money 2005; I store the data online, so that it can be accessed and edited by two users. A co-worker also uses the same data online; the deposits and checks written show up correctly, no matter which of us has entered the information. What does not show up is an entry in the reconciliation column. The reconciliation is done on my system. Then, the entries that are marked with a “C,” don’t display a “C” for my co-worker. She can never tell which entries have cleared the bank. It is a puzzle why all the informa...

Rows vb statement
After using macro recording for a single insertion of a row, the recording showed this: Rows("50:50") followed by in inser command, my question is How do I make this Rows statement become Macro friendly? Maybe Activecell.entirerow.insert or Activecell.offset(1,0).entirerow.insert Rick wrote: > > After using macro recording for a single insertion of a row, the recording > showed this: > Rows("50:50") followed by in inser command, my question is How do I make > this Rows statement become Macro friendly? -- Dave Peterson ...

Create a Visio VSL add-on in C#
Can I create a VSL add-on in C# ? Thank You very much in advance ! ...

Extracting C-style string from CString
Using VC++ 7.1 How do I get a C-style buffer to a CString? With std::string I can do std::string s("HelloWorld"); printf("%s", s.c_str()); With MFC's CString (and I realise that it templated), I thought I could do CString s("HelloWorld"); printf("%s", (char *)s); printf("%s", (const char *)s); or perhaps printf("%s", (char *)s.GetBuffer()); printf("%s", (const char *)s.GetBuffer()); but nothing compiles. I have peered at the docs but I don't see what is wrong with GetBuffer() or why there is no...

My sent mail appears in the destination without text. How can i c.
My sent mail appears in the destination without text. How can i correct this situation? It happens with all my sent mails. I have secure digital signature associated to all my e-mails but I dont know if it has something to do with it. Every person i send an e-mail receives it without text but when i see in my sent mails folder the text is there. Can the problem be from my ISP provider (vodafone?)? Has anyone had this problem? How can i solve it? Can anybody helpme? Do you have a virus scanner installed which integrates itself with Outlook? Uninstall this integration part o...

Export Query to Excel in VB
Below is a code that works and what I like to do is every time I run the command the data will be created in a new worksheet? If yes, what will the code look like? This code is executed from a form. This query will run every month and will only collect data from the current month. Private Sub Command88_Click() On Error GoTo Err_Command88_Click Dim SavePath As String Dim strExport As String SavePath = "C:\MyFolder\MyFilename.xls" strExport = "MasterQry" DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, strExport, SavePa...

Removing lots of EMPTY folders
Is there a way that I can recurse a subtree of folders in OL 2002 and remove all of the empty folders? TIA B ...

More free space on drive c is needed
I have a program that requires a substantial amount of free space on drive c (system) during operation. Sometimes it exceeds the amount available. Is there a way to increase the amount of drive c free space without repartitioning? I have some free space on other drives and I am thinking about this feature of mounting ntfs volumes. How exactly is this done? <data.file@mail.ru> wrote in news:emyL2likKHA.2468@TK2MSFTNGP04.phx.gbl: > I have a program that requires a substantial amount of free > space on drive c (system) during operation. Sometimes it > exce...

Open C:/examplefile.xls or file.txt from another excel worksheet
Hey, people!! I need some help, I want to create an excel worksheet that checks which files are in a directory (C:\) and lists them in my worksheet. When I click on the listed files it takes me to the directory were they are located. If you can open the files when clicked even better!!! I consider myself average in vba now, but I need someone to tell me which function or built in procedure I should use. Thanks, Chay Chay, I'm not entirely sure everything you want to do here, but let me offer this as a start. This macro will list all the files in the "C: \" directory on ...

C# blocking soap requests
I have a c# program which conencts to a soap server written in perl. Everything works great except for one thing. C# or Perl is not closing the connection. That means that if another application wants to connect to the soap server and send requests it blocks until the visual studio program terminates. Is there a way to explicitly close the connection to the perl server to allow other connectinos to come in? I would assume this needs to be done on the C# side. Is that correct? ...

Serialization problem with .net vb client
Hello, We have a COM server dll that links with other dlls. Classes in these dlls support serialization. These dlls are built by VC6. When used by a ..net vb client, classes in the secondary dlls are unable to deserialize. We get the following warning from CRuntimeClass::Load: 'Cannot load <classname> from archive. Class not defined.' When used by a VC6 client, it works fine. Any help would be appreciated. Thanks. John I must add a correction. It only works fine when the secondary dlls are linked to a VC6 client, bypassing the COM server. A VC6 client going through the COM ser...