Is learning C# as a first language a mistake?

  • I know there are similar questions on here, which I've read, but I recently read this post by Joel Spolsky:

    How can I teach a bright person, with no programming experience, how to program?

    And it got me thinking about my way of learning and whether it might actually be harmful in the long run.

    I've dabbled with various languages but C# is my first serious one, I've read "Head First C#" and created a few projects. But after reading the post above I've found it a bit disheartening that I may be going about it all wrong, obviously I respect Joel's opinion which is what has thrown me a bit.

    I've started reading "Code" as recommended in the reading list and I'm finding it pretty hard going, although enjoyable. I feel like it's taken the shine off of my "noobish hacking about" in Visual Studio.

    So now I'm unsure as to what path I should take? Should I take a step back and follow Joel's advice and start reading?

    I guess my main aim is just to become a good programmer, like everyone else, but I don't want to be going into bad practice by learning a .NET language when someone who's opinion I respect thinks that it is harmful.


    Learning CS the hard way can be done, but only if you have a good teacher.

    C# wasn't my first language was and I can tell you it's not how you start that matters. I think C# will be a great starting language just remember to always ask yourself why things are done the way they are.

    No. Any language as a first language is good to learn the theory of computing science. Granted, to make a career of it, some languages are better than others, but for learning purposes, anything is good. Some of the finest programmers I know started with BASIC on a C64, Apple II or TI-99/4A. It didn't rot their brains, but urged them on to the next language and then the next.

    Also, it depends on what you plan to do with that knowledge. C# solves business problems day in and day out where I work. I haven't looked at C in bordering on 2 decades and I feel icky when I have to.

    Learning something is *never* a mistake. It is always much better than *not learning*.

    @SK-logic I really cannot agree here although I completely understand where your mind is at. Learning a bad habit can be extremely hard to un-learn.

    @Andrew, having Fortran and Basic as first languages, I had a lot to un-learn - and this very unlearning process itself was very insightful. Unlearning experience is almost as valuable as learning.

    I'm pretty sure Joel isn't exactly slamming C#/Java; he's slamming taking shortcuts.

    C++ was my first language, and I regret it. That's one language *not* to learn first. Nonetheless, 15 years later, I think I'm a half-decent programmer.

    Gain a love for programming, a respect of the hardware, an industrious work ethic, and an openness to new ideas, and it won't matter which language you start with. Also, regarding Joel, remember the old programming maxim, `all absolute statements about programming are wrong`. Luck!

    Object-oriented programming is a difficult concept to wrap one's head around, not that it will hurt your learning of C#. I think that's all you're getting "discouraged" about, and I think that happened early in many of our programming careers; when we slowly found that simply making all of our methods 'static' to fix compile errors wasn't doing quite what we thought.

    I was just interested: why out of all languages was C# your first serious one? I think answering this question correctly will give you more info about what you want to do and only then what you need to learn to do it skilfully.

    I started with QBasic for DOS. Possibly the worst language I've ever come across, but it got me interested in programming and got me enjoying it - the latter being something that C/Java/Python would not have achieved. Every time I reluctantly learn a new language, I instantly become better at all my previous ones. Starting from a good language probably makes one snobbish and reluctant to try others. Starting from a terrible language (as I did) makes me appreciate functional programming, commented code, asynchronous patterns, "less is more" and other useful concepts.

    @Katana314: OO becomes easy when you come away from your PC. Object Pascal was my first OO language, and I really started to grasp it when I looked at objects in the kitchen the same way that I look at virtual objects now. The toaster has properties, some of which are writable. It has methods, and all of this encapsulates some dangerous electronics in a nice, safe usable wrapper class.

  • I've dabbed with various languages but C# is my first serious one, I've read "Head First C#" and created a few projects. But after reading the post above I've found it a bit disheartening that I may be going about it all wrong, obviously I respect Joel's opinion which is what has thrown me a bit.

    I respect Joel's opinions too, but they are just that: opinions. There's absolutely nothing wrong with using C# as a starting language.

    The biggest advice I can give you, or anyone doing any programming (even if they're starting in vanilla C!) is to not be stagnant, and don't be religious. I don't care what programming language you're starting with, or how pure or righteous that language is - in this day and age you cannot afford to sit in only world of programming.

    For example, I started programming with PHP3 back when I was a teenager. I built some small web apps and a few web sites with it; I thought that I was a genius programmer and that I could do anything with PHP3, and frowned on people who were all about ASP or BASIC. Boy, was I wrong.

    I didn't start to truly blossom as a developer until I began expanding my horizons and studying other programming languages and concepts. During high school I learned some RealBASIC, and then later Visual Basic. After business school, when I became a professional developer, I started learning C# and Javascript in earnest.

    Now, don't misunderstand me here - I'm not advocating that you try to be a Jack of All Trades. At heart, and in trade, I'm still a PHP programmer. PHP is my bread and butter, and I know it inside and out. However, my PHP skills didn't become what they were just doing PHP. Here are some highly important concepts that I didn't grasp from PHP, despite working in it professionaly.

    • Javascript: Closures
    • jQuery (yes, separate): the DOM and Ajax
    • Visual Basic: Objected-oriented programming
    • C#: Generics and closures
    • Ruby (on Rails): The power of MVC design

    I could go on, and so could many others on this site as well, for days. Even though I'm a PHP programmer I was able to bring all of these other wonderful concepts back with me into the work I do every day.

    What's my point? Learn C#. Become a master of C# - you'll have a long, successful career and you'll probably accomplish some amazing things. But don't pigeon-hole yourself. Journey, and taste other languages and environments and concepts.

    +1: @toleero - C# or Java is perfectly fine to start learning from. Joel and Paul Graham Beating the Averages were trying to get across the point of developers stagnating with their chosen languages as pointed out this is all too common.

    Objective-C also teaches MVC, by the way, but it's less conventionalized.

    +1. In my opinion, you can't truly be a great developer and a master of your main language, without having learned and played around with other languages. That's the best way to expand your knowledge, and to truly appreciate the strong sides of your main language.

    +1. The key take away from this are the words he chose to bold. It is too easy to learn something like Java and C#, or even C and spend 10 years of your life writing code the way you always have. Push yourself, learn a new language every year. Question the things you do, try to find a better way. And most important, stay involved on Programmers and StackOverflow.

    You can do all these examples in C#. Dom/ajax: C# xml & ajax libraries. Object oriented? Check. MVC? mvc framework.

    @Carra: I agree, and I wasn't trying to imply that you _can't_ learn them with C#. I was simply pointing out the benefits of exposing yourself to a range of programming worlds.

    @Carra You want to manipulate the DOM through C#? Fine, sure, it can be done. You want someone who's trying to figure out where in the IT world to get their start, to try to work with the DOM in C#? UHHH, NOT HAPPENING.

    I cringe while looking at that list...I'm not questioning your abilities, but you are living at 10,000 feet. Good answer nonetheless. +1.

    @Stargazer712 Thanks..? Guess I don't get the 10k feet analogy.

    @Jarrod, it means that you're looking at the computer from a very high level. Its a reference to the fact that nothing in that list is "close to the metal." I'm sure that you're really good at using the tools, but you don't know how the tools work. This may not be a problem for you now, but sometimes there are tasks where normal abstractions can actually make life more difficult. I'll avoid elaborating anymore or a mod will remove all of the comments.

    @Stargazer712, Different worlds, different needs. I understand your point, though.

    How did learning generics help you be a better PHP programmer?

    @svick It helped me to better understand the nature of typing, and how to structure my classes. Its difficult to explain - it was like seeing another facet of object-oriented programming that I hadn't considered before.

License under CC-BY-SA with attribution

Content dated before 6/26/2020 9:53 AM