C# vs. others

Chat about just about anything else
Forum rules
Do not post support questions here. Before you post read the forum rules. Topics in this forum are automatically closed 30 days after creation.
User avatar
eiver
Level 5
Level 5
Posts: 568
Joined: Fri Jan 23, 2009 5:51 am

C# vs. others

Post by eiver »

As I promised some time ago I wanted to start a discussion about programming languages. There are countless similar discussions all over the net, but anyway lets give it a try with this one.

Before even this discussion begins:
- Please do not turn it into a flame war - If you think someone said something stupid, then prove him wrong. Don't just say he's stupid.

- As the title suggests I am a fan of C#. So I hope, that people who also know C#, but prefer other languages will try to convince me, that something else is better. I will try do defend myself. :twisted:

- Do you think we can handle everything in one topic, or would it be better to make "C# vs. Java", "C# vs. Python", etc.

- Lets not consider languages like for example PHP for now and focus only on languages used to make a desktop application (Think Firefox, MintMenu, OpenOffice, etc.)

- Finally if you are just a user (not a programmer), then stay out of this topic. I don't want to hear any: This language is bad, because this app is bad.
Last edited by LockBot on Wed Dec 07, 2022 4:01 am, edited 1 time in total.
Reason: Topic automatically closed 30 days after creation. New replies are no longer allowed.
Aging Technogeek

Re: C# vs. others

Post by Aging Technogeek »

I am not a coder so I will stay out of the discussion, but I would like to say, if at all possible please limit it to one thread instead of spreading all over the forum. Also, as always please keep it cool and calm. The mods do not like having our idle time interrupted to referee incipient flame wars over topics we know little or nothing about.

That's all I have to say in this topic. Enjoy your discussion. I will follow this topic because I might learn something, but I will not post to it again unless I have a pertinent question.
DrHu

Re: C# vs. others

Post by DrHu »

Probably the best comparison to make is java vs C#; as they are intending to function into the same markets..
http://www.oreillynet.com/pub/a/oreilly ... _0800.html
The business case, if anyone wanted one..

Comparisons..
http://www.25hoursaday.com/CsharpVsJava.html
http://genamics.com/developer/csharp_comparative.htm
http://www.veridicus.com/tummy/programm ... csharp.asp

http://simpleprogrammer.com/2010/02/01/ ... languages/
http://simpleprogrammer.com/2010/02/04/ ... forms-web/

http://jasonmbaker.wordpress.com/2009/0 ... -analysis/

C# architect..
http://www.artima.com/intv/generics2.html

One other item, always check the vendor websites..
http://www.oracle.com/index.html
--since Oracle now owns SUN, who knows exactly what they will do, but I expect java to live on, since Oracle is mainly a DB company..
User avatar
eiver
Level 5
Level 5
Posts: 568
Joined: Fri Jan 23, 2009 5:51 am

Re: C# vs. others

Post by eiver »

You assembled a very nice set of comparisons. I think I like this one the most: http://www.25hoursaday.com/CsharpVsJava.html
Especially part D and E are interesting. D - what C# has and Java lacks and E - the other way around.

From my personal experience the most important thing was was:

Concerning the language itself:
- C# properties instead of Java getters and setters
- C# partial classes
- In C# you do not have to write "throws" if your method throws an exception
... probably few more will come to my mind later

Concerning the framework:

- .Net just runs faster
- Java is not as cross platform as it seems. Very rarely the code will run on many platforms without any adjustment. There's almost always some OS specific stuff that crashes on another OS. But obviously Java has a better cross-platform support than C#.

Concerning the IDE:

- Eclipse is one of the most powerful and most horrible IDEs I have ever seen. Everything there must be configured. Tons of plugins and extentions, which is good on one hand, but on the other hand it looks something like "Linux from scratch". You need to do a lot of work before you can actually start working on your application.
- NetBeans - has more out-of-the-box experience
- Visual Studio - has a very smooth learning curve. I could teach a new user to write a simple application like for example a Calculator in just few minutes. After installing everything just works out-of-the-box.
- MonoDevelop - not as feature rich as VS yet but the devs are busy and I can see a really good progress with each new release
Summing up: VS is a strong argument to choose C#. And its free in its basic form. For students its free in its most advanced version too. (Of course that still cannot beat freedom of open-source, but its better than nothing.)


I will post something about C# vs Python later. I hope could engage few Linux Mint devs in the discussion as Mint apps are written in Python and they do their job extremely well as we can all see.
markfiend

Re: C# vs. others

Post by markfiend »

IMO the biggest potential pitfall of C# is that it's not free open-source software sensu stricto and you risk Microsoft suddenly deciding to enforce its software patents.
User avatar
eiver
Level 5
Level 5
Posts: 568
Joined: Fri Jan 23, 2009 5:51 am

Re: C# vs. others

Post by eiver »

Agreed. That is a potential problem. But what about Mono?
markfiend

Re: C# vs. others

Post by markfiend »

Microsoft may have patent claims over Mono too.

It's a tough call; in a perfect world, I would prefer doing without anything that might be patent-encumbered. On the other hand I use mp3 (which is a patented codec) for most of my audio collection.

I'm not Richard Stallman; I'm not going to say you're wrong to use C#. I'm not even sure that MS would ever enforce their patents over C# stuff. How seriously you take the risk is up to you. Image
Kendall

Re: C# vs. others

Post by Kendall »

I generally prefer Python as the emphasis on code readability is almost always present in full force. My very early programming days were with C and Python (and TI-83 calculator programs) and I generally preferred Python due to the speed of development and the ease of the syntax. Before starting at Mint I had never written a GUI application before in any context. I found it quick, easy, and painless to start developing GUI apps in Python and the ease of integration with the actual system (in any context) was a major selling point. I'm still learning my way around the plethora of different GUI building options, but I've never seen anything that gives so many options so seamlessly.

It's also worth noting that Python doesn't run as a script. It's compiled into byte code while running and the .pyc files for just about everything you write are readily available. This makes it excellent for both open source and proprietary developers as the code compiles to .pyc format as you run the actual program, and doesn't depend on you making time for compiling.
Kaye

Re: C# vs. others

Post by Kaye »

To me, C# is Microsoft's cheap attempt at imitating Java. It has quite literally no advantages over Java (automatic getters/setters? Please, welcome to objective-c properties) and implements almost exactly the same functionality. Their speeds are nearly identical as well as their syntax.

If you're going to use C#, you might as well just use Objective-C (at least that way your code is guaranteed to be 100% compatible with C). Not to mention the significant speed advantages of Objc over C#.

As for .Net and Mono.. not too much to say other than I don't really want anything that's so closely tied to Microsoft.

Ps. You say Java is not as cross-platform as it seems. Please elaborate on this. Short of Mono C# is not cross platform at all and I've never had an issue with Java in that respect.
User avatar
eiver
Level 5
Level 5
Posts: 568
Joined: Fri Jan 23, 2009 5:51 am

Re: C# vs. others

Post by eiver »

Thanks for your opinion. I don't agree with most of it, so I will try to defeat your arguments.
Kaye wrote:To me, C# is Microsoft's cheap attempt at imitating Java. and implements almost exactly the same functionality.
This suggests, that you assume that Microsoft tried to mimic Java, but they failed to do so. The story was: MS was good friends with Sun some time ago and Java virtual machine was by default on Windows. At some point they stopped being friends and part ways. That is when MS stopped including Java VM in their system by default and they started working on .NET Framework. MS basically borrowed (stolen?) most good ideas of Java. So both languages are very similar. They also analyzed a number of the language shortcomings (about which you can read from the links above) and got rid of them. So C# is in most cases the same and in some cases superior to Java, hardly a cheap attempt.

Kaye wrote:It has quite literally no advantages over Java (automatic getters/setters? Please, welcome to objective-c properties)
You included statements in this sentence which are self contradictory.
- C# has literally no advantages over Java
- advertisement of objective-c properties (which suggests having properties is an advantage)
So basically C# is not better than Java, because Objective C also has features of C#?
Kaye wrote:I don't really want anything that's so closely tied to Microsoft.
I guessed that you are an Apple and Mac lover and MS hater. I really do not want to shift focus of this discussion to "Mac vs PC". I'd rather focus on programming issues only.
Kaye wrote: Ps. You say Java is not as cross-platform as it seems. Please elaborate on this. Short of Mono C# is not cross platform at all and I've never had an issue with Java in that respect.
In practice you will often use additional frameworks, which are written in "something" and have Java wrappers. These frameworks usually exist only on one OS and using them makes the whole solution non-portable. Despite that, many companies (based on my experience and the experience of few my friends who work at different companies) do not care and still make Java programs which will run only on one OS.
As I said in the original post: I agree that Java has in general a better portability than C#. But I am quite content with the fact, that a C# application will work for 88.1%(windows) + 4.5%(linux) = 92.6% of users. (Based on source)

I never used Objective C so I cannot say anything about my personal experience. But I can reject it without even trying it out due to the following reasons:
  • garbage collection - poorly implemented, because not mandatory and even not available on some platforms
  • no namespaces - what a terrible choice. Anyone who worked on a project involving more that one programmer will know what I mean.
  • no operator overloading
  • not standardized - legal status is undefined because there is no standard. Is it open source (GNUStep)? Is it proprietary (Next bought by Apple, Cocoa API owned by Apple)?
  • not strongly typed - (based on Wikipedia) If this is incorrect, then please explain to me how types work in Objective C
You completely ignored the IDE. Having a good IDE is extremely important and makes a huge difference in terms of development time, debugging, etc. Can you compare Visual Studio to the best IDE for Objective C? (I have no experience in Objective C development, so I cannot really do the comparison) What is the best objective C IDE for Linux or Windows?
markfiend

Re: C# vs. others

Post by markfiend »

This discussion is rapidly vanishing from my area of expertise, but just a couple of points:
eiver wrote:In practice you will often use additional frameworks, which are written in "something" and have Java wrappers. These frameworks usually exist only on one OS and using them makes the whole solution non-portable. Despite that, many companies (based on my experience and the experience of few my friends who work at different companies) do not care and still make Java programs which will run only on one OS.
Your argument here appears to be "Java is bad because some Java programmers are bad programmers". A poor workman blames his tools...
eiver wrote:As I said in the original post: I agree that Java has in general a better portability than C#. But I am quite content with the fact, that a C# application will work for 88.1%(windows) + 4.5%(linux) = 92.6% of users. (Based on source)
For what it's worth, Mono is also available for Mac, so you can add in the 6.9% Mac users to your potential C# userbase too. (Whether your Mac and Linux users have Mono or not is a different matter.)
Kaye

Re: C# vs. others

Post by Kaye »

Not liking Microsoft makes me a Mac fanboy? This is a Linux forum my friend, you will find many people here who aren't big fans of either company.

As for
eiver wrote:
Kaye wrote:It has quite literally no advantages over Java (automatic getters/setters? Please, welcome to objective-c properties)
You included statements in this sentence which are self contradictory.
- C# has literally no advantages over Java
- advertisement of objective-c properties (which suggests having properties is an advantage)
So basically C# is not better than Java, because Objective C also has features of C#?
Let me rephrase that. Automatic getters and setters are extremely trivial. If that is the only advantage that C# has over Java, then that's hardly noteworthy. The point I was making is that C# is not the only language with automatic getters and setters, so by your logic Objective-C is a "better" language than Java which clearly isn't true. I have yet to see you provide a list of substantial advantages that C# has over Java.


eiver wrote:
Kaye wrote: Ps. You say Java is not as cross-platform as it seems. Please elaborate on this. Short of Mono C# is not cross platform at all and I've never had an issue with Java in that respect.
In practice you will often use additional frameworks, which are written in "something" and have Java wrappers. These frameworks usually exist only on one OS and using them makes the whole solution non-portable. Despite that, many companies (based on my experience and the experience of few my friends who work at different companies) do not care and still make Java programs which will run only on one OS.
As I said in the original post: I agree that Java has in general a better portability than C#. But I am quite content with the fact, that a C# application will work for 88.1%(windows) + 4.5%(linux) = 92.6% of users. (Based on source)
As markfiend said, this argument is completely null and void. I have never used a platform dependent API in any Java program I've ever written, and no good programmer would. One of the best things Java has going for it is complete portability; a programmer that breaks this portability is essentially breaking the language. All you have to do is look at the thousands of Java programs that run seamlessly on any OS to prove this point to yourself.
eiver wrote:You completely ignored the IDE. Having a good IDE is extremely important and makes a huge difference in terms of development time, debugging, etc. Can you compare Visual Studio to the best IDE for Objective C? (I have no experience in Objective C development, so I cannot really do the comparison) What is the best objective C IDE for Linux or Windows?
Again, I wasn't advocating Objective-C I was proving a point. If you're talking about Java vs C# I don't know how you can ever compare the IDE's. Mono is just not good and either NetBeans or Eclipse are both fantastic. Especially considering the number of extensions and plugins that exist for Eclipse. You say that "Eclipse is the best and most horrible," but if you know how to use Eclipse properly there is nothing horrible about it. Keep in mind that "I don't want to learn Eclipse" is not a valid argument against its merit as an IDE.
User avatar
eiver
Level 5
Level 5
Posts: 568
Joined: Fri Jan 23, 2009 5:51 am

Re: C# vs. others

Post by eiver »

Mono works for Mac too? - Great.
markfiend wrote:Your argument here appears to be "Java is bad because some Java programmers are bad programmers". A poor workman blames his tools...
This is only partially correct. I agreed with the argument that Java supports more platforms than C#. What you quoted is just my explanation, that not EVERY Java program will magically run on every platform even if Java exists on it. I did not want to say that Java is bad, because there exist bad Java programmers.

But since you mentioned the "bad programmer" argument, I think it is important to consider it. We can all agree that a "perfect" programmer will write perfect code regardless of the programming language. Therefore it is much more interesting to see how less experienced programmer will code given a specific task, the language and IDE. Humans make mistakes and the IDE, the framework and the language should help in eliminating these. That is why I think that no one should use C or C++ except people who develop Java VM, .Net Framework, Python interpreter, the OS kernel and maybe some very rare cases where extreme performance is required. Any argument for using C or C++ is automatically translated to an argument for using the Assembler.
Kaye

Re: C# vs. others

Post by Kaye »

eiver wrote:Mono works for Mac too? - Great.
markfiend wrote:Your argument here appears to be "Java is bad because some Java programmers are bad programmers". A poor workman blames his tools...
This is only partially correct. I agreed with the argument that Java supports more platforms than C#. What you quoted is just my explanation, that not EVERY Java program will magically run on every platform even if Java exists on it. I did not want to say that Java is bad, because there exist bad Java programmers.

But since you mentioned the "bad programmer" argument, I think it is important to consider it. We can all agree that a "perfect" programmer will write perfect code regardless of the programming language. Therefore it is much more interesting to see how less experienced programmer will code given a specific task, the language and IDE. Humans make mistakes and the IDE, the framework and the language should help in eliminating these. That is why I think that no one should use C or C++ except people who develop Java VM, .Net Framework, Python interpreter, the OS kernel and maybe some very rare cases where extreme performance is required. Any argument for using C or C++ is automatically translated to an argument for using the Assembler.
Do you program in any of those languages? Using C is NOTHING like writing in assembly language, and C++ can't really be grouped in with C. C is much more powerful and less bloated. C is in fact used for many enterprise level applications because of the significant performance increases and the ability to do almost anything you want. As long as you're careful, C is a great language (probably my favorite one when it's all said and done).
User avatar
eiver
Level 5
Level 5
Posts: 568
Joined: Fri Jan 23, 2009 5:51 am

Re: C# vs. others

Post by eiver »

I did program a lot in both C and C++. And a little bit in Assembler too, but noting commercial (just a clock and a stop watch on an integrated circuit). Now I am moving toward higher level languages, so I try to avoid C and C++ whenever possible.

I only said that the arguments translate and never said that C or C++ equals Assembler. Here's what it means:

You say C is much more powerful and less bloated than (C++, Java, C#, whatever?)
I say Assembler is much more powerful and less bloated than C.

You say in C you can do almost anything you want.
I say in Assembler you can do absolutely anything you want (you can completely exploit any functionality provided by the hardware)
Kaye wrote:C is in fact used for many enterprise level applications because of the significant performance increases
Actually C is used in those enterprise level applications, because most of them are 10+ years old. At the time there was no Java, Python or C#. What I see right now, is that companies often use C# or Java to interface with legacy software. The do not rewrite everything from scratch to save costs.
I would love see an example of an enterprise level application, development of which started less than 2 years ago and it is in C and it is not about something really low-level, where you indeed would need C.
Kaye wrote:Do you program in any of those languages?
Did you program in C#?
DrHu

Re: C# vs. others

Post by DrHu »

I couldn't locate the article I was looking for, I did save it, and this is a sample
  • Why Enterprises avoid Smalltalk...
    Was thinking about why enterprisey folks tend to eschew languages such as Smalltalk...
    Everyone has their own religion in terms of static vs. dynamic languages but the simple fact remains that there is a strong preference towards languages that do static typing. Some will be of the belief that this is a historical trend coming from the likes of COBOL and therefore Java is familiar in terms of the paradigm, however I believe something else is at play.

    Statically typed languages work better for the masses of unmotivated programmers that fill the corridors of large enterprises. They desire for computers to catch their mistakes. Likewise the notion of any enterprise caring about individual productivity of their developers is long gone. If enterprises continue to outsource to places such as India where folks may have lots of academic credentials but otherwise are horrific at software development (overgeneralization) then the ability to at least ensure that the code when it comes back that it can compile becomes crucial.
Statically typed languages work better for the masses of unmotivated programmers that fill the corridors of large enterprises.
I just wanted to highlight the business issues, since in an enterprise, that is really what is at play, that is the game, not technical expertise or technical solutions
And, of course the large percentage of enterprise programmers are unmotivated, they are considered code jockeys for the most part, and in order to eliminate errors, which might never be caught anyway, considering the oversight style that exists..) a business first and only approach
This problem of lack of technical expertise doesn't only apply to in-house programmers, but also to the so-called consulting companies, which have masses of code that fails to run on first install or has a multitude of problems..
--if companies measured (statistically) supplied code that didn't work, rather than wait until the end of a project to determine that the whole bag of code is a mess, there would be less code failure in systems as built (if we can even say that, since any carpenter or house builder will likely have a house or structure that at least works for the most part..)


That article came from the same person in this blog (James McGovern)
http://duckdown.blogspot.com/

About that C# thing
--I do agree that it is not as portable as Java (consider the source), but also that even though Microsoft doesn't promote C# as the new Visual Basic, that is actually the target programmer they are interested in, despite their affinity for C (not C#) within their own systems
http://www.amazon.com/exec/obidos/ASIN/0735625921/vbweb

It also happened, that historically the language du jour become C or C++
--sometime after Pascal (another strongly typed language) had become more popular

Dynamically typed languages have many advantages over the strongly typed (types), in terms of programmer productivity: the real version not the bag of code mess, that is often parlayed into a project..
--so I would pick python or smalltalk like languages over C/C++ or Java or others, like Eifel
http://en.wikipedia.org/wiki/Eiffel_(pr ... _language)

I'd also agree that Visual basic, C# and .Net are the new Microsoft paradigms of what constitutes enterprise level programming: which apart from the high flying abstraction of such a mission, is not something that means programmers will produce better code
http://bits.blogs.nytimes.com/2008/12/0 ... en-source/
--open source has a future and a present, other might not be so lucky..
  • Microsoft, of course, has long been the archenemy of the open source community, which is built on the notion of freely sharing intellectual property for the good of the community. I.B.M. and Sun Microsystems have embraced the open source cause, as have other technology giants. Even Apple’s OS X operating system is at its core open source — an Apple executive has said that more than 50 percent of the lines of code in OS X come from the open source Berkeley Software Distribution and related projects.
    Before science, there was alchemy, where people guarded their ideas because they wanted to corner the market on the mechanisms used to convert lead into gold.”
The highlight there is the business case argument, we know where that leads..
Last edited by DrHu on Fri Apr 30, 2010 1:39 pm, edited 2 times in total.
Kendall

Re: C# vs. others

Post by Kendall »

I completely agree with ikey about the use of IDE's. I've long been of the opinion that every feature of your IDE translates as a bug in your program. It's exceedingly rare that I code using anything more than a text editor and a terminal. Yes, a quality IDE boosts productivity, but at what cost to code quality and is the tradeoff really worth it.
mtrix

Re: C# vs. others

Post by mtrix »

i would not try to convince original poster otherwise, instead i would stand by his side and help him defend him.
I love c#, oh yes i do... its easy, its nice, its cool.

If microsoft suddently stated we cant use c#, ok ill go with Java. the overall switch wont be so painful, believe me... its like driving on BMW with automatic transmission and then going to Mercedes with manual... overall, you still know how to drive it :]
Kaye

Re: C# vs. others

Post by Kaye »

eiver wrote:Did you program in C#?
I can program in most mainstream languages and most esoteric languages as well. Learning new languages is a hobby of mine. I have done most extensive work in C, Java, and assembly. After learning C# and developing a few small applications with it, I determined there was absolutely no reason to use it in place of Java.
eiver wrote:I only said that the arguments translate and never said that C or C++ equals Assembler. Here's what it means:

You say C is much more powerful and less bloated than (C++, Java, C#, whatever?)
I say Assembler is much more powerful and less bloated than C.

You say in C you can do almost anything you want.
I say in Assembler you can do absolutely anything you want (you can completely exploit any functionality provided by the hardware)
By that logic, everyone should be programming in machine code. That argument is very flawed because of the inherent differences in the languages. C and C++ are very similar from a coding point of view, whereas assembly language is an entirely different beast. C is much more powerful than C#, but at the same time is not very different to code in. The same cannot be said for your C -> assembly comparison.
eiver wrote:Actually C is used in those enterprise level applications, because most of them are 10+ years old. At the time there was no Java, Python or C#. What I see right now, is that companies often use C# or Java to interface with legacy software. The do not rewrite everything from scratch to save costs.
I would love see an example of an enterprise level application, development of which started less than 2 years ago and it is in C and it is not about something really low-level, where you indeed would need C.
I would love to see some references that prove this. I'm going to go ahead and call bullshit though, because you won't find that source. It actually goes to show that you don't know very much about the current state of enterprise application development. Have you ever heard of Mozilla Firefox? It was started in 2006 and is written in C/C++. Google Chrome? C/C++ and Assembly. I think you severely underestimate the advantages of using a low level language over a language like C#. They are significant and numerous.
User avatar
eiver
Level 5
Level 5
Posts: 568
Joined: Fri Jan 23, 2009 5:51 am

Re: C# vs. others

Post by eiver »

Wow. I can see the topic has progressed while I was away.
ikey wrote:As for 'good friends' that's absolute rubbish. (...)
Sorry I completely forgot, that sarcasm was forbidden on this forum and some people may interpret my responses literally.
ikey wrote: I am of the argument that IDE's
have their uses, but more oft than not, they cause programmer laziness and error, making code even harder to debug,
Agreed - Every bulldozer operator should know how to operate a shovel. But this does not imply that we should only dig with shovels.
Especially things like integrated unit tests cause programmers to make more errors... *sarcasm again. Sorry for that, I guess I just can't stop it :P*
I on the other hand believe that a good IDE helps a lot. The programmer may spend more time on actually developing the correct logic for the program, rather than doing stupid repetitive tasks like manually renaming a variable everywhere in the code, etc.
Btw, what bugs can be introduced by hitting the "tab" key twice after writing "for", "switch", while, etc.
Kaye wrote:By that logic, everyone should be programming in machine code. That argument is very flawed because of the inherent differences in the languages.
I rest my case.
Kaye wrote: I would love to see some references that prove this. I'm going to go ahead and call bullshit though, because you won't find that source.
I based my opinion on stories from a very small ,totally non-representative and biased sample of me and 4 of my friends (working at Millennium BCP (bank), HP, Microsoft, Maconomy (erp) and IBM). And I would still like an example of a C++ enterprise solution development of which started less then 2 years ago... (something more complex than a browser please?). Chrome is a bad example, because it is based on WebKit (a 12 yo project), so it just proves my "legacy software" argument.
mtrix wrote:instead i would stand by his side and help him defend him.
I love c#, oh yes i do... its easy, its nice, its cool.
Thanks mtrix. I also think that C# is easy, nice and cool. But more concrete arguments are needed to convince someone who thinks otherwise.
ikey wrote:Java vs C#: What kind of an argument is that? (...)
Actually the fact that they are so similar is the very reason why they can be compared. Most features are the same, so focus on the differences.
Locked

Return to “Open Chat”