Visual C++ vs Visual C# , which is the best to learn? [closed] - 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.
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# ?

Related

GUI programming c++ or c# [closed]

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.

How Similar are Java, C#, and Python? [closed]

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 12 years ago.
I know it is a kind of broad question but any answer are appreciated.
All:
Require some form of runtime on your system (JVM/.net/Python runtime)
All can probably be compiled to executables without the runtime (this is iffy and situational, none of them are designed to work this way)
Are good languages
All have specific areas where they are much more appropriate than the other two
Java:
Tries very hard to be Cross Platform--generally succeeds
Little access to platform features that are not in the SDK
Slowest of the three to change and does not contain features common to the other two such as closures
Very backwards compatible (partly because of the previous point)
FAST (about 2x slower than C, quite a few x faster than python)
Probably has the most library support of the three
Strong multi-platform server systems already deployed using J2EE
Scales down to embedded (I've worked on 2 different embedded java projects--coming soon to a cable box near you)
Static
C#
Quicker to add new features
Windows only--Mono is cross platform but does not have the library support.
Started very similar to Java but has many more language features now.
Much better access to windows APIs
Not sure about speed--I think it's similar to Java.
Very good library support
The only one of the three that you have to pay for (it's free for "entry level")
Static
Python
Language is cross platform. Not sure about non-language platform access (such as drag-and-drop)--anyone know?
Probably an easier language to learn
The only one of the three that does not use c-like syntax
Slowest of the three, but still pretty darn fast compared to other dynamic languages.
Dynamic
This link is also interesting
Python is a dynamic language where Java and C# are really not. It is totally different than the other two. There are ways to accomplishing things in Python that do not translate well to the others and vice versa.
Java and C# look the same, but they have differences between the two under the sheets. Being an expert in one, does not make you an expert in the other by any stretch of the imagination. The syntax is similar and libraries are too, so it would be easier to get up to speed in one or the other, but there are subtleties that can trip you up.
C# and Java have almost identical syntax and very similar libraries. There are differences that you have to be aware of (Type Erasure in Java, for example).
Python is a completely different animal. It is a dynamic language (where the other two aren't). Python winds up being closer in style to something like Ruby.
Java and C# are statically typed languages, while Python is a dynamically typed language. That's a huge difference.
The syntax of Java and C# is similar (but I would not call it "almost identical" as Justin Niessner says).
Java and c# are pretty similar in terms of syntax and are mostly strongly typed (C# is getting more dynamic with every version), Python is a dynamic language
Java and C# are very similar and are syntactically similar to C/C++. They also use braces to mark code blocks.
Python is completely different. Although imperative like Java and C#, Python uses indentation to define blocks of code.
Java and C# are also compiled languages, whereas Python is interpreted and dynamic.
Python, Ruby, and Groovy are somewhat similar languages.
C# and Java are easy to move between, although I don't know many people who are experts in both. C#'s syntax is based off of Java, so they read very, very similarly. They both run cross-platform; Java on the JVM, C# on .NET or Mono. They're both OOP, and widely used for web development. I'd use whichever the team was more familiar with.
Python's off to the side there. It's also used frequently as a scripting language. It can use classes and object orientation, but isn't forced to. It's not as well supported for web work. I'd use this for a different set of tasks than C#/Java.
C# and Java are the two languages you listed that are most similar. Python has a very different syntax, and uses a slightly different programming model. Both C# and Java are Object Oriented languages at their core, with increasing nods to Dynamic Typing. Python began as a Dynamically Typed scripting language and has been picking up more and more Object Oriented features over the years.
The C# class library (.NET Framework) is theoretically multi-platform, though it's heavily weighted towards the Windows platform, and any other OS compatibility is largely an afterthought. The .NET framework currently has two "official" frameworks for building windowed applications (Windows Forms, and WPF) and two "official" frameworks for building web applications (ASP.NET, and ASP.NET MVC). Windows Forms is similar to Java Swing, but the other four frameworks are very different from much of what is found in the Java or Python worlds. There are many language features in C# that are different or lacking in Java, such as Delegates.
The Java class library is pretty solidly multi-platform. It's officially supported desktop and web frameworks (Swing and J2EE) are generally regarded as slow, and difficult to use. However, there is a very lively open source community which has built several competing frameworks that are very powerful and versatile. Java as a language is very slow to introduce new language features, though it is runtime-compatible with several other languages that run on the Java platform (Groovy, Jython, Scala, etc..). Java is the language which has has the most run-time optimizations put into it, so an application written in Java is almost certainly going to be faster than an application written in C# or Python.
Python is an interpreted language (in general), and is pretty solidly multi-platform. Python has no "official" desktop or web frameworks, though desktop applications can be written using GTK or Qt support, both of which are multi-platform. Django has become a de-facto standard for Python web development, and is regarded as a very powerful and expressive framework. Python is at this point fully Object Oriented, and is notable for it's powerful tools for working with collections/arrays/lists. As an interpreted language, Python will be significantly slower than either C# or Java.
Python was made to be simpler, more readable, flexible and object oriented than what existed before - i.e. Java, Perl etc. It's actually closer to Java than it is to Ruby. Ruby is more like Smalltalk. Think of Python as Java without the stuff that mostly gets in your way, makes things awkward to do, slows you down or clutters the essence of your logic. So no semi-colons, curly braces for scoping. No static variable declaration or variables at all really they're identifiers that point to objects instead.
There's also a standard style guide for Python unlike other languages. Indentation is used to indicate scope and inconsistent indentation is a syntax error.
It also includes some often used things built into the language: lists, dictionaries, sets, generators etc.
Java is nice for those familiar with C / C++ syntax and are set in their ways, like that syntax and find it readable. Ruby and Python are for those that preferred Pascal or Smalltalk to C, like Lisp etc.
They are not similar at ALL. They all take widely different approaches to OOP, syntax, and static/dynamic typing.

What features should Java 7 onwards have to encourage switching from C#? [closed]

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 11 years ago.
C# has a good momentum at the moment. What are the features that you would need to have in order to switch (or return) to Java?
It would also be quite useful if people posted workarounds for these for the current Java versions, e.g. Nullables being wrapped around custom classes, to make this a much more interesting wiki.
As a .NET/C# developer here are the missing features that annoy me. This list in no particular order - just as thoughts come to mind:
The Java library is too small. For common things I have to choose between 5 competing open source products because the base library is lacking in so many ways.
This is an Object Oriented programming language right? Why in the heck do primitive types not inherit from "object"?
Pointers
Lambdas
Closures
Partial Classes and to a lesser extent partial Methods
Real support for Generics
Using statements and Dispose - this was a real WTF for me. You really have to explicitly close connections in try/catch blocks. Poor Java guys!
Yield return would be nice
Unsigned integers - again WTF? I have to use number types larger than I need for what purpose again?
In Java you can return from final blocks of try/catch. A co-worker confused the hell out of me for hours by introducing a bug this way. This behavior should be prohibited as in C#.
I rarely have to use Java and when I do, I have all sorts of WTF moments.
Edit: I Removed for-each comment based on the fact it is no longer a missing Java feature since 1.5.
In my experience, Java vs. .Net is more of a business decision than a technical one. Shops with MS experience trend towards .Net and shops with Java experience trend towards Java & OSS. I've seen little evidence of people switching based upon language features. On the other hand, I've seen shops heavily tilt towards one platform b/c of one or two key employees they wanted to hire being knowledgeable in that area.
in no particular order:
function pointers (delegates); the whole passing interfaces around thing is stupid
real generics; what's the point of having type safe generics if the compiler can't even hold the meta data through a unit's compilation?
ui speed; all the self-drawing ui libraries are very slow compared to native controls wrapped in "managed" libraries, not to mention that microsoft's self-drawn ui is hardware accelerated through direct3d
an yield return construct; c# is so user friendly in this it's crazy
operator overloading
linq; just cuz its so addicting
properties; more synctatic sugar you get addicted to
better interop with native code; c#'s p/invoke and native com support makes interop so easy compared to jni -.-
first class value types; this goes hand in hand with real generics, having generic lists that never box/unbox in c# is part of why c# is faster than java.
and i'd say this is the most important one:
a responsive, informative debugger; nothing can even come close to visual studio right now
Just going off the cuff, I think the biggest thing Java 7 needs that everyone is lamenting the lack of is closures.
I'm a C# programmer and about one year ago I had to participate in the development of an application in Java. What I missed the most was:
Visual Studio (Eclipse is nice, but
VS is VS, especially Team Edition)
Comparing strings with ==
Properties
Basic types as first-class objects
(e.g. not "int" type vs "Integer"
class)
Anonymous methods (a workaround can
be made by using anonymous classes
but it is not the same)
LINQ
And there was one single Java feature that I missed when I went back to C#: explicit exception declaration in method signatures.
DISCLAIMER: I am speaking about a somewhat old project, I don't know if some of these features are present in current versions of Java.
Less heinous XML parsing and manipulation tools. Doing anything with XML in Java sucks.
I'll also give one answer the other way around. C# needs an enumeration implementation like Java has. Java's enumerations rock!
Let me add anonymous overrides to this list also. Sorry to go off topic, but C# needs the ability to anonymously override methods. I have been switching back and forth between Java and C#, and I have to say for unit testing legacy code, there is nothing better than anonymous class overriding.
I would need function pointers of some sort. The ability to use delegates in C# is so useful. There are so many times in Java where I want to create a map of delegates or function pointers as the solution, but I can't. I know you can simulate a similar thing in Java, but having the abstraction as part of the language is a huge plus!
Momentum. I have done a lot of development on both platforms. I'm enjoying the .NET side more because of the way the C# language is evolving. Java's evolution seems to be more a reaction to C# than an actual vision. So I think the best thing for Java to do is ignore .NET and create something new of its own.
Another one I would like is some equivalent to LINQ. I noticed how much I actually depend on the ability to use LINQ when I tried to do a top coder competition and realized they only support .NET 2.0. Once you get used to using LINQ to solve problem and make it part of your regular programming vocabulary it is very difficult to not see problems in that light. It is akin to using generics and then not being able to use generic.
I think, choice between Java and C# is not a question of language features, but a question of platform and ecosystem choice.
So, I doubt that any new syntactic sugar in Java or C# can lead to a significant amount of switchers between the platforms.
After all, JVM world has Scala and many language-sensitive developers are using it in some way.
I think, you should consider swithcing this holywar from "Java vs C#" to "JVM vs CLR", because JVM is (in the last years — mostly) not only Java, but also Scala, Groovy, Clojure, JRuby, Jython, and dozen of JVM-languages.
Properties!
Anonymous objects are nice too
Continuations, like Scala (on top of the rest) would be good too, for agents development.
Support to run over CLR (and vice versa perhaps for JVM) without IKVM and other such layers.
Let's be clear that we need to distinguish between Java and the JVM. I actually switched from C# to Java, but I admit it was not because of Java's amazing language features! In my very humble opinion, C# is the better language, and CLR is the perhaps a more elegant VM. However, even with Mono, you're not writing applications that run everywhere!
I think the greatest argument for Java is the amazing community it has. This is where the cutting edge technology is being developed, not at Sun (now Oracle). The Java community has consistently been the leader in developing Enterprise technologies. For instance, how long did it take Microsoft to provide a DI Framework? Where's AOP in .NET? When I start a .NET project, my foundation is Spring.NET, a Java port. When I need ORM, it's NHibernate. Need a testing framework? NUnit. I realize there are other OSS projects for the .NET platform, but their numbers and support from Microsoft are laughable compared to the Java community.
on the other side, has .net got enterprise open projects like Terracotta (semi commerical), Infinispan, Compass ? no. ncache (commerical), lucene.net are far behind them. Especially Terracotta is unique, it can improve some of your app x100, it's simply perfect and free (partitioning is commerical). If we implement a high load app in both .net with anything and java with terracotta + hibernate + terracotta-hibernate-integration, java app will probably far more performant than .net one. Ther're some ports to .net like nhibernate, log4net, lucene.net, but all of them are trying to catch java versions. And entity framework is a disaster, they have to start with nhibernate as the base or get some lessons from them.
.net is only working on windows (mono is far from enterprise, there isn't any enterprises using it), how much money does myspace.com spent for their 4000 windows web server licences ? 1 million ?
You can't install a simple plugin to VS (and can't do some other things) if don't buy professional edition,
Some windows instance types in amazon web services are nearly x2 price of the linux ones.
if you look at ohloh.net open source java project counts (with language comparison tools), you'll see that java has x5 more volume than c#.
also Java has %20 share on worldwide while c# has %4.x (source:tiobe.com)
Look at the top web sites; only microsoft and myspace are using .net. google, amazon, ebay, linkedin, alibaba, twitter (switched to scala from rails)... many of them are using java and many others are using php, ruby (facebook, yahoo,..)
As a language Java is far behind c#, but Scala (runs on jvm) is as good as c# and it's performance is nearly same as java and also it can use all jdk and other java code as his library.
I'm not saying java is better, but I'm saying java is as valuable as .net, too.
A native 'decimal' type for Java replacing the BigDecimal class would be nice. But Java thread-safe collections are nice.
Perhaps the question is not so much what Java 7 needs to persuade developers to use it, but more a case of what makes developers want to move from Enterprise/server-side java language to a different C# desktop Windows-only oriented world?
For most developers, the language isn't difficult to pick up be it Java or C#. I develop in Java, but Linq didn't take long to understand and use.
I think the choice of Java or C# depends on what motivates you personally -perhaps money? in which case either language will do whether they have certain features or not.
Ste
They should start by fixing the Calendar/Date related classes, even that seems too much to ask.
A simple way to map values in your model to the UI (like bind in Java/FX)
I think it depends on bussiness decisions, not the languages themselves.
But I really really really love C# lambdas and curry :D :D
http://mikeomatic.net/?p=82
a map({codeblock}) which runs over anything iterable would be nice. And filter too. And being able to return multiple values easily from a method.
(a,b,c) = getThreeValues();
(would assign the individual variables a, b and c).
Actually I just think they should have Haskell as a supported scripting language on the JVM :D
linq, lambda, anonymous types
I don't see any point in "luring" anyone anywhere. They solve different problems and you should use whichever one suits you.
Java has less "Language" and less structures to trip up new people, it's platform independent and it doesn't change too fast allowing old code to stick around for a LONG time (Good for some large companies).
C# has tight desktop integration and a slew of nice features that make it more fun to program. It has .net integration. It has pointers, closures, etc which make it harder for n00bs (a valid language target, hence Basic) but more fun for experienced programmers--I haven't convinced myself that these features make you more productive, but in some situations they can make your code a lot nicer! Also if you need pointers, you need pointers.
I don't see a whole lot of overlap in target audiences. Why change a language to attract programmers when it's healthier for the entire industry to have two healthy languages each targeted at solving different problems attracting different developers?

C++ or Python for C# programmer? [closed]

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 7 years ago.
Improve this question
I am a corporate C# programmer. I found some time to invest into myself and stumbed upon a dilemma. Where to go from now? C#/.NET is easy to learn, develop for, etc. In future I would want to apply to Microsoft or Google, and want to invest spare time wisely, so what I will learn will flourish in future.
So: Python or C++ for a C# programmer? I am a little scared of C++ because developing anything in it takes ages. Python is easy, but I take it as a child-play language, which still need lots of patching to be some mature development tool/language.
Any C# developers having same dilemma?
I Am a little scared of C++ because developing anything in it takes ages.
I'm not sure how you can say that when you say yourself that you have no experience in the language. C++ is a good tool for some things, Python is good for other things. What you want to do should be driving this decision, not the technology in and of itself.
C# programmer or not, I would assume that you can pick up any language, but a language is just a tool, so your question is difficult to answer.
Python may be easier to get started with, but a dynamically typed scripting language is a very different language from C# or C++. You will learn more about programming learning it than you will by hopping to a close cousin of a language you already know. Really, solid familiarity with at least one scripting language (Python, Perl and Ruby are the favorites) should be a requirement for all programmers.
If you want to apply to Google then Python might be the one to go for, surely MS would like the C# already. If nothing else the competition would not be as fierce as there are much more folk out there with multi years of C++ experience. Also Python gives you a broader language skill and would be a good path to more languages and scripting.
But as said and will be said again, choose your tool wisely and see whether it's a nail or a screw you're trying to secure.
C# is a little closer to Java and C++ than it is to Python, so learn Python first out of the two.
However, my advice would be:
Stick with your current language and learn more techniques, such as a wider range of algorithms, functional programming, design by contract, unit testing, OOAD, etc.
learn C (focus on figuring out pointers, multi-dimensional arrays, data structures like linked lists, and resource management like memory allocation/deallocation, file handles, etc)
learn Assembly (on a modern platform with a flat memory architecture, but doing low-level stuff like talking to hardware or drawing on a canvas)
learn Python or Ruby. Chances are, you'll stick with one of these for a while, knowing all of the above, unless some hot new language has come along by then.
Why not learn some of each. Studying a language for a week or so won't make you an expert, but it will answer a lot of questions in your head and plant a seed for the future.
It's important to not just read through exercises. Find some simple problems that can be programmed in a page or two at most and solve them with each language. That will help you to learn the strengths and weaknesses in the context of the way you think and how you solve problems.
C++ is usually used when speed, and low-level OS access is involved.
It's a good skill to have if you want to expand.
Python allows you to do thing quickly, and it's quite easy to learn, and provides more power than you'd expect from a scripting language, and probably one of the fastest ones out there.
C++ isn't exactly slow to develop, if you've got an IDE, it's not hard to write per-se, but the syntax is going to get you.
If you want to apply to Google and/ or Microsoft then I'd say that of the two you need both!
Given more choice, probably C++ and one other language - either dynamic, functional, or both (Scala might be a good choice too).
It's not necessarily about whether you'd use the languages themselves but more about the different approaches they require and encourage.
If you continue to be "scared" by C++ you're probably going to struggle applying as a dev at either of those organisations - unless you are highly specialised elsewhere.
I think you just asked wrong question. It is not about the tool itself. It should be about what kind of software do you really find enjoying to create. C++ is used in creating different types of applications that are written in C# or Python. Please mind, that C# or .NET itself is not easy to learn. It may be quite easy to develop something that works somehow, but if you just delve into the details...
Anyway, my point is: if you're interested in developing web solutions: go for Python. There is a lot of hype about Python at the moment, and even Microsoft realized the power of this language (you may use your knowledge of .NET and Python programming using IronPython).
C++ is at the moment used in some specific areas. Business apps are written mostly in Java or .NET, and C++ is still great for more low level programming, in areas where performance is the crucial thing (and I mean 'performance' as performance of language/platform itself). The good example is game industry: Java and C# are definitely easier to learn than C++, but... how many 'big games' have been created entirely in C#/Java?
I have another advice for you: if you want to work for Microsoft or Google, do not focus on language itselft. It is NOT the most important thing. Focus on problem solving, algorithms and other stuff (Stevie Yegge's post about how to prepare for an interview at Google).
Oh, and of course as a fan of C++ (and C# too) I must admit that it is not true, that developing anything in C++ takes ages. You probably think of C++ as of "C with clasees" - take a look at STL, templates, advanced templates, Boost... Somehow all those people working in games industry manage to create better and better games in not so looooong time that takes others to create 'boring and easy' business app in Java/C#.
You might be interested in looking at Windows Powershell. It's the latest scripting technology from Microsoft, built on .NET, and can be extended via C#.
Granted, it's not as portable as C++ or Python, but it would leverage your C#/.NET experience more readily. Otherwise, I would suggest C++ (and possibly C). Microsoft builds a lot more of its products with C/C++ than with Python.
As someone familiar with C# and .NET you should consider IronPython. Python for .NET. This would be a good way to leverage what you know and learn a new dynamic language at the same time.

Why should I learn C#? [closed]

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.

Categories

Resources