 |
 |
C# and C++
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Location: Australia
Status:
Offline
|
|
|
(Last edited by IUJHJSDHE; Jun 4, 2003 at 02:52 PM.
)
|
|
|
| |
|
|
|
 |
|
 |
|
Senior User
Join Date: Oct 2000
Location: Lawrence, KS
Status:
Offline
|
|
C is a procedural language.
C++ is an object oriented language with C underpinnings.
C# is also an object oriented language. It was created by MS and is basically a Java rip off that intends to exploit Java's popularity.
This is a vague description. Look for C, C++ tutorials on the web -there's no lack of them.
|
|
iMac 17" G4 800MHZ & 768 SDRAM
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Aug 2001
Location: Australia
Status:
Offline
|
|
Define, "object oriented"
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jan 2001
Location: New York
Status:
Offline
|
|
Originally posted by IUJHJSDHE:
<STRONG>Define, "object oriented"</STRONG>
I think you'd be best served by searching the internet and buying a book, instead of asking people to be your dictionary on basic programming terminology.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status:
Offline
|
|
Originally posted by davecom:
<STRONG>
If we don't succeed we run the risk of failure--Al Gore.</STRONG>
Funny. I have the same quote attributed to W hanging on my wall at work! What's your reference? I'll post mine on Monday. Interesting how these things get twisted and distorted--like a giant game of telephone. It was probably never said by either one of them...
kman 
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status:
Offline
|
|
Oh yeah. How do you pronounce C#? C pound?
kman
|
|
|
| |
|
|
|
 |
|
 |
|
Moderator 
Join Date: Sep 2000
Location: Irvine, CA
Status:
Offline
|
|
Originally posted by kman42:
<STRONG>Oh yeah. How do you pronounce C#? C pound?
kman</STRONG>
C Sharp
|
|
{{{ mindwaves }}}
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jun 2000
Location: Dundas, Ontario, Canada
Status:
Offline
|
|
Well, C# is pronounced "C Sharp" (as in the musical sharp notation).
As for your request for the definition of object oriented:
In C and probably any other procedural language there is the concept of construction wherein one type is combined with others to make a larger type of data who's member are combined because they have some united meaning. An example of this is the NSSize struct (in C these are called "structs", pascal calls them "records" etc) in Cocoa is the combination of two integers that make both a height and a width attribute so that working with NSSizes always has some logical meaning. These are used frequently but usually objects are used now.
The object was a concept devised to extent this sort of construction to allow the data to have some notion of what it is and what it can do. At the lowest level, it is viewed as being a type consisting of code and data while a struct is just data. On a higher level it allows for a greater degree of abstraction and modularity since now data types can operate on themselves. For example, an object to replace NSSize might have a getArea method which would return the product of the height and width attributes when called. A method is like a function but is made to operate specifically on the data within its encompassing object.
Does anyone have anything to add to that?
Jeff.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Feb 2002
Location: Fort Lauderdale, Florida
Status:
Offline
|
|
Originally posted by IUJHJSDHE:
<STRONG>Define, "object oriented"</STRONG>
PIE: Polymorphism, Inheritance, Encapsulation.
It's your job to learn what they are and how to use them. Then you will know what object oriented means. I always like the PIE acronym, helped me in a job interview once where i was so nervous i couldnt think straight.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status:
Offline
|
|
For a good introduction to object-oriented design concepts, check out the first couple chapters of Object-Oriented Programming and the Objective-C Language, available from Apple's Cocoa Documentation page.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2001
Location: Provo, UT
Status:
Offline
|
|
As I understand it, what makes C# so "good" are the class libraries that are part of it. For network computing they are quite powerful. There are supposedly a few additions in the language itself beyond what Java gives. I can't recall what they are off the top of my head though.
Unforuntatley for all its benefits, C# is very Windows-centric.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jan 2001
Location: New York
Status:
Offline
|
|
Originally posted by kman42:
<STRONG>
Funny. I have the same quote attributed to W hanging on my wall at work! What's your reference? I'll post mine on Monday. Interesting how these things get twisted and distorted--like a giant game of telephone. It was probably never said by either one of them...
kman  </STRONG>
I think I got it from a book I have. It's like the A to Z of Al Gore or something like that. It's just quotes of him.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jan 2001
Location: New York
Status:
Offline
|
|
Originally posted by kman42:
<STRONG>
Funny. I have the same quote attributed to W hanging on my wall at work! What's your reference? I'll post mine on Monday. Interesting how these things get twisted and distorted--like a giant game of telephone. It was probably never said by either one of them...
kman  </STRONG>
I think I got it from a book I have. It's like the A to Z of Al Gore or something like that. It's just quotes of him.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Oct 2000
Status:
Offline
|
|
Originally posted by IUJHJSDHE:
<STRONG>Also, does anyone program in C anymore??
</STRONG>
Carbon is C. Procedural programming. Call a function, then another function, then another function. Any Carbonized app or OS 9 app has lots and lots of C in it.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Apr 2001
Status:
Offline
|
|
Originally posted by IUJHJSDHE:
Also, does anyone program in C anymore??
-----------------------------------------
You must be trolling.
|
|
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: Apr 2001
Status:
Offline
|
|
Originally posted by IUJHJSDHE:
Also, does anyone program in C anymore??
-----------------------------------------
You must be trolling.
|
|
|
| |
|
|
|
 |
|
 |
|
Posting Junkie
Join Date: Dec 2000
Status:
Offline
|
|
C is a very bright key, and, used properly, can be very heroic sounding. The major form of its scale is very simple, having no sharps or flats in its key signature. However, it can be deceptively difficult to play in at the piano, since it doesn't exactly fit the shape of the hand very well.
C# is a nice key, but the major form of its scale has seven sharps in its key signature, causing major-key pieces based on C# to be spelled with the enharmonic spelling, D flat, which has only five flats in its key signature, and is therefore simpler to work with. Consequently, most pieces based on C# tend to be minor-key works, and are often very tragic sounding.
C++ would be C double-sharp, I guess. C double-sharp major would be equivalent to D major, which is easier to play at the piano than C major, but unfortunately, the key signature would have seven double sharps in it, which would make things very convoluted, ugly, and confusing to read.
That help at all?
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Mar 2001
Location: Iowa City, IA
Status:
Offline
|
|
Originally posted by CharlesS:
<STRONG>C++ would be C double-sharp, I guess. C double-sharp major would be equivalent to D major, which is easier to play at the piano than C major, but unfortunately, the key signature would have seven double sharps in it, which would make things very convoluted, ugly, and confusing to read.</STRONG>
Actually, it's C double-plus, citizen. Please report to central for termination.
The conductor is your friend. Trust the conductor.
|
|
James
"I grew up. Then I got better." - Sea Wasp
|
| |
|
|
|
 |
|
 |
|
Posting Junkie
Join Date: Dec 2000
Status:
Offline
|
|
Originally posted by Amorph:
<STRONG>
Actually, it's C double-plus, citizen. Please report to central for termination.
The conductor is your friend. Trust the conductor.</STRONG>
Well, C double-plus didn't fit my musical analogy very well. Gimme a break, will ya? If you interpreted the plus as raising the note, a half step, it makes perfect sense.
Did you at least find the post funny, hopefully?
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Dec 2000
Status:
Offline
|
|
Originally posted by CharlesS:
<STRONG>
Did you at least find the post funny, hopefully?</STRONG>
Yes 
Very nice, although not really pertaining to the question at hand 
|
My name's ...uh... it's a bummer man.
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status:
Offline
|
|
C# == Microsoft's attempt to replace Java
.NET == Microsoft's attempt to replace the JVM (java Virtual Machine)
.COM == Microsoft's attempt to replace Swing (the Java GUI & standard routines)
Having tried to break another set of Standards (and succeeded in many ways) they are now trying to create their own.
It is our duty to attempt to break them 
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Mar 2001
Location: Iowa City, IA
Status:
Offline
|
|
Originally posted by CharlesS:
<STRONG>
Well, C double-plus didn't fit my musical analogy very well. Gimme a break, will ya? If you interpreted the plus as raising the note, a half step, it makes perfect sense.
Did you at least find the post funny, hopefully?</STRONG>
Sure.  That's why I responded.
I even tried extending your music analogy by inserting "conductor" into the Orwellian line from the game Paranoia: "The computer is your friend. Trust the computer." But I guess you've never played Paranoia? (You should try it. It's fun!)
|
|
James
"I grew up. Then I got better." - Sea Wasp
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Apr 2002
Status:
Offline
|
|
Just for the record: The "++" in "C++" derrived from the post-increment operator of "C". It's only intend is to show that "C++" is an evolution of "C". That's all.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2001
Location: ~/
Status:
Offline
|
|
Sambeau you're completely off the mark. .NET is not a replacement for the JVM, it would be more analguous to everything contained in the J2EE environment. You're thinking the CLR which is just a small component of the whole .NET schema. As for .COM I don't know what the hell you're talking about, COM is just an object model which is to say it is a standard way for programs to access external objects and classes. Swing isn't a toolkit to be replaced, it is just a themed widgetset that extends AWT.
Just because C# was developed by Microsoft doesn't make it evil. Java was developed by Sun, they aren't exactly a philantropic organization themselves. If you read up on it C# is a well thought out language that from the get go fixes problems that are either inherent to Java or qualms developers have had with the language. For instance Enums exist in C# and do not in Java which leads to lots of extra type safety checking in code. Enums let the compiler do the work which reduces the chances of bugs introduced by the programmer having to write more complex code. Also another nice feature are Value types (structs) in C#. Objects and classes are both stores on the heap and await garbage collection when they're not in use. A problem arises when you use objects like you would primitives (which are on the stack and automatically reclaimed by the system) which hang out on the heap waiting to be disposed of. Value types act just like structs and reside on the stack where they are more quickly dealt with when no longer in use.
Anyhow, there's lots of cool stuff included in C# that is not in Java. Those features don't make it better than Java necessarily, they just make it a different language, just like Ruby and SmallTalk are different than Java. If you want to see a lot of C (yuck yuck) break out some GNOME source code. Windows and MacOS and tons of Unix apps are rife with C.
|
2GHz 15" MacBook Pro, 120GB 5400rpm HD, 2GB RAM
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status:
Offline
|
|
I'll admit my ignorance about C# and .NET right from the get-go, but I'd like to ask a question of those in the know. Are the specs for .NET open? Since I doubt MS will make any effort to make the Mac an equal player in the .NET arena (why would they?), does Apple have any prayer of keeping up themselves by developing the tools from an open spec? My understanding is that Sun supports Java on most platforms, but Apple has to do all of the work on OSX. That is fine as they have done a great job and Sun is willing to provide them with the info to do it. I'm curious if MS will do the same. If .NET takes off are we going to be relegated to second-class citizens like Java on OS9? If the whole net moves toward .NET, we'd be screwed plain and simple.
kman
|
|
|
| |
|
|
|
 |
|
 |
|
Grizzled Veteran
Join Date: Oct 2000
Location: Cardiff, Wales
Status:
Offline
|
|
I prefer the Db pronunciation.
There was a interview with James Gosling - inventor of Java - in which he said he felt cheated and ripped-off (I'm paraphrasing) by C#, but also relieved that Microsoft didn't implement any of the improvements that he would've made. I suppose Microsoft could point to C, Eiffel, Pascal, Smalltalk, etc etc to 'prove' their case, but it's good to know that Gosling feels that way.
I might learn C# as a way to write COM/DCOM components and whatnot. I'm just so sick and tired of VB and VBScript, they make me want to scream sometimes...
Chris
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Mar 2001
Location: Provo, UT
Status:
Offline
|
|
While C# isn't really "open" there are a couple of open source projects that are porting most of C# to Linux. I doubt everything will be on all platforms, since as I understand it .NET will become the main way to interface with windows in the future.
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2001
Location: ~/
Status:
Offline
|
|
C# has been submitted to the EMCA for acceptance as a standard (as in Microsoft will no longer control the specification of the language). Java was submitted for standardization but Sun wanted to retain control in order to keep up with improvements and it was not accepted as a standard. If C# is accepted by the EMCA as a standard you'll be able to write a compiler for your favourite OS if you want to. On the otherhand .NET (which is a framework, not a language stop getting the two confused) is not being submitted as a standard but specifications do and will exist. The Mono project undertaken by Ximian is a testament to the specification being open. Mono is an open source implimentation of .NET. Say what you will about Microsoft but the whole .NET initiative is just a natural extension of object oriented programming. Cocoa is jam packed with the same sort of communication facilities that exist in both J2EE and .NET. In fact the way .NET is designed abstracts the software from a specific OS and processor architecture. If you've got a capable CLR and .NET framework on your computer you'd be able to run a .NET program. I could write some program in Pascal or VB on a Windows machine and then run it on a .NET environment on my Mac or Solaris system. You could also go the reverse route and call methods in classes residing on a server somewhere running Windows or Linux from a Mac or Solaris client using SOAP.
|
2GHz 15" MacBook Pro, 120GB 5400rpm HD, 2GB RAM
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status:
Offline
|
|
Originally posted by Graymalkin:
<STRONG>C# has been submitted to the EMCA for acceptance as a standard (as in Microsoft will no longer control the specification of the language). Java was submitted for standardization but Sun wanted to retain control in order to keep up with improvements and it was not accepted as a standard. If C# is accepted by the EMCA as a standard you'll be able to write a compiler for your favourite OS if you want to. On the otherhand .NET (which is a framework, not a language stop getting the two confused) is not being submitted as a standard but specifications do and will exist. The Mono project undertaken by Ximian is a testament to the specification being open. Mono is an open source implimentation of .NET. Say what you will about Microsoft but the whole .NET initiative is just a natural extension of object oriented programming. Cocoa is jam packed with the same sort of communication facilities that exist in both J2EE and .NET. In fact the way .NET is designed abstracts the software from a specific OS and processor architecture. If you've got a capable CLR and .NET framework on your computer you'd be able to run a .NET program. I could write some program in Pascal or VB on a Windows machine and then run it on a .NET environment on my Mac or Solaris system. You could also go the reverse route and call methods in classes residing on a server somewhere running Windows or Linux from a Mac or Solaris client using SOAP.</STRONG>
So I guess the question is: will the .NET frawework be available on the Mac?
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status:
Offline
|
|
Originally posted by clarkgoble:
<STRONG>As I understand it, what makes C# so "good" are the class libraries that are part of it. For network computing they are quite powerful. There are supposedly a few additions in the language itself beyond what Java gives. I can't recall what they are off the top of my head though.
Unforuntatley for all its benefits, C# is very Windows-centric.</STRONG>
Actually C# isn't. It compiles down to IL. (Intermediate Language). The CLR (Common Language Runtime) however *IS* Windows centric at the moment. But there are some folks working on at least a basic version for OS X (and two sets of folks working on one for BSD.)
Who knows .... I don't buy into vaporware much. I'll believe we have a CLR on the Mac when I see it. (But I would love to see it!)
|
|
- iMac 3.2Ghz 1TB - MacBook Pro 15" Core i7 2.3Ghz / 256SSD (Work laptop)
- PowerMac G5 - Dual 2.0 Ghz, 3GB, Soundsticks!,
- Lenovo Thinkpad T510 (also a work laptop), Win 7 Enterprise, 8GB, 320GB HDD
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: May 2001
Location: Atlanta, GA
Status:
Offline
|
|
Originally posted by sambeau:
<STRONG>C# == Microsoft's attempt to replace Java
.NET == Microsoft's attempt to replace the JVM (java Virtual Machine)
.COM == Microsoft's attempt to replace Swing (the Java GUI & standard routines)
Having tried to break another set of Standards (and succeeded in many ways) they are now trying to create their own.
It is our duty to attempt to break them  </STRONG>
Well ... uh .... no.
Microsoft is still going to make a bastardized version of Java called J#. It compiles to the IL like C#, VB.NET and other languages do. There is at least one other 3rd party company making Java for .NET.
.NET does have it's own JVM (CLR) but it has a ton of other stuff too, mostly related to communications plumbing and (until recently) services.
.COM (Actually I think you are referring to COM) is now gone for the mainstream programmer. This is the Component Object Model. From VB using the IDispatch Interface was fairly easy to use, but from C++ using custom interfaces it was a little more complex. From C++ using an IDispatch interface it was painful. Now .NET abstracts most of this and relegates COM to the low level where most programmers will never see it again. So, COM isn't replacing anything, it's been replaced itself. (At one time COM was a competitor to OpenDoc and remains a competitor to CORBA.)
|
|
- iMac 3.2Ghz 1TB - MacBook Pro 15" Core i7 2.3Ghz / 256SSD (Work laptop)
- PowerMac G5 - Dual 2.0 Ghz, 3GB, Soundsticks!,
- Lenovo Thinkpad T510 (also a work laptop), Win 7 Enterprise, 8GB, 320GB HDD
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Jun 2001
Location: Dundee, Scotland
Status:
Offline
|
|
er.. ok .. so I'm wrong. I knew I was twisting the logic a bit to get a few flames, but maybe I went over a little.
(ish)
been reading up on this stuff over the last couple of days and stand by some of what I said. .NET is essentially a cross-platform virtual machine, with a bytecode and a set of libraries geared towards networked applications. Kinda like the JVM. C# is very like JAVA and it compiles down to a bytecode that runs on the .NET VM (the CLR?). The XMLy data-sharey bit is just something you can do with it.
.NET looks interesting in a conceptual way (sharing data and publishing services via XML). But it seem overly complicated and *very* windows-centric. It's also nothing new.
the .NET vm also looks interesting as it is a register based machine rather than a stack based one (like the JVM). This makes it easier to JIT compile.
there is a movement to port the.NET virtual machine to OSX. there is also talk of getting Perl6 (via the Parrot VM) to run on it one day so that is interesting too.
COM (not .COM) isn't what I said it was. there's a bunch of new libraries for that kinda stuff. worth it for the flames though
Maybe I should have said that .NET is Rebol lite.

|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|