What is C# used for ? couple of my friends said network but I'm not sure if thats correct can someone set me on the right path here. And is it worth learning ? thanks.....
Printable View
What is C# used for ? couple of my friends said network but I'm not sure if thats correct can someone set me on the right path here. And is it worth learning ? thanks.....
It is a general purpose programming language, and can be used for (almost) anything. It can be used for networking programs, and it is often used for GUI programming.
--
Mats
So is it just like C++
As very brief summary yes. There are many small differences. The biggest one is that the memory management is done by the "language" itself, and that it's not a native compiler - it generates .Net code, which is the same concept as Jave ByteCode, not pure machine-code. It then uses clever techniques to translate this into actual machine code when you run the app - as far as I understand.
--
Mats
Well, it is clearly based on C++. So it is more modern than C++. But C++ is a better choice when you want something to run faster. It has offers more management it is an evolution from C, meaning speed is always a must for the language. Not that C# is slow. Well, google C# vs C++ and you will find a lot of opinions
My personal opinion is that C# it is easier than C++. But as a language it has fewer things than C++.
It is created by Microsoft and uses the .NET framework. Meaning that if a PC doesn't have the framework it cannot run the program. Of course installing the framework in Windows is free and simple. It can be done (they say) in Linux or some Linux.
As far as I know you can use the .NET library also with C++, but it will be probably better to do it with C#.
.NET / ASP.NET is really create for a GUI or a Internet based program. C++ is better when speed is an issue, like creating a game.
P.S1: I prefer C++, but that is because I like C.
P.S2: I played DMC 3 and 4 mostly to see the scenematics with Dante. There awesome. Probably the best is the Intro of DMC 3. Though that's also the first one so it's the first impression. From DMC 4 I liked the theatrical/drama scene most... and... wait this is a C forum....
One important difference is that C# can't be used for kernel mode software, such as (many) device drivers.
Or rather, if you wrote it in C# without using .NET, you could probably write a compiler to do kernel mode drivers, as I don't believe any of the existing compilers have that capability.
C# iz a fansee wurd for java 4 microsoft.
Y u gotta hait?
i don no y hez been sarcaztc
Lollies
Anyway it certainly does have it's place, although I'd pick Java over it anyday. What's the point of a managed, interpreted language if it's hardly portable?!?
If you really don't know how to spell properly, then I pity you. However, if it is by choice that you construct your sentences that way, don't expect to get any respect or useful help from normal people. if you want people to take you seriously, please conform to the same standard of spelling, sentence structure, and punctuation that everyone else has adopted. What do you think a potential employer would think if you wrote that way in your resume? they would read the first sentence and throw it in the trash can. Posts on this board are just as easily discarded or ignored.
I prefer C# features over java, I like java and will program in it at the drop of a hat, but prefer C# for all it offers.
<RANT>
anyone who says that C# is just a java knockoff doesn't know anything about the language. figure out who the language creator is and you'll learn where its real roots are!
</RANT>
Me? The only thing I have said favoring C# over C++ is that it is more Object Oriented, which is a good thing for an OOP language. Which also a lot disagreed.
In a way C# takes one part of C++ and does it better.
But I like more low language stuff, because I like more hardware than software, since I have studied Computer and Electrical Engineer.
The languages are too similar anyways too really favor one from another.
Yes, you. I only see C# threads from you, so I figured you have been all the rage about C# lately.
Anyway, as cpjust once said, it is one step forward, and two steps back.
From my knowledge, it lacks such things as a lot of generic programming.
It also stuffs the garbage collector down your throat.
And, of course, it's way slower than C++ code.
So there are big differences in the language, methinks, and that makes C# inferior in my eyes.
C# has generics
GC's aren't as evil as you may think.
http://www.csharphelp.com/archives2/archive297.html
http://www.nuclex.org/pages/csharp-vs-cxx-performance
In pure data crunching, sure, but for an average application the difference is neglectable. Performance is affected more by choice of algorithms and the user himself than the coirce of language, unless you're writing low level drivers or state-of-the-art games.
C# shines in RAD. I cannot imagine using C++ at work. Development time would take 10x and that would make my boss most unhappy :).
Meh. I am so unaware of C#....
To me, they are. I like optional things, not things stuffed down my throat.Quote:
GC's aren't as evil as you may think.
http://www.csharphelp.com/archives2/archive297.html
http://www.nuclex.org/pages/csharp-vs-cxx-performance
And they are not just "evil" performance-wise, but when you really need control of your resources. C#'s GC tends to move things around if I'm not mistaken.
Of course, of course. For PCs, the performance cost is acceptable.Quote:
In pure data crunching, sure, but for an average application the difference is neglectable. Performance is affected more by choice of algorithms and the user himself than the coirce of language, unless you're writing low level drivers or state-of-the-art games.
To me, that is not. Yet, even though it is negligible, it is a difference.
What C++ lacks are libraries for stuff... otherwise it could have been as much RAD as C# & Co.Quote:
C# shines in RAD. I cannot imagine using C++ at work. Development time would take 10x and that would make my boss most unhappy :).
It's a shame, really, I say :/
Not to mention the coalesce operator. Plain wonderful to work with, like when writing lazy properties.
WOW, I didn't know there was that op, I could have used that at work lol.
> He said it's "not just interpreted" not "not interpreted at all"
Oops, sorry. The "correcting someone else bandwagon" is just so fun to ride though! Only when matsp isn't driving ;)
The JIT compiles the bytecode into machine code.
That compilation is done as needed, usually at class load time (though the JIT has the option of deciding to do it based on some other metrics).
As such it's not an interpreter but a compiler, except of course that every compiler has to first interpret the code it's presented with in order to be able to compile it.
Does that make C++ an interpreted language? :D
No because C++ does it at compile time. There is a byte-code interpreter, thus technically it's interpreted and compiled. At least that's what they tell us in CS ;)
This discussion will get more heated when C# 4.0 introduces the "dynamic" type.
There are a lot of discussion about C++ templates VS C# generics. There is one on MS site also. Both have advantages/disadvantages. Generally templates can do a bit more than generics. But haven't use them excessively to understand how useful the "more" really is.Quote:
>>From my knowledge, it lacks such things as a lot of generic programming.
>>C# has generics
Maybe someone can shed more light on this?
Well as far as I understand you don't have in C# a way to do a specific implementation of a template class like you would in C++. I haven't created too many generic/templated classes to tell you the whole thing.
You talk of it as if it's a good thing. Generic programming should be generic, not introducing tons of special cases.
Compilation is by definition a translation from one language into another. Whether those languages are C++ to machine code, C# to CIL or CIL to machine code is of no importance.Quote:
No because C++ does it at compile time. There is a byte-code interpreter, thus technically it's interpreted and compiled. At least that's what they tell us in CS
I think the main difference between an interpreted language and a compiled one is that the compiled language doesn't require the original source code to be run.
We then have various types & levels of compilation - but it still is compiled if source file(s) gets converted into a file (or set of files) that can be used without having any access to the original source code.
--
Mats
wow guys...all that over semantics of words...
anyways, C# 4 will definitely heat up discussions because it will cross the line between static and dynamic languages. although this has already been done previously with languages like Boo and IronPython for .NET, i think C# with microsoft's backing will make a big difference.
Here are the new features http://code.msdn.microsoft.com/csharpfuture
The dynamic sure looks interesting. And finally you can put default values on parameters. I am still wondering why this wasn't able from the beginning.
You had like 4-5 flags in a function and in order to avoid calling something with 20 arguments and mixing every time the flags, your only solution was to use oveloaded function wrappers to do your job, with a small cost of an extra function call. Finally, they saw their error.
yeah, default params are definitely needed, the strategy you had to implement was just annoying. Though allowing you to specify them out of order is kind of meh to me. I watched the PDC where you get a good illustration of what they are trying to do.