My programming languages professor is quite the wily one. For our last programming assignment in there, we’re to write a fraction class in both Java and Smalltalk, as part of our coverage of object-oriented languages. I asked if I could do C# and Smalltalk, since I really like C# and, darn it, everyone says they’re pretty much the same language. For my professor’s purposes, i.e. teaching us different OO styles, substituting C# in for Java should accomplish the same purpose. (“Accomplish the same purpose” sounds weird to me now, but “accomplish the same effect” did, too. Suggestions on rephrasing?) I sent him a list via email of all the reasons he should let me write it in C#, including:
- The Ph. D. student we had as a substitute mentioned that my professor is his advisor, the student is doing C# stuff, and my professor is not all that familar with C#. This would give my professor more experience with it, and in a case where he already knows what the expected result of the program is.
- The same Ph. D. student pointed out that if you know C++ and you know Java (which my professor certainly does), you can read C# fine.
- You can use Mono in Linux to run C#–there’s no need to have .NET or use Windows. This point stems from the fact that my prof is a big Linux person and either dislikes Windows/Microsoft or perhaps just GUI interfaces… He has brought his laptop to class before to show code examples and he’s so hardcore that his window manager, fvwm2, doesn’t even have title bars on the windows, by his configuration, so to move a window you have to hold down some key combination and drag it with the mouse.
- For our first program, he let me work in Ruby instead of Python. Ruby is to Python as C# is to Java.
- Recently on StackOverflow, I was reading someone’s response about learning a new programming language, and I thought he had a good point. He said that if you already know Java, there’s not much point in learning C#, but instead perhaps learn ML or C because those are different kinds of languages. If this programming project is intended to teach us about object-oriented programming, then it doesn’t seem like it would matter whether we wrote in Java or C# because they’re so similar.
He told me in class he had been considering my request, but had decided that since I code in C# all day at work, it wouldn’t be helpful for me to write the assignment in C#, too, so I should do it in Java since I’ve barely worked in Java before. Then he went on to say that anyone else, however, that isn’t familiar with C# can use that over Java. My classmates started laughing and I had to say “Damnit, that’s not what I intended at all!” Grumble grumble.
I disagree with #5. Some languages just aren’t worth learning. If you really like scalable web services, there’s no reason to learn C. This is one of the few topics on which I disagree with Joel Spoelsky.
Furthermore, time is limited, which means the amount you can learn is limited. If you’re career minded, picking up C# and .NET will go a lot further than ML and Haskell.
@Stefan,
I think the idea has less to do with the immediate applicability of the language itself, and more to do with the broadening of your way of thinking about problems in general.
Since time is a finite resource, this might suggest that the effect of learning a new way to think about a problem via a different kind of programming language out-weighs learning a new language to think about the problem in the same way (especially in the case of Java -> C#, where you should be able to sit down in front of Visual Studio and instantly be productive in C# having all ready known Java). For instance, solving a problem using a declarative programming style could vary greatly from using an imperative one. While it’s still about the right tool for the right job, it’s about using the right tool correctly, too.
Or maybe that’s my idealist, academic side talking.