Learning Java from a C# background [duplicate] - c#

This question already has answers here:
What are major differences between C# and Java?
(7 answers)
Closed 8 years ago.
For complicated reasons (not C#'s fault I love that language very much) I have to learn Java. I hate learning new langages and i dont wanna have to learn what I already know from C#.
What are some resources that teach whats different without learning it all?

I realize this isn't a very specific answer, but the best advice I can give you is to not go into it with the "I hate learning new languages" mindset. If you're familiar with C#, Java will be a piece of cake. Depending on what you're working on, most of your questions can easily be answered by a quick look at the API documentation. I don't think you have to worry about "learning it all".

The problem won't be the syntax but the framework. Since I'm not a Java developer either, I'm not sure where to look. But I suggest looking into the frameworks you'll be working with instead of syntax.

Related

C# and .NET frameworki a [duplicate]

This question already has answers here:
How do I move from Java to C#?
(9 answers)
Closed 5 years ago.
I am going to start work with a company that works on a .NET framework and i am a professional java developer and i think i should switch to .NET because i cant see any bright future with java anymore.
My questions:
Now i have decided to move to .NET, what things i should learn as a total beginner. Should i learn C# or i should understand basics of .NET first?? as i know only that .Net is a framework and c# is one of language run on it. I am only interested in C# as it like java not in VB or any other.
please tell me what i am suppose to learn and please refer to me some books.
thanks
You are correct in your understanding that .Net is the underlying portable framework which is supported via multiple languages such as C#,VB etc. If you are looking for a Java equivalent in terms of programming language then C# is exactly what you want to be working with.
One of the best books for C# out there is C# via CLR that teaches you C# with an understanding of the underlying CLR. It is more of an intermediate-advanced proficiency book but the basics should be easy to latch on to given your Java background.

Learn C# now or finish up with Java and then 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 9 years ago.
Improve this question
Ok here is my situation. I've studied Java in my college for 2 semesters. But you know they teach you jack in there, just the basics. We skipped half of our textbook and even then our professors don't teach from section to section of each chapter. I don't blame them. It's hard as it is for new students to understand even the basic concepts of programming. Now this is a community college we are talking about and not Stanford, MIT or Berkeley.
So like I said I've done 2 semester of Java. I really like our textbook because it has some challenging projects to do at the end of each chapter. This textbook is pretty clear and i have no problem understanding it (although 2-D and 3-D Arrays have given me some trouble). I have tried reading a few C# books such as Pro C# 2008 and .NET 3.5 and C# 4.0 in a Nutshell. I found these books to be dry and overloaded with information that put me to sleep (No offense to the authors of those 2 wonderful, according to amazon ratings, books).
Would you suggest I finish my Java textbook, brush up my knowledge of Arrays, Polymorphism, and etc that are universal to most programming languages. And then switch to C#, plus the syntax is very similar so it should be easy to switch. Or should I just start learning C# right now from the very beginning? If it's the latter then could you recommend some free online resources that will keep me engaged and at the same time teach me everything I need to know about C#.
Someone has recommended me to learn .NET first, but I found it to be not the brightest idea. .NET is just a big monster full of libraries. How am I going to apply it if I don't even know the C# or VB!? Anyway back to my question: Master Java and switch to C# or just go with C#?
DISCLAIMER: I don't want to start .NET vs J2EE or C# vs Java flame war. I am going with C#. I've decided that I want to work in a Microsoft shop in the future. .NET is what I want to learn.
Thanks! Will be waiting for the answers.
I found myself in pretty much the same situation as yourself whilst studying Java at community college - I am smiling right now :). That was 10 years ago and D flat, as some wags were calling it, was starting to make some noises.
What I did, was do all of my assignments in both C# and Java, so that I could get to grips with both. I then begged to do my final year project in C#, which they eventually relented on. Getting practice in a couple of languages and doing a major project will stand you in good stead.
I have never looked back. Good luck! :)
Both Java and C# concepts and syntax are very similar.
I would concentrate on the one you expect to use after completing your studies. Look at which is asked for more often in the area you are intending to work.
As a side note, C# 4.0 in a Nutshell is an excellent book both for learning and reference. Suggest you give it another go.
I think I found the answer to your question...in your question.
For now, go ahead and finish your Java book as a way of continuing to learn the fundamentals of OOP.
Next (or while finishing the Java book), shift your focus to C# and the .NET framework (in most business situations, you'll be hard-pressed to find one without the other).
If you want to focus more on language elements of C# rather than a specific framework (such as ASP.NET, Silverlight, Windows Forms, or WPF, to name a few things), you might consider a book on LINQ, such as LINQ in Action from Manning Press. Combine your knowledge of LINQ with trying to solve some problems at http://projecteuler.net and you should start picking up the language pretty quickly.
Personally, I read Illustrated C# 2008 by Daniel Solis. Granted, it's not a textbook filled with lots of fun and challenging examples, but it is a good exposition of the language.
Don't worry so much about any particular language, and "Teach yourself programming in 10 years": http://norvig.com/21-days.html
Since it sounds to me like you don't really know a lot about programming, and this is largely your first major exposure to it, I think it's absolutely in your best interest to stick with something until you have learned enough of it that you are satisfied with your skill level. Jumping now may hurt you later, because you will be covering a lot of concepts you probably already know.. but hidden inside will be something you don't, and thus you will skim right over it.
Keeping yourself "engaged" is only something you can do, not the text. Certainly some texts are more interesting than others, but you have to be committed to reading the material whether or not you find it boring. That's how you learn.
Both Java and C# are syntactically similar at the basic level, but they both diverge from there in different directions and do similar things in different ways. Further, the languages are largely useless without the base class library, and those are often very different between languages.
What you didn't mention was how you are doing in school. Does your school require you to do more java work? If so, then you will have to stick with it. If not, and you are "done" with it, then perhaps starting over with C# from the beginning would not be a bad idea. Just think of C# as a new language you have to learn from the ground up, even if much of it seems familiar.
I found the Wrox book series to be particularly good to learn from, along with the Head First book series. As for which one to continue I would say it depends on what you are tested on. If you have to do written exams and write out sample code. You don't particularly want to start banging out C# by accident.

Effective C# tips [duplicate]

This question already has answers here:
Closed 13 years ago.
Possible Duplicates:
Is there a site that emails out daily C# tips and tricks?
What are your C# Commandments?
A little background:
I have skimmed through Effective C# by Bill Wagner. I know that my opinion on a book like that is too insignificant. But, still just for record I plan to read and re-read the books for years to come. It is just too good.
Now the question: Can SO C# gurus tell me their favorite C# tip(s) to make their code effective.
EDIT:
I looking for something that C# gurus use in their day-to-day coding to make it effective. I am not looking for hidden features of C#. If this has already been answered let me know. Thanks.
We have a simialr questions :
Hidden Features of C#
Is there a site that emails out daily C# tips and tricks?
No fancy tricks, just clear well documented code, because in the end you will have to come back to it at 3am in the morning and curse the bug that your cleverness created.
Measure, optimize and measure to make sure you did optimize it.
Also, the compiler and garbage collector usually are smarter than you are. Let them do their jobs.
Without question, LINQ is one of the most powerful tools available, and the C# integration is superb. It changes how you think about shaping and processing data in a strongly-typed language. I highly recommend becoming proficient in this area.
There are also many cases where the compiler supports syntactic sugar for common patterns, such as automatic properties, the using, foreach, and yield return statements, type inference, lambda expressions, extension methods, object and collection initializers, etc. The list goes on and on. Learning these features and the patterns behind them can drastically reduce the amount of code needed to express particular concepts.

Java tutorial for C# developer [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Best way to really grok Java for a C# guy
I worked on C# for a few years now move to Java. Is there a good Java tutorial for C# developers?
thanks!
Here is a helpful article to compare the language syntax and some differences between the two.
as far as i know java has a similar syntax ;
anyway have a look here this article compare c# and java keywords
This book isn't geared specifically towards people coming from a C# background, but I still recommend it highly. You'll draw the comparisons with C# on your own as you read. And it is free in electronic form. Bruce Eckel's "Thinking In Java"

Interview question on C# and VB.net similarities/differences [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 9 years ago.
Improve this question
I have been a VB.net developer for a few years now but I am currently applying to a few companies that use C#. I have even been told that at least one of the companies doesn't want VB.net developers.
I have been looking online trying to find real differences between the two and have asked on crackoverflow. The only major differences are a few syntax difference which are trivial to me because I am also a Java developer.
What would be a good response to an interviewer when they tell me they are looking for a C# developer - or similar questions?
I've had to interview people for a few C# positions and this is my general advice for VB.Net developers interviewing for a C# position:
Make sure you are clear that you have been working VB.Net. This seems obvious but is something that apparently isn't (in my experience).
Try to give a code sample, if possible. I've seen some horrible VB.Net (and C#) written by VB programmers who didn't seem to learn much in the transition to .Net.
Be able to write in C# during the interview, if asked. I know there aren't many real differences between the two, but I don't want to pay you to learn the new syntax.
For your specific question: I've asked that type of question before and what I wanted to hear about was how the underlying system and framework were the same. If possible, talk about garbage collection, IDisposable, finalizers, the dangers of unsafe code blocks, stack vs heap, etc. All the kind of stuff to show that you really understand the intricacies of the .Net framework. Right or wrong, the heritage of VB brings with it an expectation of a lack of understand of lower level programming and windows in general (which, ironically enough, a c++ developer would have of a c# developer... and so on).
Lastly, how you frame your experience can make a world of difference. If you position yourself as a .Net developer, rather than VB.Net or C#, the stupid, pseudo-religious, banter may not enter the conversation. This of course requires that you actually know both VB.Net and C# at the time of the interview, but that's a good policy regardless.
The truth of the matter is that if you find that the person interviewing you writes you off simply because you've previously been developing in VB.Net, it's likely not going to be a place you want to work at anyway.
Some differences (that are more substantial than syntactical) that suitably catch me out sometimes:
VB.NET does not have anonymous delegates
Unsafe code blocks aren't in VB.NET
I love C# to death, but I envy VB.NET's optional parameters. Office automation in C# is so very, very painful.
I think the truth will-out on this:
I'm a software developer, the syntax of the language is the final part of the puzzle. By employing me, you're getting someone with demonstrable experience of problem solving and logic. I'm experienced with the .NET environment, the CLR and the associated Windows stack, including SQL and Windows server. I don't know the C# syntax, but, I am used to object-oriented approach, I will have no problem getting totally up to speed on the finer points of the syntax within a couple of weeks. You can see from these examples of my code that I'm an experienced developer, I assure you the transition will be seamless. I have already made a start learning the language, I haven't had any problems so far.
#DAC - VB now (in .net3.5) has support for lambdas:
Function(x) x.ToString()
In an interview I'd say that understanding the CLR and what the code's really doing is what's important, and that you're happy to code in either (assuming that you are).
I'm also a C# feller to the death but the differences are not just syntax. There are places where VB wins HANDS down
Optional parameters
Late binding
Working with COM from C# can be a very frustrating affair. (Which is not to say impossible!)
Truthfully? If you're a Java developer too, I'd lead with that. A Java developer with some experience in .NET will generally make a better impression than a VB developer with experience with Java. If you can answer questions on the difference between .NET and Java you should be in good shape.
I'd also recommend you learn the C# syntax ASAP. If you're experienced with VB and Java it won't take long.
A lot of developers have issues with VB and the people that use it. Valid or not you'll have to deal with that reality.
VB or C# both are syntax only diffrent but if you are applying way of logic is same.

Categories