Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

C# Book Recommendations?

Posted by Cliff on Fri Mar 16, 2007 01:45 AM
from the which-one-is-the-best-to-learn-from dept.
Stevecrox asks: "I'm in my final year of university and have a working knowledge of C/C++, Visual Basic, VHDL and a variety of Assembler languages, however chatting to a friend on his placement year I've been told that C# is what employers are really looking for. What book would you recommend to someone looking to learn C# with my experience?"
+ -
story
This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • Book? (Score:3, Insightful)

    by TodMinuit (1026042) <todminuit@gm a i l .com> on Friday March 16 2007, @01:50AM (#18371997)
    Just start screwing around. Build some stuff in it. Work on some open source stuff. You should be able to pick it up easily.
    • Re: (Score:3, Insightful)

      Well, that doesn't work on people like me that work MUCH better if they're programming something for a reason. While I hate to admit it, I don't have the personality of "I'm going to do this just for the hell of it" - I need a reason to make my life easier, etc.

      While I'm not the story parent, I've recently found projects to work on in C# so I can learn...
      • Re:Book? (Score:4, Interesting)

        by Osty (16825) on Friday March 16 2007, @03:03AM (#18372277) Homepage

        Well, that doesn't work on people like me that work MUCH better if they're programming something for a reason. While I hate to admit it, I don't have the personality of "I'm going to do this just for the hell of it" - I need a reason to make my life easier, etc

        Reading a book wouuldn't help in your case either. My suggestion? Every computer science student at one point or another has had the desire to build a game. Go download Visual C# Express [microsoft.com] and XNA Game Studio Express [microsoft.com] for free and learn C# while scratching that itch at the same time. While the XNA bits won't necessarily be directly applicable to getting a job outside of game development, you can use the full .NET framework for Windows games (XNA on Xbox 360 uses a more limited version of the Compact .NET Framework). Could there be a more fun way to learn C# than by building a game?

        • Re:Book? (Score:4, Interesting)

          by cyclop (780354) on Friday March 16 2007, @05:26AM (#18372773) Homepage Journal
          I personally don't like computer games that much (expect perhaps for Civilization-like things), and I always found programming games, when I tried, unbelievably boring. However, YMMV.
        • I read programming books all the time. In fact, I take an odd pride in being able to sit down and read a programming manual without falling asleep, but reading isn't actually programming.

          The funny part about what you wrote is: I'm actually sitting in front of a freshly installed (ie: within the last hour) copy of Visual Studio Pro. Now, granted, I'm working with ASP.NET but I'll still be able to move into C#...
        • Re:Book? (Score:4, Insightful)

          by CastrTroy (595695) on Friday March 16 2007, @07:57AM (#18373613) Homepage
          Everybody wants to build a games. Nobody ever does. Building a game takes a lot of time, and really isn't much more interesting than programming any other application. Plus it takes a lot of time before you get something useful. Plus, there's a lot of other skills required. You probably have to do the art, textures, character models (3D or sprites), level design, and the list goes on. Making an application that fits some need you have would probably make a lot better use of your time.
    • Re:Book? (Score:5, Interesting)

      by teslar (706653) on Friday March 16 2007, @05:54AM (#18372869)
      I disagree. To learn a language you have to know what its strengths and weaknesses are, which approaches work well, which don't. You could get that knowledge from just playing around, but it'd be a lot quicker if you read a book that tells you. Especially if you know another language, a list of the crucial differences is very much required. If not you end up writing things in the style of one language that really should be expressed differently.

      Example: C programmer in Matlab. Task: Take two vectors of same length, for every i smaller than length, multiply the ith element of the first with the ith element of the second vector.

      Results:

      Just playing around, as you suggest:
      function y = multiply_vectors(a, b)
            y = zeros(size(a));
            for i = 1:length(a)
                  y(i) = a(i)*b(i);
            end
      end


      Doing it the proper (Matlab) way:
      y = a.*b;

      It's a simple and therefore unlikely example, granted, but there are many such differences between programming languages. Just playing around doesn't easily allow to find them because, technically, the code works. It just doesn't work efficiently. That said, once you know how to deal with the language, by all means, screw around. A lot.
      • Re: (Score:3, Insightful)

        Case in point. I learned C in first year university. In second year, we took a file structures course that required use to use C++. I had never used C++. But I did know C. So instead of using strings.h, I used characters arrays. Sure you can do all the same things, but one requires much more work than the other. There's easy ways to do things, and hard ways to do things. If you read a book, you can often find the easy ways to do things, that would be very difficult in another language.
    • Re: (Score:3, Insightful)

      Languages aren't that hard to pick up, it's the API that's important. And you really can't learn an API from a book, you just have to use it. Not only that, C# (.Net more specifically) has a great API reference. There's no reason to buy a book at all. If you understand C++, then you shouldn't have any problems using the same concepts in C#. I never understood employers who required that you have 10 years experience with a certain language. You can learn the Language in 1 week. If you've been working w
      • The people in Human Resources see that you want a C# programmer at a certain high salary, and decide that the job requires someone who's been using C# for 10 years. I always wonder how many jobs with requirements like this go unfilled because the idiots weeding out "unqualified" resumes don't realize that C# hasn't even existed for 10 years.
        • Re: (Score:3, Informative)

          Something I've found useful is to learn which publishers to trust. The editors at each publishing house each have their own eye as to what they think makes a good book. Some lean more towards the scholarly, some to the "reference style", while others take a more colloquial approach. And some just publish whatever crap gets submitted.

          After you've read a few, you'll start to get a feel for the kinds of books you like. You'll probably also get the taste of a few lemons. But you'll eventually find that a

  • A few (Score:4, Informative)

    by Anonymous Coward on Friday March 16 2007, @01:58AM (#18372035)
    Professional c# 2005 and the .net 2.0 platform by apress is excellent. Read it from cover to cover (about 1000 pages but very high quality book). It will cover the basics of C#. Also it exposes you to database access with c#, and covers both data readers and datasets from .net library. It also covers winforms and gdi+ programming. It gives you a taste of asp.net 2.0 also. If you buy 1 book, buy this one. I bought it and just lucked out. I spoke with several other people and this is the one book everyone seems to recommend.

    Next up i'd look into beginning asp.net 2.0 with c# by wrox press if you are interested in web development. It is an example driven book. You read a little, then it walks you through doing something. It also has assignments at the end of the chapter to make sure you are getting it.

    Continue with pro asp.net 2.0 with c# 2005 by apress. It will give you a deeper look into more advanced topics of asp.net.
    • Seconded. It also discusses how many C# features are implemented in CLR, giving you a healthy dose of background.
    • Re: (Score:3, Interesting)

      i'd look into beginning asp.net 2.0 with c# by wrox press

      Since the question was about C#, why not mention that there's a corresponding Beginning Visual C# 2005? I found it to be very helpful, unlike the other C# book I bought (Core C# and .NET from Prentice-Hall). It starts off with C# itself, and only after covering that thoroughly does it get into Windows-specific topics (ignoring the fact that C# itself is largely Windows-specific).

      On a meta-note, be sure to check out what employers in your area (or the area where you'd like to live) are actually looking fo

  • by martijn-s (456925) * on Friday March 16 2007, @02:02AM (#18372051)
    I got this book around when C# was first introduced. I started from the same languages you name, and I've quite possibly never read a better book about a programming language (and API of course).

    http://www.apress.com/book/bookDisplay.html?bID=45 4 [apress.com]

    (Actually, A programmer's introduction to PHP is also very good.)
    • by xtracto (837672) on Friday March 16 2007, @07:03AM (#18373159) Journal
      I recommend Deitel's C# book. It is a very comprehensive book and has everything you can need.

      I will also recommend the In a Nutshell [oreilly.com] book. I am a big fan of those books as they cut all the crap and take you directly to the meat (I loved specially the SQL IAN book).

      And for all the people saying "dont buy a book", STFU. If you do can not answer the question of the poster just do not post anything. His question is not "Should I buy a book?" but "Which book to buy". If there is something I have learned is that reading a book is *never* a bad idea. Or what, if someone asks you in the street how to get to X you answer "No, dont go to X, go to Y, X sucks" ?.

      sheesh!
      • by Erioll (229536) on Friday March 16 2007, @09:59AM (#18375127)
        I've read a few of the "in a Nutshell" books, and the C# one is by FAR the worst. Most of the others are anywhere from good to great (the Java one is outstanding IMO), but the C# one just falls really REALLY flat. The examples are bad, and he often jumps in "assuming" that you know how things are supposed to work. But most glaringly, it doesn't even cover the most common operations. Like take a guess how to bring in an entire text file at once? Guess what: you basically need to go into the API and figure it out yourself, because none of the string or file I/O examples touch on it at all. Now true, I haven't seen it since first edition, but I wouldn't trust it at all. I'm just glad I didn't lay money out for it, but rather got it from a library.

        The authors of the "nutshell" books are not all the same, hence the vast differences in quality. Buyer beware!
  • MSDN (Score:3, Informative)

    by jfclavette (961511) on Friday March 16 2007, @02:02AM (#18372053)
    If you are familiar with object-oriented programming, then I dont believe you need a book. MSDN C# language page [microsoft.com] should be all you need. If you insist on getting a book, I recommend Programming C# by Jessy Liberty for a tutorial.
  • CLR via C# [barnesandnoble.com]

    It skips over a lot of the hand holding that a "Learn Foo in X Days" book will give you but goes in to great detail about how the language is implemented, often giving examples of how C# code is compiled to IL assembly language and sometimes further giving examples of how it will be compiled by the JIT compiler into x86 assembly language.
  • I already knew C and C++, so I can't speak from a beginners point of view. Inside C# did the trick for me.
  • "Pro C# 2005 and the .NET 2.0 Platform" by Andrew Troelsen is an excellent book.

    It isn't a "recipe" book that tells you how to do common things, or something that you read from cover to cover to learn the basic syntax for non-programmers, it's more of a reference book..

    In a nutshell:
    • The C# programming language.
      • The C# syntax specific stuff, if you wanted to learn Mono this is the only applicable chapter. Basic syntax, collections, object lifetime, Interfaces, Delegates, Generics, etc. Goes into lots
  • This might sound simplistic, but take some of your old code that you are very familiar with and rewrite it with C# constructs, if possible. I'll admit my knowledge of C# and its relationship to other languages in minimal, but this has almost always helped in learning of new syntax/datatypes/limitations for me.
    • I agree that translating old code (or reimplementing it from the idea, not necessarily translating the code itself) is a good way to learn, but it helps to have a good book on the target language to get the idioms of the new language.
  • Book???? (Score:2, Insightful)

    Echo the 1st reply..

    Books are a waste of time.. The only time I'll buy a book is if the info is very difficult to source online.

    If you can read C++, you can read C#. The class naming and hierarchy of their APIs are so verbose that you should be able to understand any sample code.

    If you're not in any projects (open source or not), get in & hack hack hack away. C# is pretty widespread now so any issues, just Google it. If you don't like MSDN doco, learn to like it, because it's free and pretty g
    • Re:Book???? (Score:4, Insightful)

      by LizardKing (5245) on Friday March 16 2007, @05:24AM (#18372763) Homepage

      You suggest books are a waste of time, and to just dive in and start hacking. This attitude is a major reason why there is so much bad code out there. As I point out in reply to another post that recommends a book on Lisp to someone wanting to learn C#, if you don't know the common idioms of the actual language you are using then you will produce terrible code. A good book wont just teach you the nuts and bolts of a language such as the raw syntax, it will also encourage good practices - what I think James Coplien or Tom Cargill described as teaching "programming in the large".

    • .NET 3 is only an extension of .NET 2, but its the same language. Its basically the J2EE of .NET, more or less. An enterprise framework (or a piece of one, since .NET's way is to split it up).

      And for being able to read C++ equalling being able to read C#... thats true for the base stuff. Pop in a custom control with a GUI designer, and your average C++ programmer will quickly go "What...the....f...." at the declarative attributes programming model of that kindda task. Just an example.
    • I agree that there's a lot of information online, but there are days when I (and I'm sure a lot of us) get annoyed trying to find an example of what we want to do, or think we can do. I'm always a lot happier having an actual book sitting on my desk that I can poke through and reference when I want. Not to mention I always find something I didn't know about just by paging through things that look interesting.

      And yes, books easily become out of date, but I just as often stumble on old web pages that no o
  • I can recomend the Holy Bible (King James Version, leather bound):
    http://www.amazon.com/Bible-Giant-Print-Personal-L ibrary/dp/0834003511/ref=ed_oe_h/002-6705002-67456 10 [amazon.com]
    to help absolve your sins, my son...
    • Yes, that is very good too, praise the lord! But ask yourself, how can bible help you when your beloved project manager is shouting developers, developers, developers and you suddenly find yourself in path of flying furniture's? I can say that praising lord doesn't do a squad. But alas, help is on a way! For all those miserable souls who don't mind giving their soul in exchange of dark forces of hell, there is the Necromancer Bible. Unfortunately Amazon doesn't carry this item currently. So what to do in a
  • For technical IT books I recommend Safari [oreilly.com]. It has saved me a lot of money since now I can read all new IT technical books online and I don't have to buy dead trees anymore. It has also saved me a lot of space on my library, and the search feature allows me to find quickly what I need. For learning a new language, Safari is surpassed only by open-source, and if you combine the two you can learn C# as fast as you count 1, 2, 3.
  • Structure and Interpretation of Computer Programs [mit.edu] (full text online). Anyone who hires someone who doesn't know what's in this book is hiring people for the wrong reasons. Unless you want to work for such people, it doesn't make sense to go into the workforce with such a narrow knowledge (C/C++/C#). Learn everything you can about everything.
    • Just a quick followup -- One of the best ways to learn C# is to learn languages like Haskell and Smalltalk so you get it from all angles. If you learn C# with a knowledge of only C++, you'll just be writing C++ in C#.
    • Sorry to go against the orthodoxy, but the only reason why you've mentioned SICP is as a way of saying "look at me, I know Lisp, I'm a true hacker". How many times have you really used Lisp in for commercial development, or applied its idioms clearly in another language? Lisp programming techniques do not translate well to the popular languages for commercial development such as C, C++, Java or C#, you end up with obscure hacks and sub-optimal code because you don't use the common idioms of those languages.

      • Re:SICP (Score:4, Interesting)

        by John Nowak (872479) on Friday March 16 2007, @05:43AM (#18372829)
        SICP isn't about learning Lisp or Scheme. It's about learning how to program.

        That said, how many times have I used Lisp for commercial development? None. How often have I applied its idioms? I do so on a daily basis.
  • Get the Gang of Four [amazon.com], and other books on O-O like Holub on Patterns.

    Don't bother with books aimed purely at C#. If you know OO well, you can appreciate other languages too. I recently went from coding C# to Java for the first time, with very little change of pace, simply because the tools, APIs, syntax and general patterns are so similar. I'd expect the same from C/C++, because the C# syntax is both similar and simpler. In particular, context-completion features with popup help in IDEs mean that I very rare
    • Be careful about that. While its true in the basics, as soon as you get in enterprise level development, everything changes. Implementing many patterns in C# is different than in Java (or at least, you don't implement them in the first place... I'm getting SO sick of java programmers coding Observer from scratch in C#...), and at the enterprise level it all changes: introspectable objects, messenging, caching, data access, data layer design, all of the web stuff, distributed computing and web services, mult
  • I just paged through programming C# by jesse liberty (o'reily) - It's a great book and there's really only a few things about C# that are different from java, like the yield keyword, operator overloading, and delegates/events, and C++ Style compiler directives.
  • From Addison-Wesley, by Michaels. ISBN 0-321-15077-5.

    It goes from 'Hello World' to generics, delegates, interfaces, reflection, threading etc. In short if you are stuck in a MS shop and have to build complex code (like I once was), it is very helpful.
  • I'm assuming you're doing this on windows.

    1) Write a small program to start understanding the syntax. Use code you find on the web for reference.

    2) Become familiar with the following projects, and understand how they are implemented:
    a) mbUnit [mbunit.com], a fantastic example of modern, idiomatic c# design.
    b) DynamicProxy [castleproject.org], which pushes (abuses?) the CLR's reflection APIs past what you might think they are capable of.

    3) Get a copy of .NET reflector [aisto.com], which you'll need to overcome the lack of
  • After getting the basics of the language down, I would definitely recommend "Effective C#: 50 Specific Ways to Improve Your C#" by Bill Wagner (ISBN 0321245660).
  • by Anonymous Codger (96717) on Friday March 16 2007, @11:58AM (#18377023)
    My experience in a recent job search is that the demand for Java exceeds that for C#. Unless you're enamored of Microsoft software and operating systems, you might want to learn Java first.

    One thing for sure - the demand for C++ programmers has collapsed, at least in the DC area.
  • I've been on/off developing in C# since 1.0 (2002). Two books I'd recommend, both my Microsoft Press:

    "Applied .NET Framework Programming"
    http://www.amazon.com/Applied-Microsoft-NET-Framew ork-Programming/dp/0735614229
    - Recommend reading this first, cover to cover
    - It gives the gritty details of .NET, with most all examples in C#.
    - Services as an invaluable reference

    "Visual C# 2005 Step By Step"
    http://www.amazon.com/Microsoft-Visual-C-2005-Step /dp/0735621292
    - Specifics on the latest release of C#
    - While gu
    • Re: (Score:3, Insightful)

      Around here, C# is a silly thing to ask a question about.

      Which is a shame, as it's a pretty nice language backed up by a comprehensive framework. If it weren't for the fact that it's from MS and therefore automatically evil in the eyes of so many people here, I think it would be rather more popular.

      that particular book was a good primer on the syntax of C# - which is surely important - and not that great a primer on the actual functionality of Visual Studio.

      That's probably because it's called "Learning C#"
        • I've got a blog entry on this. Some of my comments were off base because I didn't know about some of the features of VS2005 at the time, but the ones I really would like fixed:
          1) Open Resource (Ctrl-Shift-R in Eclipse)
          2) Open Type (Ctrl-Shift-T in Eclipse)
          3) Organise imports (using directives in C#; get rid of ones I don't use, sort the ones I do, add any necessary)
          4) Make the overload tooltip show more than one ruddy entry at a time!

          Oh, and compile-incrementally-on-save-so-quickly-you-don't -notice is rath
    • The only great thing about Microsoft development is the tools you have to do it with.

      It's sad, and I'm sure to get ripped to shreds for this, but VC8's debugger is the main reason I haven't switched to Linux on the desktop. Forget editors, conciseness of programming language, little penguins running in hamster wheels, whatever, it's only the debugger that matters when it comes to the hard part.

      • What's wrong with gdb?
        • Um? Using gdb is like surfing the web by connecting to port 80 with telnet. Probably there is a decent gui interface to it out there, but the last time I tried finding one, it didn't go well for me. I'd also want it to have a nice stable edit-and-continue integration, so I can iterate on code at the same speed as someone working with script...
            • And the manual is available here [gnu.org]. I volunteered work for this briefly, and I was under the impression that it was going to be published in print form as well, but I get the impression from the GNU print manuals webpage that they never did get around to actually printing it.