-1

I am not asking this question to start arguments (people often consider Java and .Net as religions) but which provides a better foundation and helps to gain real programming skills (of Computer Science and Web Development), I have worked with ASP.NET and C# but most of my time spends on Dragging and Dropping i am a C++ programmer and Drag and Drop irritates me.I haven't tried Java so i want to ask is Java also like .Net family (Drag and Drop)?

11
  • I believe that Java exposes one to a more broad set of platform concepts. C# clearly has some programming niceties that Java could use. 6, half-dozen, 1 or the other.
    – Jé Queue
    Jan 10, 2011 at 5:30
  • 13
    Will writing my novel in English or Spanish make me a better author?
    – JP Alioto
    Jan 10, 2011 at 6:02
  • @JP Indeed. This is exactly the wrong kind of subjective question. The answerer would either be biased (the language they espouse was their foundation) or ignorant (the language they espouse was not their foundation), or doesn't actually pick one. Jan 10, 2011 at 6:22
  • @ JP : English. as it can be read by huge mass. True, Both are tools but definitely one is much better than other. I have seen many programmers complaining that "Drag and Drop" ruined their programming skills. :) Jan 10, 2011 at 6:23
  • 2
    @Deadlocked_Thread so just don't "Drag and Drop" you don't have to. You don't have to use any of the GUI editors. That isn't going to be what makes or breaks you as a developer, neither is the language. Your design, development, coding, ect skills are what matters. If you choose to randomly guess and accept an implementation because "it works" you haven't done yourself or anyone else a favor because you just hacked it instead developing it.
    – Beth Lang
    Jan 10, 2011 at 6:36

5 Answers 5

15

If all you get out of C# is that there are a bunch of drag and drop tools, you haven't gotten very far with the language. Actually, unless I was doing a quick and dirty winforms app or a really brain-dead webforms app, I can't remember the last time the visual tools played much a role in my development cycle. But I usually write Asp.Net MVC code when I do web stuff in C#, and in most of the real projects I've done I've spent more time designing the object model than I did dealing with UI concerns.

C# is far more expressive, as a language, than Java. The functional constructs like Linq (and the features that Linq required C# to offer) and the convenience of things like delegates (vs inner classes) and auto-properties are really nice. But Java has a really compelling ecosystem of well-designed open-source frameworks and packages that mostly make up for the crummy language. Also, dealing with dependent libraries with the help of tools like Maven or Ivy is a lot more pleasant than in C#, at least if you ever build products that co-evolve with other toolsets. Microsoft is only recently finally getting around to making the experience of dealing with libraries in your software configuration management process more rational.

Compared to C#, Java requires a lot more boilerplate code that doesn't do much for readability or maintenance, other the fact that everyone is used to the same level of tedium for every kind of problem, and nobody finds it surprising. Code Gen tools are at least as common in the Java space as the visual designers are in C# UI, but the thing is, in the .Net ecosystem I have plenty of ways to avoid the need to use those kind of visual tools, whereas avoiding tedium and code-gen in Java requires you to use another language that works in the JVM. But if you want to deploy your code on a Linux box or a Mac, you'll have an easier time of it if you are working in Java, especially if you go down the road of doing something in WPF or Silverlight for UI.

In Java, you'll probably spend more time mastering various frameworks than you'll spend learning the language, because the language is really simple and almost minimalist. The frameworks are often tacitly trying to work around limitations in the language. There's nothing inherently evil about that, it's just a different philosophy. In C#, programmer convenience and expressiveness are more highly valued than uniformity. There's really something very comforting about the rigidity of Java as a language, especially if you're forced to make sense of someone else's code. You can spot poor coding practices very quickly. In more expressive languages, you may have to spend more time understanding what the side effects of a particular choice of syntax might be.

I'm a language geek, both when it comes to programming languages and natural languages. I'm thrilled when someone throws me a project that would benefit from Ruby or Boo or Groovy or F# or whatever, because I get to take advantage of the fantastic expressiveness of those languages. There's nothing wrong with learning C# or Java, as long as you're willing to see the limitations that you encounter there honestly, and especially if you go and explore other options beyond the mainstream from time to time.

I think it's better to learn both, because Java and C# are a big deal in mainstream application development, and you'd be doing yourself a disservice not to have a good understanding of what's out there. But don't mislead yourself into thinking that one or the other will make you a better programmer. If you were comparing Basic, PHP, or Pascal to Java or C#, I would say you're better off learning Java or C#, but there's not a particularly important reason for your personal development to decide between Java and C#.

But don't shy away from alternatives either. Lisp, Scala, Ocaml, Python, Ruby, and even things like IO are worth learning.

Drag and drop tools were mostly designed in an era when it was really hard to construct UI. It was tedious to build a UI in C, C++ or Pascal circa 1992. Tools like VB and Delphi made this less painful. When .Net emerged, it was important to retain the IT developers and consultants that Microsoft (and Borland) had made successful with the help of visual tools. But that doesn't mean that C# (or even VB.Net) is about drag and drop. Those are just aspects of the whole toolkit, and really, they don't matter nearly as much as they used to. The era of "RAD" has mostly passed, in favor of testability and separation of concerns.

7
  • 1
    What does drag and drop have to do with the programming language? The language has no support at all for drag and drop tools. Also, the same exact sort of tools exist for Java. Jan 10, 2011 at 11:33
  • 1
    What a fantastic answer :). Jan 10, 2011 at 11:45
  • @John, I agree. Though, to be completely fair, a small subset of features were added with drag and drop tools (and code gen) as the motivating scenario, namely, partial classes.
    – JasonTrue
    Jan 10, 2011 at 19:02
  • @Jason: code gen, yes, not just drag and drop. Jan 11, 2011 at 1:13
  • @Jason : Yes learning both will be a better choice but what should i start with? Jan 11, 2011 at 5:19
4

I've programmed in both. They are both good skills to have and I would not say one is intrinsically better than the other for developing your skills. You don't really need to choose, it would be good if you learned a little of both. Their syntax is fairly similar and, for the most part, what you can do in one you can do in the other.

Assuming you have to choose one, something that could help you choose would be what type of programming you want to do when you start or where are you likely to look for a job and find out what that area tends to use more. If you are going to school they will probably have one they focus on over the other.

1
  • 1
    Typical impartial answer.
    – Gulshan
    Jan 10, 2011 at 8:24
1

My opinion is: Go for that technology in which you feel comfortable but ill suggest you to study languages like C/C++ because that will help you creating your concepts very clear and you know little deeper then a C# person

0

I'm with BitOff here: both are good for developing your skills. One, however, is more prone to locking you into a specific vendor's line of products. Even with the Mono project, .NET is pretty much purely a Microsoft environment. If you don't mind this, then use the .NET environment. It is in many ways a cleaner place than the JVM world (although that's getting slowly cleaned up in the JVM side). On the other hand if you don't want to get locked into Microsoft's world and/or are paranoid of Microsoft's purported evil monopoly, you may want to stick to the JVM side.

Personally, I don't do Microsoft stuff any longer so if given a choice between Java/JVM or C#/.NET, the choice is clear. Your situation and needs will differ and only you (and your local job market) can decide.

5
  • @ Just My : Local Market has scope for both, but its hard to guess future :) Jan 10, 2011 at 6:51
  • In the long term the predictions tend to show that vendor lock-in is a bad idea. Ideally you might want to learn both and use in the short term the one that's most likely to get you a job tomorrow. Jan 10, 2011 at 7:23
  • I admire you for using terms "Vendor lock-in" and "Microsoft's purported evil monopoly" :). Jan 10, 2011 at 7:30
  • 1
    I think the question was- "which provides a better foundation and helps to gain real programming skills (of Computer Science and Web Development)?" And you missed that point.
    – Gulshan
    Jan 10, 2011 at 8:22
  • @Gulshan: No I didn't. Reread the first sentence. It's important. (Hint: there's a link there too.) Jan 10, 2011 at 9:58
0

You say you ask this because of the Drag and Drop functionality in .NET irritates you..

When developing ASP.NET web forms, you can also choose to write the ASP GUI objects diectly in HTML code view. I have code view set as default in VisualStudio, so I get into the visual drag-and-drop Design view only in a rare occasion when I want to get a quick look at how a specific design change might look like.

Instead of dragging a button in, you can just write directly in the HTML source:

<asp:Button runat="server" id="btnMyButton"
 Text="Click me!" onclick="btnMyButton_Click" />

Then in the C# code, all you have to do is to add the handler method:

protected void btnMyButton_Click(object sender, EventArgs e)
{
    // The onclick code goes here
}

You can alternatively connect to the event manually in the C# code (instead of onclick="btnMyButton_Click" in the tag declaration):

this.btnMyButton.Click += new System.EventHandler(this.btnMyButton_Click);

This would typically be done in Page_Init.


If you do some development in WPF, you also have the possibility to not use the Drag and Drop by entering code directly as tags.

Not the answer you're looking for? Browse other questions tagged or ask your own question.