As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am taking software engineering classes at my university. I just took data structures and i am almost done taking design patterns. With the design patterns class the instructor let us choose what Language to use and what IDE to use on our labs. Since, i know C++ mostly i used that. Most of the class used c# and some used java..
Well, i just signed up for GUI programming spring term, and its the same teacher, and he said we can use whatever we like. Since, i have never really used C# i might be better of using c++? I have looked into using QT4 but i dont know how hard it is, and how much helps really out there? Since, there wont be much lecturing..
I am considering using C# since i have taken classes in VB.NET and have used winforms quite a bit. However, i would love to use C++ what are your thoughts? Is c++ gui something i might use in the future in the real world? or am i better off trying to learn C#
I would love to stick with C++ in my career path though..
I dont want to be stuck learning C# and GUI at the same time either.
Is QT4 a good way to go?
qt is not that difficult to work with. I have tried some gui tool kits for c++ and this is my experience in terms of c++
Qt
For c++ development and gui's i would overwhelmingly favour Qt instead of alternative libraries like win32 api, Microsoft foundation classes, etc.
Advantages
qt is cross platform and can be used on windows, linux, symbian, windows ce, mac osx
qt is not that difficult to learn. If you understand the basics of c++ classes and some template programming
qt is used to professionally create guis. I don't recall exactly but i think autodesk maya and adobe photoshop may be using qt for their gui's
qt4 has more than just gui programming ie it has libraries for networking, internationalisation, phonon for video and audio, animation framework, etc etc
Disadvantages
it's not a native library so your application would be larger than if you used win32 api but even then i still think its smaller than .net run time
To start learning qt now
find the book c++ gui programming using qt4 second edition. or another good resource
download the qt sdk for visual studio 2008
download the qt visual studio addin for visual studio 2008
create a new qt4 project and compile and run your first project
C#
i should state from the outset that i am not a c# developer but i know it has some good stuff
Known advantages
allows you to use windows forms, wpf, linq (language integrated query) etc
wpf is what you would be most interested in as a c# developer
Disadvantages
like all .net languages, it is still slower than native applications made in c++
not portable to different operating systems like mac osx, linux(But remember MOST USERS (90%) ARE RUNNING WINDOWS)
If you target users of windows xp, you would have to inconvenience them with having to download .net in order for your application to work. To me this is the biggest disadvantage of .net languages since most users i know have slow internet connections
To start learning gui development using c#
find the book windows presentation foundation unleashed or any good c#/ wpf book
Warning
i am not an expert in c++ or c# and am just giving my opinion or experience.
i have limited experience in c#
I am considering using C# since i have taken classes in VB.NET and have used winforms quite a bit. However, i would love to use C++ what are your thoughts?
If you want to use Windows Forms, and C++, then you might use C++/CLI (formerly known as Managed C++). This uses extensions to C++ to support .NET, and is the only .NET language that allows mixed CLI and native code, so once you glued you interface code to your application code, you can use ISO C++ exclusively.
That said except where I have been implementing an interface for existing C++ code, I have found it easier to simply learn C# which is designed from the ground-up to be a .NET language so is generally a much more comfortable fit.
In the ISO C++ arena, choices include Qt and WxWidgets, both of which are cross-platform and well supported by books and on-line information and communities.
I've used WxWidgets before (C++). It's easy and fun. Afaik, a significant amount of UI design is done with design editors or various XML/LUA importers, so the toolkit you use essentially doesn't really matter, because the event-driven code you will write will be very similar for almost everything.
The WxWidgets tutorials are great and the forums are helpful. If you're wondering how WxWidgets compares to other Toolkits, they have a great wiki page dedicated to it
Another question whose responses can be debated for time eternity. From my experience, I would say both languages have equally mature toolkits for creating user interfaces.
Hence for any project it only depends on what would be your preference. Generally, developing a UI using .NET is easier due to the fantastic RAD support provided by Visual Studio which unfortunately does not provide that level of sophistication for C++ based projects.
Having said that keep in mind that user interfaces exist on all operating systems; not just Windows. Hence you should focus on the basic tenets of GUI programming and treat the language only as a means of putting your thoughts into execution.
Hence if you really wanna do UI programming across all platforms; then C++ is the best bet ( of course these days you have Mono but not sure if they have a QT based toolkit you are looking at).
Quite a mouthful - but to make it short:
It is all about your choice and learning. If you wanna learn C# and use it go ahead. But if you are comfortable with C++, you can still use it and there is nothing that can be done in C# but cannot be done using C++.
Well, I couldn't possibly give a better answer than Dr.Deo, but I can share my bit. I used to do a lot of GUI programming before (more than 5 years ago, with Borland's VCL in either Delphi or C++). I recently had to produce a GUI for a little project, so I went for Qt4. I was able to almost entirely finish the GUI in one day without any prior knowledge of Qt4 (of course, it was a simple, one-window GUI). I found it very easy to use and quick to learn. If you have any GUI experience at all, it will be very intuitive. As for C++ knowledge required, it's minimal. You have to be comfortable with a fair dose of inheritance and polymorphism, but that is very typical of GUI tools and it really is just basic C++ knowledge of OOP.
I think several people have already made the point about being cross-platform. This will be more and more important in the future as alternatives to Windows are becoming mainstream (basically all the people I work with either have a Mac or run a distro of Linux) and as more in-between phone and tablet-PC products are emerging.
And, anyways, the language you use for programming a GUI isn't really that important, it is the tool-set. I think Qt4 is very complete. It also save you the trouble of interfacing to your existing code (let alone learning C#). Finally, Qt4 is very nicely usable with any IDE or build system (if you don't want to switch your code to qmake and/or Qt-Creator).
It kind of depends on what you are trying to learn.
If you want to learn about how GUI libraries work as opposed to how to use them then you want to look at plain Win32.
If you want to learn how to use them then you'll find C# or VB with WinForms the easiest to pick up. And of course they let you use a great designer.
Don't worry about issues like cross platform whilst you are learning the basics! You should focus on learning principles rather than specifics.
As #David Heffernan said, don't worry about cross platform unless you must have it (premature optimization). There is a price to pay for that flexibility that most cross platform kits offer. Further, from my years of experience as both a developer and a user, native platform toolkits generally offer a better end user experience (often less surprises about what and how the user is allowed and not allowed to do with each control or surface).
In a learning environment, you want to consider what you hope to accomplish in a semester. A typical three month overall semester schedule with successive milestones suggests you'll want low friction. Learning a gui library can be an excellent achievement, but you'll probably want some basic familiarity with at least the environment or context before you get started in order to actually complete the intermediate tasks in a timely manner: presumably interactions and otherwise general user experience are at the core of the class' focus.
For these reasons, I would consider sticking with c++, as you have a sense for the paradigm and fundamentals of the language and tools. But, because it is a learning environment, I would strongly consider something less mainstream, but ripe with potential in the library. I might look at hardware accelerated windowing libraries, either OpenGl based xgl if targeting unix/linux, or Windows Presentation Foundation if targeting Windows.
For GUI programming you could go for Visual C++.
It's hard to code everything in VC++ so people go for MFC.
MFC provides 100s of classes that make life much easier. So all you need to do is learn the basics of VC++ and learn MFC.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am nearly done with a course about using OOP in C++ and all the programs we wrote in that course were console applications . I also finished a university course in C programming so I think I have solid C programming basics and now is the time to make a big step towards GUI .
I did a lot of googling and each time I read more pages I get more confused , I learned that there were too famous options in the past which are WinAPI and MFC. I tried to look into the WinAPI but It seems pretty tough and needs a lot of time so I asked my instructor's advice and he told me that If I wanna write GUI programs I would better learn C# or Java rather than using C++ which is faster but better designed for low level programming applications like drivers and so . So I searched the web to find if C++ is still used in writing nowadays applications and to my surprise Firefox, Google Chrome, Notepad++ and many other GUI applications on sourceforge.net are written in C++ in contradiction with my instructor's advice.
Also I learned that you can use QT or GTK libraries to build GUI applications in C++ but I have no idea ow to do that or if that is true.
So My question is what are the nowadays best available options to write GUI programs efficiently no matter how steep is the learning curve. I googled for C++ GUI options because It think it will be faster than Java or C# apps, If anyone has a different opinion state it please.
First of all, if you want to lean to write platform independent GUI then C# is no go.
When you write GUI in C++ there is a question of toolkit, Qt and GTKmm provide you very solid cross platform toolkits. While Qt has more "native" look and feel on Windows than GTKmm, Java Swing allows you to write very good GUI as well but it would be heavier and slower then one written with Qt or GTKmm.
Now... C#/WPF same issues as Java GUI - slower then native, but also it also locks you on one platform only.
My personal advice start from Qt.
If you are new to GUI programming C#/WinForms will be best for you. It rather simple, have a great community around it, have a lot of ready-to-use controls.. and best documentation ever - MSDN.
Sure, if you are looking for deep knowledge of "how things works" you then have to understand Win32 GUI. So, you can always back to C++/MFC for that. I would not suggest any other C++ libraries (as Qt), not because they are bad, but because they require good experience to start up.
My suggestion is start with WinForms, undestand the basic and learn to create simple application. As soon as you are master in that, go deeper :)
Try Juce.
The fastest way is to use C# and WPF. It's fast and simple for small applications but can be pretty complex in my opinion and there is a lot to learn. At least you are future proof, Microsoft is pushing WPF themselves finally. (Visual Studio uses it, and there will be a lot more versions to come)
The only real downside is, that you will only be able to run the application in Windows.
If you really want the "low level" access, there a lot of interop options with C++ code.
It depends on what kind of GUI application you want to write. If you want to write a shrink-wrapped app like MS Word or Firefox, then C++ is the way to go, because the market demands the last little bit of performance, with minimal dependencies. OTOH, if you want to write (for example) an interface to your company's database, the performance of the GUI is normally not important, but delivering something quickly and cheaply is, so you should use something more RAD, like C#.
Qt is very good. People say WTL is also nice, but I didn't used it.
Java and GUI does not fit very well in my head. There are some native to Java GUI libraries (AWT, Swing) but they are slow and don't provide interface native to platform it runs on. There is also SWT, which is used by Eclipse, but haven't seen any app besides Eclipse using it.
If GUI needs are simple I'd stick to C#: you drop some controls on your form, write some logics behind it and you are ready to go. If you need some really complex GUI then I don't think there would be a huge difference in development time between different languages.
C++ is good for speed (HTML rendering tools like chrome / firefox or image editors like photoshop) and for performing "feats" you might not otherwise be able to do on other platforms.
But it is more painful to use and there is much more of a luearning curve on any of the C++ based UI libraries than you would care to learn.
Since you do not seem to require any of this, as is clear from your question, your default choice should be C# or Java or Web based like your tutor advised.
C++ never dies, so that learning it is not a wrong decision. However, it is quite difficult to write GUI applications using C++ during early days. Therefore, I suggest you to use C# t write some GUI applications before switching back to C++.
Not exactly an answer to your question, but if you are still in learning and not in the production line, try learning Win API. Actually, I am surprised nobody told you that.
You see, all other frameworks /API /SDKs are actually just wrappers around this API, and chances are that whenever you are asked to do something non-standard in your GUI you will not find a solution within your framework and will need to dig down to Win API anyway.
Yes, it is Windows only API, still knowing what is actually going on behind the scene may be very handy at times.
Just my 2 cents.
If you decide for C++, have a look at wxwidgets - this way you don't limit yourself to just one operating system (windows in this case with MFC). Also QT should be good, but I've never tried them (I do not have much experience with wxwidgets either, but the few times I had to do something with them, they worked pretty well).
If you don't need high performance in the gui, have a look at scripting languages - Python has a default library that works well (tkinter) and also binding to wxwidgets
If you insist on using C++, try Win32 or GTK. See this thread.
Otherwise I recommend you try another language such as Python for the GUI part of your applications: Keep the rest in your preferred language and wrap. Do not forget the best feature of C++: binary compatibility with C.
If you have c++ foundation and want to expand that I recommend to start from Qt. It's distribution includes graphical UI designer and Asistant - browser for documentation. There is also separate product Qt Creator - complete IDE tailored for Qt which have everything integrated (including compiler). All of this if free and really easy to setup. Excellent tutorials included. Qt also includes non gui classes for common programming problems (like containers, variant type, etc.). You can convert your console application to GUI in a matter of few hours and decide if you want to continue learn it or try some other toolkit.
Just go to http://qt.nokia.com/downloads download SDK, install it and you have everyting to start coding.
QT is nice, but I have tried JUCE and now I think it is better.
JUCE is fast, clean an easy to use. You can integrate it with Eclipse and GCC (and minGW), use debug features (gdb under Eclipse) and more.
You can compile your code in Windows, Linux, OSX, IOS and Androis without makes much changes.
Keep an eye on their website:
http://www.rawmaterialsoftware.com/juce.php
If you speak Spanish look at this link:
http://juceratot.eshost.es
Regard
I’d like to develop an application with a complex GUI (combobox with animation, charts with spline, transparent layers, …). I have good experience with C# 2.0 and I’m studying WPF, but I read that, unfortunately, there is no plan to port WPF to Mono.
If I stick with C# and create custom GUI controls using OpenGL (via OpenTK), I feel it will be a hard work (integration with GTK#, debugging, hard to use to design forms).
I can use Java (with JOGL), but I’m not very skilled with it, and I don’t know about performance issues.
Last option is C++, but I have to do a big revision (years since last time I used it), and I find it hard to develop GUI and portable applications in C++. (Maybe I’m wrong! Still, I’m quite afraid to develop such complex application with this language.)
What is your advice? Had I better choose C# + OpenTK, Java + JOGL, or return to C++?
I would go with Qt. Take a look at http://qt.nokia.com/products/ . If you are afraid of C++ (but there is no reason to be afraid of it), you can try with Java Swing. I think that those are the best options to go with multi platform desktop GUI development.
I would suggest Mono and GTK#. Developing apps with .Net is far more effective than doing it in C++ vanilla. Sure, you have to stick with C# 3.0 and .Net 2.0 (some features from 3.5 is implemented, like LINQ). But it still gives you a lot more than C++ with, for instance QT, would give you.
Go C# for productivity. Nothing against C++ but it's a bit verbose.
As for the GUI library, I think WinForms used to work on Mono. Alternatively, GTK#.
I would not suggest using wpf for it is a platform dependant platform. Silverlight might be a better option.
But if you are developing a web application, jquery would be a nice option you also might consider adobe flex and adobe air; http://www.adobe.com/products/air/
Does multi-platform have to include iDevices? Can it be on the web? Those are 2 questions you have to answer first.
If you can live without iPad/iPhone suppport, then Flex/Flash/Air is good option for highly graphical things. It is multi-platform for sure and easily integrates to the web. Probably your best option for this case with the limited details given.
Qt could work for you as well, although I can't say for sure if it's graphic library will make it easy. I've personally never worked with it, so other would have to answer that. But since it is in C++, you could use other libraries as well.
Java Swing sounds rough to me for this complex of a GUI. Making some basic stuff isn't too bad, but if you are expecting an experience like with C# I think you will be frustrated. Just a personal opinion of course.
Lastly, if it can be a web app, why not stick with C# and Silverlight? A .NET solution may work well for you since you are already learning it.
Silverlight runs on Windows/Mac/Linux and some handhelds, and is being ported to more handhelds. I believe Silverlight will ultimately be ported to every popular device.
Silverlight is:
Much, much more powerful than Flex/Flash/Air.
Much, much more powerful than Qt.
Ridiculously more powerful than GTK+ or GTK#.
Ridiculously more powerful than JOGL.
Silverlight has all of the features you have requested.
Silverlight works very well with C#, which is a much more productive language to work in than C++.
Silverlight is basically a very large subset of WPF, so if you already know WPF, you already know Silverlight.
Unless you absolutely require iPhone/iPad support I think the decision is perfectly obvious.
See this comparison of WPF and Cocoa to get some feeling of how WPF/Silverlight compares with the likes of Qt, Flash/Flex/Air, and GTK#, all of which use a primitive WinForms-like object model similar to the one used by Cocoa.
At my day job (a well-known microprocessor company) we develop complex engineering apps with Java, Eclipse RCP, and Java OpenGL. Performance is good -- we can easily get many millions of polygons/second and up to 100 frames/second. The SWT widgets in Eclipse are fast enough where we haven't had to render any custom controls with JOGL.
I've got a set of tutorials that shows how to get started with this kind of programming. The series starts with http://wadeawalker.wordpress.com/2010/10/09/tutorial-a-cross-platform-workbench-program-using-java-opengl-and-eclipse/.
First, don’t use C# for anything that should be portable. Mono is a bad option for GUI for two reasons:
Mono goes always several steps behind .NET.
Mono does not support WPF, so the only way to develop GUI is using something like GTK#.
My personal opinion – use C++. It would give you very good portability and independence.
You have two options:
Qt4 – very good GUI toolkit, makes GUI development very easy, and highly portable.
GTKmm – also very good toolkit, but it feels less natural on Windows.
Also, Java has Swing toolkit that comes with JDK and is available on all Java platforms, even very strange ones like OpenVMS.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've done my C++ classes and practices after which I started learning Visual C++ using book Ivor Horton's Visual C++. The problem is that I am unable to understand the language of this book and badly trying to understand the codes. I want to learn Visual C++ for Windows application development and making my future in that (also because I already know C++).
Some of my friends told me to switch to C# since it has many library function to create GUI etc and told me it's hard to code Windows applications in Visual C++.
Now in these holidays I am going to join classes, can you help me which language I should stick to, and which one will be easy?
From very beginning I want to learn Visual C++ and sometimes I think it's hard when I don't understand concept in reference books etc.
Any help will be very appreciated, thanks a lot for taking your precious time.
Visual C++ and Visual C# are not languages nor GUI frameworks; they are Integrated Development Environments - IDEs. This means they are text editors tailored to the task of development.
Visual C++ lets you code in C++, Visual C# lets you code in C#. Also, both let you create GUIs in a point-and-click manner.
Sounds like what you really want to do is create GUIs. In that case, without having further information, I recommend you go for C#. It is a much cleaner language than C++, it has fewer ways to shoot yourself in the foot, and it provides access to the immensely useful .NET framework.
C# features that C++ doesn't have:
Fully automatic memory management
Lambda functions¹
Type inference¹
Reflection
Remoting
Automatic serialization
True entity types
Properties
Database integration via LINQ
Convenient functional-style programming via LINQ
No header files
No undefined behavior
Direct interoperability with many languages
Compile once, run everywhere
¹ these features have been added to C++ in the C++11 standard.
C++ features that C# doesn't have
Template metaprogramming
Typedefs
Zero-overhead principle
Means to enforce const-correctness
Mature compilers that produce extremely optimized code nowadays
Much wider platform support
can you help me which language i should stick to , and which one will be easy.
In general, if you're goal is to develop Windows Applications, you'll probably find many, many more simple examples to learn from in C# than in C++. There is a huge community around C# for Windows GUI development.
That being said, many of the concepts you'll need are the same in any language you learn. You can't really go wrong - at some point, you'll probably want to learn both langauges if you're going to program professionally (as well as others).
i think it's hard when i don't understand concept in ref books etc.
You should get a beginning programming book, not reference books, and go through it step-by-step. If your goal is just GUI development, I'd recommend a good, simple C# book, and just step through it form beginning to end, and do all of the examples. Learning from a "reference" book won't work - it's reference material, and not meant to teach concepts.
C++ vs. C# - a Checklist from a C++ Programmers Point of View
http://www.thinkingparallel.com/2007/03/06/c-vs-c-a-checklist-from-a-c-programmers-point-of-view/
C# is the premeir .net language for developing applications on the .net framework.
Native C++ is more cross platform and low level. It's used for writing applications for windows, mac, linux, embedded systems, etc.
C++.net is C++ adapted to the .net platform, and is primarily used for writing performance critical parts of an application (the rest of which is written in C#, VB.net, or something else as they integrate virtually seamlessly).
Visual C++ is microsoft's windows compiler for C++ that can be used to write native and C++.net applications.
Writing .net applications solely in C++ in much harder than writing them in C# as you have to deal with more low level issues. If you want to write .net applications, I recommend using C# and C++.net if you need it.
with C++, you could be able to touch the 'low level' near 'assembly things' part of programming
c# is never meant to be created to beat c++, with c# you get the whole .net framework utilities, faster cleaner form generations, with the lack of 'low level' part
C# is largely intended for Business Applications so as Java. Visual C# is Microsoft's implementation of the C# programming language specification, included in the Microsoft Visual Studio suite of products.
C# is much slower than C++, since the code passes through CLR. VC++.net has the same drawback.
VC++ is very hard to learn, so as MFC and windows programming, even though you know C++. But is it a prestigious and efficient language.
It is easy to switch from VC++ to VC#. But the reverse is harder.
If you go for VC++, MFC and Windows programming, try this.
Maybe consider what you are likely to want to do in the future, as a professional or a hobbyist. Programming is a wide field, in which both languages have their place. If its too early for you to make that decision, C# is probably most likely to do you good in the future.
It's worth remembering that they are both only languages - and just as writing a good book is about more than correct spelling & grammar, writing good code is about more than the details of a particular languages syntax.
I would learn both.
Having said that, I would create GUI/Application projects using C#, and use VC++ for any COM or device communication.
I would check out Which platform should I use : native C++ or C# ?
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Java is a popular language & platform, having a huge ecosystem. Are there any features that C# 4.0 onwards and its platforms should have, to make you completely switch to C# programming?
Make it run on as many platforms as Java?
Otherwise it is completely irrelevant to us.
.
.
.
Edit: For a discussion about Mono making .NET "cross platform", see https://softwareengineering.stackexchange.com/questions/20275/mono-is-frequently-used-to-say-yes-net-is-cross-platform-how-valid-is-that
Edit 2015: Microsoft has decided to open source the backend part of .NET, which will enable community to port this to even more platforms than Java runs on. I consider this the ultimate move against the oracle approach to Java evolution.
Edit 2019: .NET Core is now available for Linux, and therefore as Docker images. Our experiences so far has been very nice. We have a mission critical application which runs nicely in Kubernetes, and we have no particular preference for writing microservices in either .NET or Java.
The general uptake of C# in the marketplace has nothing really to do with language features, which I understand are now superior to Java. Adopting C# requires a complete organizational strategic shift in the main:
You already have a gazillion Java applications and a host of Java developers. Why switch C#? You'll need new staff and suddenly all of your applications are legacy by definition. This is a huge deal! Undergoing this change puts a huge risk on your company for what may be only slight benefit: why bother?
You are used to at least the option of many large providers of operating system and middleware which support your Java ecosystem. This disappears overnight and you expose yourself to a monopoly pricing model (i.e. you are pretty much tied in to Microsoft, to all intents and purposes). Being subject to monopoly pricing is bad! Most organizations would rather have a slight technological disadvantage to avoid monopoly pricing because the pricing will almost certainly take away any extra revenues anyway.
I don't actually think that C# has anything less going on for itself than Java, except for the ecosystem like IDEs, frameworks, etc. In terms of features, it is well ahead at the moment at least.
I think .NET is great, but don't use it, because it lacks the #1 mandatory feature : portability. Yeah, there is Mono...
Another thing that really pushes Java is Eclipse (*): it is the most successful and complete free development environment to date. And, together with a huge amount of (mostly free) plugins available, the cost/benefit is unbeatable.
The pair VisualStudio C# + Reshaper can get close but it's not quite there yet...
(*): Some even say Eclipse is the main reason why Java found so widespread use.
My answer is a litle about why I think so many use Java, but want to use c# in schools:
At my university, Java is the first language we learn, and is the language that we learn most about later also. I guess this is common.. But even tho we learn some python, c, c++ and already know a lot java, most students use C#. This is because everyone is told that C# will give them a job :) The school knows this, and I know one feature that would make C# the new primary choice for the school: make it run on all platforms =)
We were taught on college that there is nothing engineerical in MS Windows. How many people can (dis)agree with that?
How can we as developers answer to questions of stability, robustness, scalability, availability, transactional isolation, concurency when building some serious software system by working on an OS which is pale of 'something' and just anywhere you can expect some nonstandard behaviour surprise and potential source of problems which you can solve only by calling MS and pray God they will find a fix for you not in a long period.
Open Source is our only salvation.. Java respects standards, invests much energy in security model, keeps WORA, and it is rather simple language.
I can think of C# having unsafe pointer, thats just enough for me to give up on doing serious business with it if there are many people working on it. ..
Come on guys, if you do real serious software and would like to have kind of multiplatform support, NET will never be the thing you need or you would want to.
It wasnt even designed to support that.
I would definitely consider using C# when Microsoft buys Novell and gives official support to Mono.
Then, the next .net release will have to run on Windows and Linux ( OSX wil still left behind - like today with Java but with Java is because they wanted that way- )
Until then, Mono is behind the latest .NET version, and is still adding to it's core some Linux specific features ( like the Mono.Linux "module" ) that obviously doesn't run on Windows.
Language features are great, but if I want something more "dynamic" to work with, I would rather use Ruby or Python
But, that's just me.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I want to know why I should learn C#?
What features does C# have that Java does not?
C# is an object-oriented high-level language which can be useful to develop applications.
It supports getter/setter constructs, delegates and true generics, which Java does not.
C# usually feels more "native" on Windows, since Windows.Forms and WPF are closer to native code than Swing.
However, Java is more cross-platform than C#(even though project "Mono" is changing that)
There's a whole lot of differences: http://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Java
Whether you should use one over the other depends on your priorities. What do you want to write in them?
C# (and other the CLR languages) have aspects of functional programming (such as delegates and closures) that make some types of development and design patterns easier. See this post by Steve Yegge for more. Delegates can make code much more expressive and concise.
You should learn both, and use each of them as appropriate. I don't feel like it's a "which one should I learn?" kind of question. (Or a "I know Java, why should I learn C#?" question.) That comparison that Welbog posted will help you decide when to use one over the other. But, myself, I like having both in my toolkit.
Syntax:
They are both reasonable languages--they support pretty much the same high level structures and designs (OO, encapsulation, ...) and are fairly equal up until you get down to the code level (which overall isn't that big a deal. C# beats java in features, Java beats C# in simplicity I guess).
Portability:
My biggest factor has been that lately I've worked on apps for a spectrum analyzer and upcoming cable systems. Neither would have been remotely programmable in C# (you are completely reliant on microsoft to port the runtime to your platform of interest. Java is open source (there may still be one or two little pieces that aren't, but they are sincerely working on that and it's enough that you can port it and use it just about anywhere.
If you are only ever interested in Windows and if you'd like to take advantage of tight, simple integration with windows, then C# is the platform for you.
VM
Both languages include a "Runtime" that can support other languages--and those other languages generally have access to the (very rich) libraries provided in each environment.
Microsoft can run a few (a dozen) languages on it's VM, none as impressive as C# (although Ruby and Python could be good--are they fully available yet)?
The JVM has a few hundred including some cutting-edge experimental languages that often run as well as or better than their native counterparts. Some are considered the next generation in programming, as different from Java/C# as they were from C. I looked into Scala, but I must be getting old, it just hurt my head, but I admit there are some very advanced concepts available in there. Groovy rocks.
System integration/tools:
C# wins hands down since Java can't commit to any one platform. C# is also very well integrated with databases and other external dependencies, Java is getting better integrated, but the tools are a little more mismatched. C# the entire toolset tends to be very integrated since it all tends to come from a single vendor.
Number of platforms using it (number of potential customers):
Last I heard, Java wins hands down. WAY down. Every try to figure out how many phones, microwaves, TVs and toasters might be running Java? The number dwarfs every other language combined as I understand it...
the only reason you should is because you want to
C# is a
multi-paradigm programming language that encompasses functional, imperative, generic, object-oriented (class-based), and component-oriented programming disciplines
so you get to learn a lot of tricks from different paradigms, all in a single language
There are lots of questions that people have asked on this topic already. Read up, they've got good infos there. :)
The biggest reason, imho, why is because (for windows desktop apps at least) Java UI is godawful ugly. Fugly ugly. Vomitously ugly. Ugly like the kid you'd have if you impregnated your sister.
If you are required to run on any OS, Java is your best option (tho Mono is catching up!). But if you're programming for the Windows environment, C# is a dream to code and looks like any other native application.
Other than that, I'd say Linq. And the ability to fail fast on exceptions rather than having to handle exceptions everywhere (like we actually know how to handle each and every exception). Oh, and Linq again. Linq is so beautiful... to me... Can't you see?
Crap, forgot about lambdas. Damn, I love lambdas and all their closure goodness.
Simple answer -- C# is the primary language for developing Micorosft applications at this point. Learning it opens up a new world of potential opportunities to work on Microsoft-based applications.
Also, it's not really that hard to learn. Just a little harder than VB was, but with lots of OO power.
Some people would say C# is Microsoft's Java -- actually they look almost identical, just minor differences but different class libraries. If you already know Java, picking up C# shouldn't be too hard.
I can't believe nobody has posted this yet..
Because, it is a fun language. Personally I think Java is a rather nasty language (still can be fun), but not as enjoyable as C#.
Do you need to learn C#?
Is your job situation going to improve?
Do you want to learn something new?
Is the development environment better in C#, is the tooling better?
Do you think you can do something in C#, that you can't do in Java?
Maybe a generic language for desktop, web and mobile - but Java has this as well.
Just a few questions you could use to decide.
I'm C# myself, started out in Java when I was introduced to programming. I think Java did a fantastic job for me in understanding programming, mostly because there were no magic IntelliSense, or form designer for Windows apps - we had to write the whole damn thing our selves. Which was good, when you're learning. But I think C# and the whole .NET/Visual Studio eco-system enables you to be more productive.
More important than the feature of the language are the run-time environment and the libraries.
C# and Java have a different set of libraries, frameworks, operating system interactions, etc.
Based on the question seems like you are not interested in learning it for the sake of knowing more about programming and clearly looking for practical reasons.
That is why I don't think you should bother learning it, since it will be just another tool to accomplish same thing in your toolbox.
I like what Welbog wrote. I would add that it would also depend on where you're at professionally, your interests, and your job prospects /interests.
If you're you've just started to learn Java, then picking up a little C# might help in terms of broadening your programming horizons. The languages are similar (roughly speaking), but of course there are nuances to say the least in programming in one versus another. If you've been programming Java for awhile, then perhaps you'd be better off either expanding your J2EE area of expertise or maybe looking at other supporting areas and/or languages.
In terms of job prospects, you might find companies in your area hire more .NET developers than Java, or vice-versa. You might also want to look at companies you want to work for and make sure your skill set matches. For example, if you've dreamed at working at a particular firm who uses JSP, just as an example, then sticking with Java would be better.
It is not C# that you should want to learn but .NET Framework and related technologies.
Think rather J2EE vs .NET.
Why would you want to learn .NET? It's up to you to decide. Like Java it's one of the few major development platforms. It is functional, very actively developed and supported with a huge community knowledge base.
To me the choice is as simple as I need to use .NET libraries, so I'll use C# or I need to use Java libraries so I'll use Java. If I'm working on something on a Windows client I'll use C#, if I'm working on something that needs to run against the P6 Integration API I'll use Java.
You shouldn't feel like you you are missing something or should use one or the other. Look at what you have to do and pick the best tool for doing that.
It's tough to list on a post here all the features of the .NET Framework, just like it would be tough to list all the features contained in the Java SDK Libraries.
Learning C# because it may or may not have features that Java doesn't have seems like a very odd reason in opinion (it does have a number of features, that Java doesn't but so does F#, LISP, Haskel, Ruby, Lua and even COBOL).
You should learn C# because
You need to (to keep or get a job, stay in school, whatever)
You want to
It is fun to expand your horizon
Any or all of the above
There are some syntactic sugar advantages in .NET such as LINQ or Properties. (Yes, you don't have properties - not to mention auto-properties - in Java).
Strategically, it helps to know several languages as demonstrated by a little research. Currently, PHP, Java, and ASP.NET (C#) are the most widely used server-side programming technologies (see https://w3techs.com/technologies/overview/programming_language/all). Therefore, knowing all three empowers your backend engineering potential.