tags:

views:

165

answers:

5

Hello,

I know little bit of both. Both these languages beautiful and are similar in many things. I'm going to teach OOP. I thought of C# as language but then I felt why not teach both C# & Java simultaneously? Explain the concept then explain how its done in both these languages and then explain and glitches they need to know. I would like to know your opinions on this approach. If you feel this is good, can any one suggest some good book that takes this approach?

EDIT:

Students are not beginner programmers. Every one of them have C programming experience and some of them are familiar with either C++ or Java. So, I guess I can treat them as intermediate level programmers.

A: 

I wouldn't do that, especially if we are talking about beginners. If you are teaching concepts like OOP, stick with one language and explain it solely in that language. When you are confident your students are able to grasp the syntax and concepts, you can do an overview of another language. If you have basic concepts and so on done, it is easy to learn a new language, as you only have to learn the syntax and some bits and pieces concerning the framework.

Femaref
I think it's valid to teach 2 languages simultaneously. It illustrates some fundamental concepts without "attaching" the reader to a particular language. I had an Algorithms and Data Structures course in freshman year where the professor used Lisp and Java.
quantumSoup
When I was in school, one of my professors in an advanced programming class decided to teach C++ STL, C++/CLI, Data Structures, and Algorithms all in 1 semester. Granted, by then we had already learned OOP concepts. But, mixing STL and C++/CLI was confusing for many of the students even though they are similar. Most people focused on the language/frameworks more than the prof's ultimate goal of learning to "dive in".
Jim Schubert
@Jim Schubert: Talk about a trial by fire :) One quibble though. Many people who are fairly versed in C++ would argue that STL and C++/CLI are very different. For example, I would argue that way, though I can see your point.
Merlyn Morgan-Graham
@Merlyn: I agree they're very different, which is why most people had a problem with it. When I began the class, I knew nothing about C++/CLI and assumed it was simply "C++ on the .NET Framework" as my instructor introduced it. After the class, I realized he should have chosen one or the other.
Jim Schubert
@quantumSoup: My Programming Languages course was taught using Scheme and Java, though I think that was more because the professor was a Scheme fanboy and he could fit more Scheme on a powerpoint slide than because he wanted to teach both.
Brian S
+4  A: 

In my opinion there's no need to teach both languages because your teaching OOP and that's a technique independent from the language. You should really use your time to teach the concepts.

If, in the end, you'll decide to teach both, you can use this link to help you with that: http://www.25hoursaday.com/CsharpVsJava.html

dierre
+1 for the link
claws
+1  A: 

I don't know about a book that 'teaches' both C# and Java simultaneously, I know that both are reasonably similar in syntax the underlying frameworks differ.

I can recommend 'Code Complete' by Steve McConnell as a book that any programmer will get a lot out of no matter what language they program in. This book includes examples in C#, Java and many other languages.

Zordey
+2  A: 

If you want to want to teach both, then you may want to look for a book that is geared toward teaching on language toward someone that knows the other.

So, for example, C# for Java Developers (http://www.amazon.com/Java-Developers-Pro-Developer-Allen-Jones/dp/0735617791), as it can help you introduce the ideas of OOP based on C#, and in the process you can discuss Java.

Then, once they learn a bit about both languages, then you can go deeper, later, on both languages, as you start to introduce them to lambda expressions and LINQ for example, or Groovy when teaching Java.

You may want to look at the GoF book on Design Patterns, so you can discuss what is in common to most object oriented languages, in terms of concepts.

UPDATE: A link for the Gang of Four book, Design Patterns: Elements of Reusable Object-Oriented Software, http://c2.com/cgi/wiki?DesignPatternsBook

James Black
quickie on "Java for C# developers": http://it.toolbox.com/blogs/codesharp/java-for-c-developers-21248 .
claws
@James Black: Do you know any book on "Java for C# developers"? I'm surprised that I can't find any such book.
claws
@James Black: I was going to give a GoF answer/comment to someone else's answer, but you already got to it :) GoF seems to be very explicit about its subject matter being applicable to many different languages. However, I would use GoF as a reference book. In my opinion, it isn't a book you can read straight through.
Merlyn Morgan-Graham
@Merlyn Morgan-Graham - If someone is teaching Java and C# then a general book on OOP design patterns could be useful, IMO.
James Black
@James Black: Absolutely
Merlyn Morgan-Graham
!claws - two books that didn't get great reviews: "From Java to C#:a developer's guide", "From Java to C#"
James Black
@James Black: You mentioned same books again, I was asking about "Java for C# developers" or "From C# to Java"
claws
@claws - Sorry, you are right, I was going in the wrong order again.
James Black
+2  A: 

I'm going to teach OOP. I thought of C# as language but then I felt why not teach both C# & Java simultaneously?

I think you needs to think very carefully before you do this. Particularly, about what exactly it is you are aiming to teach the class.

  • If your goal is to teach the principals of OO programming languages from a theoretical point of view, then covering Java and C# together is sensible. But for completeness you should be covering other OO programming languages as well ... especially those that take a different approach in their support for OO.

  • If your goal is to teach practical OO programming, then teaching Java and C# in parallel is likely to run counter to your aim. The average student will have enough difficulty getting their heads around the basics of OO thinking and implementing in one language. Throwing in a second language will only distract them from this, and the result is likely to be that many of the less diligent / able students don't properly assimilate working knowledge of either languages.

Remember that the real aim here is to educate the students, not to create a course that is interesting from your perspective. For a typical undergraduate course, the students mostly want a piece of paper that will get them their first IT job, and what they need is practical knowledge. (Save the interesting stuff for your honors / masters level courses, where the bulk of the class has the mindset of wanting to learn interesting things ...)

Stephen C