PDA

View Full Version : C#: Whats bad really?



MovingFulcrum
04-27-2002, 07:34 AM
OK, there have been lots of threads about C#, and would ppl still use C# or not ,etc,etc,etc.
Ok, for all those who would stick to using C++, how about saying some concrete points as to *why*? Ms has given a lot of good reasons as to why c# is a better c++ and why should one use it. (if u wanna take a look go to ms site, too big to post here).
Now how about you guys telling some concrete easons as to why you would still continue die hard c# programming.
Pls dont destroy this thread by saying,its M$ so it sucks etc. Give some concrete reasons.

ygfperson
04-27-2002, 07:37 AM
there's a c# board, which may give you better answers

Sorensen
04-27-2002, 08:06 AM
You could always try them both yourself. There's no law where I'm from forcing you to only use one programming language. However, a couple of reasons why you might need C/C++ over C# is that you need the extra performance, or you're not programming for Windows (or a Windows like environment with a port.).

quentin
04-27-2002, 08:27 AM
im only an insignificant beginnerish person but as far as i can see C# looks harder than C++. It looks very much like Java which I tried learning once but failed cos it was too complicated. I can actually get my head around C++.... mostly.

Sorensen
04-27-2002, 08:36 AM
>as far as i can see C# looks harder than C++

I think you mean OO looks harder than procedural programming. C#/Java consists of most of the OO parts of C++, and adds little (apart from substantial libraries). I don't see how a simplified version of a language could be considered more complicated. If this was the case then the creators of Java/C# would have failed in what they set out to achieve.

Aran
04-27-2002, 08:38 AM
yes, java is a harder language to learn when you are starting out by far. The way everything works is outlandishly alien to those who haven't gotten their feet wet in C++ OOP. It was strange even for me to learn after learning C++.

I may pick up a C# books soon and rifle through it to see how it is... i don't think it'llbe worth it though.

Shiro
04-27-2002, 08:41 AM
I use more than one language and I don't think that one language is better then the other. I use the language that fits my needs when I have to implement a piece of software.

Since developing embedded software is my job, C and C++ are the languages which I use most. And since a lot of our clients and a lot of new stuff in embedded systems is written in Java, I also use Java.

And since in the kind of industry where I am working C# is not used (yet), I don't use C#. Which doesn't imply that I have a negative position to that language.

>Ms has given a lot of good reasons as to why c# is a better c++
>and why should one use it.

They also call their Visual C++.NET a better C++. I don't believe in such as a better language. And ofcourse MS says C# is a better C++, they want people to use their product.


Something different, just take a look around and see how many languages were developed, are being used and how many new languages are still are being developed. Think about that fact.

quentin
04-27-2002, 08:49 AM
Originally posted by Aran Elus
yes, java is a harder language to learn when you are starting out by far.
That's what I mean

CompiledMonkey
04-27-2002, 11:27 AM
For me, learning C# has been easy. My first and only language was Java. It was tough getting started but once you understand OOP it all falls into place.

As for why I will use C#, its fun. Its also very easy for me since I already know Java. I wasn't too fond of C# when it first came out but it's never a bad idea to have more than one language under your belt.

Aran
04-27-2002, 06:54 PM
i'm guessing that the C# windows API isn't as ugly and heavy as the Swing API...

CompiledMonkey
04-27-2002, 07:34 PM
Originally posted by Aran Elus
i'm guessing that the C# windows API isn't as ugly and heavy as the Swing API...

Yup. I guess the appearence is more of a personal thing. But having a nice IDE like VS is much better than coding everything out like in JBuilder.

MovingFulcrum
04-28-2002, 10:25 PM
a couple of reasons why you might need C/C++ over C# is that you need the extra performance
Well, 2Ghz machines are out nowdays ;)

or you're not programming for Windows
which is very rare indeed


MS says C# is a better C++, they want people to use their product. Its pretty obvious for them to do, after all they are a businness and all these things are done for money only. The sheer fact that the language is named c# and not anything else suggests that they want to fade away c++. But then they have given very precise reasons as to why c# is a better language,eg - use of "." always, everything in a class, no header files, etc. Way too much to mention here. They have based their arguments on specific reasons as to why c# is better than c++. What i really wanted was some c++ fans to say why c++ is still better than c# . But noone seems to have give me a reson for that so far. This discussion seems more to going in a 'which is harder to learn' direction.


Something different, just take a look around and see how many languages were developed, are being used and how many new languages are still are being developed. Think about that fact. Take a bet. C# is gonna be used heavily;) Most of those languages are you are talkign abt are done by either individuals or small companies who dont have enough money to promots them. But when it comes to ms, things do get serious.


i'm guessing that the C# windows API isn't as ugly and heavy as the Swing API C# windows Api!!!!! I really havent had the time to take a good look at c# yet but how can there be a diferent api for windows all together. I mean they can wrap the win api into something else, but they cant just change it. Porbably i am misunderstanding you here. Pls explain.

SilentStrike
04-28-2002, 10:42 PM
People have said why the were sticking to C++ rather than C#, you just are so slanted towards C# that you dismiss them.

Reasons to use C++ rather than C#,
It's standardized now.
Performance.
There is a lot of "legacy" C++ code.
Portability.

I see C# as much more competition for Java than it is for C++.



PureOOLangaugeWithGarbageCollection Csharp = Java.clone();

fyodor
04-28-2002, 10:48 PM
Well, 2Ghz machines are out nowdays


And your point would be what?



<or you're not programming for Windows
which is very rare indeed

That certainly is an interesting perception of facts.


Take a bet. C# is gonna be used heavily

Or rather, a lot of companies developing for Microsoft are going to buy the environment just for the API tools etc and not really use C#, just like a lot of companies use VC++ just to write C.

In my opinion, C# will be touted and pushed heavily for another three years or so, until Microsoft finds a new magic development tool. And I think that Microsoft's dominace is slowly approaching an end. Developers, and more to the point, their bosses, are realizing that using Windows is not only a one-time expensive investment, but drags down their productivity (god I hate that word) over a span of several years, when they are forced to buy a new system that makes previous ones completely obsolete.

Shiro
04-29-2002, 02:39 AM
>>or you're not programming for Windows
>which is very rare indeed

I don't know the facts. But it seems to me that there are many people programming for a different platform than Windows. At the company where I'm working, there's one small department where people are writing software for the Windows platforms. And think about all those Linux-programmers.

>But then they have given very precise reasons as to why c# is a
>better language,eg - use of "." always, everything in a class, no
>header files, etc. Way too much to mention here.

Sure there are many reasons why one would use C# instead of C++. Though note that this it thinking from a certain point of view -> the Microsoft view. They have a vision about the future and .NET and C# are playing a main role in that vision. So from that point of view they can tell many reasons.

If you asked someone else who is not developing for Windows platforms, you would get reasons why to use C++ instead of C#.

Some reasons:

In small devices, there's usually a small OS running. There is no space for a Windows CE environment and .NET environment, so C# is not applicable for this kind of applications. So we keep on using C++ and C.

As far as I know, C# can be used only in the .NET environment. When using a different platform, then .NET will not run and so you can't use C#.

There are many tools for software development in C++ and there are a lot of free tools. Free compilers, debuggers etc.

C# and .NET Runtime are in many ways the same as Java and J2EE. I know that Java and J2EE are not very useful for low level programming, so I assume that C# and .NET Runtime are also not useful for low level programming.

C# and .NET are relatively new. C++ is much older and there is a lot of knowledge and experience with using C++ and its tools.

>C# is gonna be used heavily Most of those languages are you
>are talkign abt are done by either individuals or small companies
>who dont have enough money to promots them. But when it
>comes to ms, things do get serious.

C# will sure be used heavily, but in certain kinds of industry.

So when it comes th MS, things do get serious? Languages like assembly, Java, C, C++, Basic, Lisp, Haskell and many more aren't serious?

Sure, there are many languages which are developed by individuals, they are not used much. Small companies that develop their own language know that they don't have the money to promote their language like MS does. So they developed their language for different purposes, probably for a certain device they have developed.

Promotion is not the main thing of the succes of a language. It are the programmers who decide if a langauge is useful or not. If a lot of programmers say: C# has no new advantages to us, then it will not be a succes. This is independent from how much money MS puts in its promotion. Ofcourse MS also knows that it are the people who have to work with it are the ones who make it a succes or not, so I guess C# is useful. But in certain kinds of industry ofcourse.

>But when it comes to ms, things do get serious.

BTW, C and C++ are not developed by MS. So C and C++ programmers are not serious programmers?

mithrandir
04-29-2002, 06:03 AM
C# won't "take over", but it will make things interesting.

Unregistered
05-01-2002, 03:34 AM
As far as I know, C# can be used only in the .NET environment. When using a different platform, then .NET will not run and so you can't use C#.
Which is what the trick is. The main objective behind all this is to promote their OS. So give the users a completly rad enviroment, a better language and a nice IDE to develop it all and why would anyone want to leave the OS or the enviroment. In the menatime lose complete support for C++ thus giving ppl one more reason to switch to it.


There are many tools for software development in C++ and there are a lot of free tools. Free compilers, debuggers etc.
Thats obviously cause c++ has been there for such a long time. Ms does allow creation of a c# compiler in their copyright stuff. So surely, there would be free c# compilers, debuggers in the future. But you do need to give ppl time to develop it. Dont u? :)


C# and .NET are relatively new. C++ is much older and there is a lot of knowledge and experience with using C++ and its tools. C# will soon get old too. I am talking not abt the current situation here but what the situation would be in a few years to come.


If you asked someone else who is not developing for Windows platforms, you would get reasons why to use C++ instead of C#. So do u agree that atleast for windows enviroment, c# is much better for development than c++?


If you asked someone else who is not developing for Windows platforms, you would get reasons why to use C++ instead of C#.
Many ppl seem are sayign that but things seem to be a bit different to me. Look at the msdn site. Ms just launched Visual j#. If they wanted to eradicate java they wouldnt have done so. It seems their prime concern is to promote .NET more than anything else in the world.



Well, 2Ghz machines are out nowdays And your point would be what?
Well, u guysare talking so much abt performance. But on the ms side that seems to be the least important thing. I said exaclty would ms would say to you. With such high processor speeds whats the need to wory abt performance?
It seems intel and ms have a pact between them to promote each others products or something.


C# won't "take over", but it will make things interesting. What exactly do u mean by that?

My main question right now- For developing windows apps isnt c# waaaay better than c++?

P.S.- This is MovingFulcrum only. Sorry not logged in right now ;)

Osama Lives
05-01-2002, 04:55 AM
I'm quite certain that you will see C# move strongly into the embedded system market especially since developers are working on a lightweight .net framework in which you will be able to use VS.NET.

You must realize that the .net framework is middleware. It is simply designed to offer programmers a higher level of abstraction to build and deploy software components. The framework has a common type system and therefore C# is not a great deal different than VB.NET or C++.NET. All of these languages are managed. You can use the VS.Net debugger to compile seemlessly across any of the the managed languages as well as unmanaged C++ and code used to interface with the .net enterprise servers (exchange 2000, SQL, etc).

There is no conflict between C++ and C#. VS.Net fully supports C++. You can tag your code as unmanaged at any point if you want to use native C++, you can also make external calls to Win32 or Win64. Certainly C/C++ is more powerful than C#, however it is far less productive when put to a release schedule and it is also far more error prone, and it is certainly less portable (since it must be compiled to X86 machine code for the target OS). The .net framework Intermediate Language is portable to all operating systems that have build their own framework and have met the Ecma Common Language Infrastructure (CLI) specification.

The only thing that you can say about C# when comparing it to C++ is that the syntax is indeed much cleaner, however you should be comparing C++ with the .net framework instead of C# if you want to measure performance. Compare the C++ STL to the .net Base Class Library (BCL).

Another thing about managed code is that if I can build a powerful game with managed code, why would I want to write 5 times as many lines of error prone code in C++ to do the same thing?

Sorensen
05-01-2002, 02:35 PM
>With such high processor speeds whats the need to wory abt performance?

Because a few apps demand it. I don't often see marketing hype from Intel/AMD stating "buy our new processor, it allows developers to code in higher level languages so your software will be less buggy/late". Higher clockspeeds makes worrying about performance less important (and lower level languages become more specialised tools), but I don't think we're at a point yet where you'll see a cutting edge game/app developed in C# using the net framework. Alot of programmers may only ever program relatively non-performance intensive apps, but that doesn't mean that the other type of app doesn't exist.

>Another thing about managed code is that if I can build a powerful game with managed code, why would I want to write 5 times as many lines of error prone code in C++ to do the same thing?<

I'd agree if you were developing a standard grey box Windows app, but I'd guess that your 5 times code saving for a "powerful game" is a slight exaggeration. Also people may not agree that your game is all that powerful when the garbage collector kicks in at some crucial moment destroying the frame rate. So you may end up writing a fair proportion of it as unmanaged (I'm not sure if there is a way of preventing this using managed code) .

Osama Lives
05-01-2002, 04:36 PM
Games are probably the most sophisticated type of application you can write. I have heard some talk of MS incorporating DirectX into the .net framework in a future version.

I would certainly use the framework for building Windows applications as well as web applications, but you can also use it to write games, although you will no doubt need to use Directx to interoperate with Win32, so your project will not likely be all managed. This might change though, and the framework is still new. It will be continually improved. Do not equate the BCL with MFC. Even Pretzel says that the BCL is far more richer than MFC.

I think that programmers should learn C and Win32, but I also think that they would be fools not to use middleware. You should learn Win32 only for the sake of those few things that can not be done with middleware, and than it depends on what type of application you are building. Middleware is making a strong move, look at Java. This is the proper way to program.

I also see no challenge to C/C++. Those will always be the bread and butter because they are the blueprint architecture that defines the operating system. The subsystems for USER, KERNEL, and GDI are all written in C.

Sorensen
05-03-2002, 04:03 PM
>Games are probably the most sophisticated type of application you can write.

Programmers working at somewhere like NASA might disagree there.

>Even Pretzel says that the BCL is far more richer than MFC.

Yes Dean, but MFC requires you to make Win32 calls. I don't think it's ever been marketed as a substitute. Petzolds C# book, while probably very good, doesn't cover the same amount of ground as his Win32 books. Although this may be due to the imaturity of the net framework.

>This is the proper way to program.

No, as with most programming languages, it's a compromise.

>I also see no challenge to C/C++.

Then, either you don't know C++, or you've never learned how to use a library. C# offers nothing that most would consider a challenge to a reasonably competent C++ programmer (it being a dumbed down version).

Shiro
05-04-2002, 03:10 AM
>So do u agree that atleast for windows enviroment, c# is much better for development than c++?

There's no such as better. But I think that programming C# is more suitable than C++, at least, at some level. For more low level applications and applications which require more performance, I can imagine that C++ is more suitable.

>It seems their prime concern is to promote .NET more than anything else in the world.

That's correct. .NET is the main subject in their total vision on the future. I'm working in the automotive industry and MS is also trying to get in there. Also with the .NET based vision, for the automotive industry they've created an architecture called Car.NET. Currently BMW is using Windows CE For Automotive in a new series of cars. But in a different series of cars they use VxWorks and Java. I've heard that Windows CE is quite stable, so perhaps MS will succeed in getting the .NET vision in the automotive industry.

>But on the ms side that seems to be the least important thing.

You have to make a difference between applications. Sure, on a PC, performance doesn't bother most people really much. But when talking about medical applications, safety applications, performance is very important.

>I'm quite certain that you will see C# move strongly into the embedded system market especially since developers are working on a lightweight .net
>framework in which you will be able to use VS.NET.

C# is already moved into the embedded system market, but not very strongly. At this moment Java is used far more than C#. But note that when talking about these languages in relation to embedded systems, you're talking about the higher level applications in devices. Lower level software requires languages like C and C++.

>Games are probably the most sophisticated type of application you can write.

There are far more sophisticated types of applications. Like Sorensen mentioned, for example NASA. But also software for audio processing, GPS navigation, medical applications and many more applications are far more sophisticated then games.

>I think that programmers should learn C and Win32,

If they want to program MS Windows applications, then they have to know C and Win32. But don't forget that there are many programmer's who don't program for the MS Windows platform.

lightatdawn
05-04-2002, 11:37 AM
>>many more applications are far more sophisticated then games

I believe what he was refering to is that games will require a vast amount of knowledge about many different aspects of programming. Sophistication would be the wrong word. ... Although if you've seen some of the insides of the D3D stuff... whew!

Unregistered
05-04-2002, 03:06 PM
I don't see why it makes more sense to plow a field with a rake rather than to use a tractor to do it. There are too many things C/C++ do not offer that a framework takes care of such as dll versioning and managed code to name a couple, yet I am no expert in .net, there is surely much more, not just in .net but also java and the JVM. I think it is foolish to not use middleware.

lightatdawn
05-04-2002, 03:30 PM
>>I think it is foolish to not use middleware

Unless of course you are programming games... Or any other application where speed is key for that matter.

>>I don't see why it makes more sense to plow a field with a rake rather than to use a tractor to do it.

But would you use a tractor in your rose garden? Everything has its pros and cons. Middleware makes it easier to develop (in most cases) but if you're looking for precision then its best to not rely to heavily on someone elses code and redundant features.

Unregistered
05-04-2002, 11:10 PM
I don't see your point. I would use .net to write games or any other aplication. The great thing is that it compiles to machine code and if I need to deallocate something than I can dispose of it or else let the garbage collector do it, my choice. There is no app that I can't build.

Unregistered
05-04-2002, 11:14 PM
The .net framework will open up new areas of internet development especially for games.

Shiro
05-05-2002, 02:31 AM
>The great thing is that it compiles to machine code

That's not an argument to use .NET to write software, also C and C++ compilers, and ofcourse many other languages, compile to machine code.

>There is no app that I can't build.

Really? What about an OS? Or a linux device driver? Or a piece of software for a 8051 or other microcontroller?

>The .net framework will open up new areas of internet development especially for games.

I agree with that. .NET and J2EE offer 'new' possibilities in programming. A very nice application I've seen using the JVM is remote software updating and remote software loading of devices.

Sebastiani
05-05-2002, 02:58 AM
You have to make a difference between applications. Sure, on a PC, performance doesn't bother most people really much.
:confused:

Shiro
05-05-2002, 03:14 AM
Most people working with PC's do stuff like wordprocessing, requesting and filling databases, making calculations with spreadsheets, e-mailing etc. Then you don't care if saving a document does take a second more or less.

But when you're, for example, creating a piece of software to control a medical instrument, performance requirements are much higher. If the instrument is used to repair damages to vital organs, the software needs to be extremely accurate.