Share via


Why Not C#

Someone recently passed on same objection to using C# as a first or otherwise early programming language. I hear these sorts of comments all the time and while I have addressed some of  them in the past it seems like this is a good time to readdress them. These are my opinions of course. They are based on my own teaching experience as a high school computer science teacher. And your mileage may vary but these things I believe.

C# is a proprietary MS clone of the Java language

Two things in here. One is that C# is proprietary and the other is that it is a clone of Java. Neither of these is completely correct. The C# language borrows heavily from a number of languages including Java, C, C++, Visual Basic and Haskell just to name a few. In more recent years Java has borrowed heavily from C# as well. So while no language develops in a vacuum it is not far to call C# a “Java clone” even though they have many similarities. As for proprietary, C# is a standard language and C# compilers can be (and are being) created without any control or limitation from Microsoft or other vendor. The same can not be said for Java which, while it has a community model in theory, is largely controlled by Oracle who purchased Sun Microsystems. If there is a proprietary language in this mix Java fits the bill closer in my non-legal mind.

OF course I don’t understand why being “proprietary” rules out using something in school anyway. From what I can tell they use copyrighted books, patented products, and all sorts of proprietary products every day in schools. With programs like MSDN AA for schools and DreamSpark for students getting software very inexpensively or even free for students is not an issue with C# either. There is also C# Express Edition which is a free and easy download.

If students use Visual Studio, they'll spend all of their time placing buttons and not learning to program

I’ve wrote about this before but it bares repeating. This is a teaching problem not a tool problem. On one hand you can, if you really want to, limit your students to command line programming. It’s just as easy and just as boring as programming in C, C++ or Java. So if boring is your goal please stay away from Visual Studio. On the other hand if you want students to enjoy the confidence and encouragement they might get from creating real graphical user interface programs that look “real” then maybe Visual Studio is for you. There are ways to keep students focused on the code that you want them to focus on as well. You can supply form templates for example. You can specify exactly what a user interface will look like as another option. OF course if you really want to have students spend more time on the user interface than on useful programs there are far better languages than C# (or Visual Basic) for that. Some languages have these really horrible APIs that you have to hand code every little piece and attribute of objects on a screen. Yuck!

C/C++ give students a better foundation to learn other languages

Assembly language is even better for this! But like C or C++ it is a hard way to start. If you are Bill Gates than by all means start with Assembly or even C/C++ but if you are anyone else you may want to think of something a little more easily approached for a first course. There will be time for C/C++ or even Assembly language down the road. I do believe though that this is also a teaching issue, a pedagogy issue, rather than a tool issue. It is a lot about how you teach the concepts that makes the knowledge transferable to new programming languages. And if the complexity of the syntax scares students off or just gets in the way of them progressing than you lose all of the theoretical value of the tool.

Comments

  • Anonymous
    May 03, 2011
    For one it would force people to get Microsoft devices. Think about this scenario: Why not Objective-c in Cocoa with Xcode. I think it hurts institutions by siding with one company. And forcing students to buy Mac's, windows or use linux is just plain wrong.

  • Anonymous
    May 04, 2011
    >For one it would force people to get Microsoft devices. Actually no, it wouldn't. The Mono Project C# implementation and toolset -- mono-project.com/Main_Page -- spans all the major desktop OS families. Personally, selecting from the major cross-platform languages in use today, I'd opt for ECMAScript as the more obvious candidate than either of the server-oriented standards.

  • Anonymous
    May 04, 2011
    The comment has been removed

  • Anonymous
    May 04, 2011
    Whatever works... If it keeps their attention 15 seconds longer than go with it. The closed mindedness surrounding the less "open" (re: Microsoft) technologies is ridiculous. Most of the jobs in the real world use the same tools. I say not only make them code with C#, .NET, Visual Studio, but have them write apps that they'll love.. twitterbot? asp.net mash up (pandora-like..)

  • Anonymous
    May 04, 2011
    Excelente artículo, gracias.

  • Anonymous
    May 04, 2011
    C# is just the biggest fork of java... :) android is the second fork thats all.

  • Anonymous
    May 04, 2011
    Most likely your students will learn C# on a MS OS equipped computer.  You are locking them right into the world of MS. My first computer was MS based, when I replaced it with Linux, my knowledge of computers and programming went through the roof.  The open source world is just better for learning and exploring.  The fate of Mono is up in the air at this point.

  • Anonymous
    May 05, 2011
    @Steve: The new owner of Novell, Attachmate, just fired the Mono team. (See www.zdnet.com/.../8821) Looks like Mono is dead; so yes, using C# will pretty much be for Microsoft platforms only.

  • Anonymous
    May 05, 2011
    >  If you are Bill Gates than by all means start with Assembly or even C/C++ but if you are anyone else I don't like the idea that Bill Gates is the only one who can understand assembler. Author check your words!

  • Anonymous
    May 05, 2011
    Well, San that is an interesting interpretation of what I said. Personally I don't get close to the same interpretation but that's just me. :-) I just meant that it takes a special person to start with Assembly language. Most people are better off starting with a higher level language. Once you have started than I think most programmers can and should understand and use Assembly.

  • Anonymous
    May 06, 2011
    Instead of why not use C#, you should ask why use it?