5

I have two professional programmer friends who are going to teach me, and they both love the language (C#). I know that their specific skills and enthusiasm more than out-weigh any drawbacks to the language, but they seem like such fanboys I'm left wondering what the catch is.

I only have experience of XHTML and CSS, so accept that getting my head around Object orientation will be a challenge, for example. I'm vaguely aware that some languages (python?) allow you to test small sections alone, and that this is particularly useful for beginners. I worry that I'm trying to run before I can walk by going straight for C#.

I'm sorry this is a bit of a rambling question, but advice would be greatly appreciated.

GEOCHET
  • 21,119
  • 15
  • 74
  • 98
Will Worth
  • 71
  • 1
  • 5

18 Answers18

11

There's a lot you'll be learning way before you get to object oriented concepts. If all you know is HTML and CSS then you'll be learning all the basics way before you touch objects. For that reason, C# is a fine choice, as it's got a great IDE and IMO makes it very easy for beginners. As for testing small snippets of code, that's just as easy in Visual Studio, you'll be writing many, many Console Applications where you can test very small snippets of code before you even get to any WinForms development. I say good choice.

Jason Coco
  • 77,985
  • 20
  • 184
  • 180
BFree
  • 102,548
  • 21
  • 159
  • 201
8

You have to start somewhere, I'd go for it. However I'd also buy a C# for beginners book. Experienced developers often "forget" what it was like starting off, and might "rush" you into things you're not properly prepared for.

If they're not experienced developers, then REALLY BUY THE BOOK, without a book it's a case of the blind leading the blind, and they'll teach you bad habits.

So . . .

  • buy a book
  • structure your learning around the book
  • Take all the help and advice your friends have to offer - as you work your way through the book.

It's along time since I was a beginner, anyone any recomendations on a C# for beginners book?

P.S. Have I mentioned that I think you should buy a book?

Binary Worrier
  • 50,774
  • 20
  • 136
  • 184
  • [C# in a nutshell by Joseph Albahari](http://www.amazon.in/5-0-Nutshell-5e-Joseph-Albahari/dp/1449320104) for beginners. I love this book even after having few years of experience in C#. – RBT Dec 26 '16 at 03:10
7

Work out your right pinky finger and make it more dexterous.

Tom Anderson
  • 10,807
  • 3
  • 46
  • 63
7

The catch is that you will need to learn OOP along side of a language that is intermediate as far as skill level goes. OOP is far more important, and difficult, for beginners to grasp than any language (that is, if you are learning an OOP language...which .NET is..)

Honestly, C# is not an inherently difficult language to learn. It may take some time, but just bear in mind that knowing the language will not make you a programmer. You will need to know how to program to get there, and that is the catch to which you are referring. Hopefully, your friends will also teach you object oriented fundementals.

Pete H.
  • 1,427
  • 1
  • 12
  • 16
  • 1
    "catch is that you will need to learn OOP" true, except when you're starting with "This is a variable, this is a condition, this is a loop", it's a long time before you hit declaring and using your own classes. There are useful "lies to children" (http://en.wikipedia.org/wiki/Lie-to-children) cont. – Binary Worrier Jan 12 '09 at 17:19
  • that will get the beginner though accessing and using framework objects, without burdening them with too much information at the start. "Sufficient unto the day is the evil there of" and all that jazz (p.s. I'm not a religious nut, but I do love that phrase so I do) – Binary Worrier Jan 12 '09 at 17:21
3

I think the biggest catch to C# is .Net and the overwhelming number of existing libraries (not sure if this translates to Mono). You'll almost certainly implement something on your own that already exists in the framework.

I recommend running FxCop as well to make sure you're doing things the "recommended" way.

Austin Salonen
  • 49,173
  • 15
  • 109
  • 139
3

You should beware that you probably aren't just learning C#, but also the .NET framework (which is enormous) so keep that in mind.

I also agree that you should buy a book.

Nathan Koop
  • 24,803
  • 25
  • 90
  • 125
2

Everything is an object.......

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
missaghi
  • 5,044
  • 2
  • 33
  • 43
  • isn't everything derived from the base type Object? – missaghi Jan 12 '09 at 16:59
  • Value types, ints, doubles, object references (not the objects them selves) etc aren't objects. They can be "boxed" to look like objects (e.g. i.ToString()) but really they're primitive types. Change the entry to "NEARLY everthing is an object" and I'll remove the downvote – Binary Worrier Jan 12 '09 at 17:07
  • I appreciate the clarification. I think the lowest level that you can interact with, say an int, in c# is as a struct, which isn't an object? - http://msdn.microsoft.com/en-us/library/ms173109.aspx – missaghi Jan 12 '09 at 17:09
  • 1
    Doesn't Int32 inherit from ValueType which inherits from Object? If so, despite the behavior, an int is an object. – Chris Farmer Jan 12 '09 at 17:18
  • No, the boxed type for int inherits from ValueType, which inherits from Object. They're not objects in the traditional sense because a) an int isn't a reference to an int, IT IS the int. b) ints aren't garbage collected. If you declare an Int32, then that int is 4 bytes on the stack, end of story – Binary Worrier Jan 12 '09 at 17:27
  • 2
    this comment is now a question : http://stackoverflow.com/questions/436211/is-everything-in-c-an-object "does the Object class derive from jon skeet?" – missaghi Jan 12 '09 at 17:42
  • @BinaryWorrier... ah, that's true. Now your earlier comment about boxing seems much more relevant! The boxing point should be emphasized more in the popular literature, IMO. It's easy to forget the behind the scenes wrapping that can happen. – Chris Farmer Jan 12 '09 at 17:57
  • OK, I've changed my mind. In C# nomenclature "Everything IS an Object", but this statement doesn't infer that "ints are implemented differently to DateTime and StringBuilder". Different Types of object are implemented differently i.e. Reference, value and primitive types. – Binary Worrier Jan 13 '09 at 11:46
  • @rizzle: Apologies mate, +1 to you change it back to "Everything is an object" :) – Binary Worrier Jan 13 '09 at 11:47
  • [This](https://blogs.msdn.microsoft.com/ericlippert/2009/08/06/not-everything-derives-from-object/) blog from Eric clears lot of doubts. Everything in C# is NOT an object. – RBT Dec 26 '16 at 03:14
2

C# is evolving fast. The earlier you start, the more you grasp. Some OOP background is recommended, but practice will lead you to your goals.

Just a warning: Once you start you may never want to stop.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Oscar Cabrero
  • 4,168
  • 8
  • 29
  • 49
2

C# is a modern, high level language; I would say it's a good place to start. A lot of the lower level stuff you would be dealing with in C or C++ is abstracted away in C# and .NET, so it won't be as hard to learn things like Object Oriented programming or design patterns. These things are important concepts in programming today, so it's good to get some exposure to them while you're learning the basics of loops, control structures, and so on.

Marc Charbonneau
  • 40,399
  • 3
  • 75
  • 82
2

C# isn't the beginner's language I would normally recommend, but you could do much worse, and if you have enthusiastic helpers on hand, I say go for it.

I don't think you should worry too much about OO. A complete beginner is more likely to 'get' OO quickly than someone who's 'baked in' non-OO concepts for a few years.

You're more likely to struggle if/when you later try to learn some other paradigm - but that's a bridge we all have to cross eventually.

I recommend you embrace unit testing really early on. Perhaps your friends can help set you up with NUnit. Not only is it a great habit to get into (a habit experienced programmers have trouble acquiring), but it's the closest thing to exploratory programming ("test small sections alone") you'll get in a language like C#.

You should definitely get a good book. Once you've got through the book, done a few projects and feel you're getting comfortable, force yourself to learn another language too: maybe a scripting language. This will help you understand which parts of what you know are general programming skills, and which ones are unique to C#.

slim
  • 40,215
  • 13
  • 94
  • 127
2

The one advice I can give you is which version of C# you should learn.

There's version 1.0, 1.1, 2.0, 3.0, and the future 4.0. The version you want to learn is definitely C# 2.0. It added features that are really necessary, and fixed some problems with 1.1 that you don't even want to know about.

You don't want to start with 3.0, because it adds lots of stuff, that are cool, but will only confuse you.

Start with 2.0, then work your way up to 3.0.

Hermit
  • 1,214
  • 13
  • 24
2

only have experience of XHTML and CSS, so accept that getting my head around Object orientation will be a challenge

Be aware that CSS and XHTML are not even "really" programming.

There are tons of concepts that you've never heard of. In essence you are a totally 100% beginner in programming.

I think C# is a great language to learn with. After you learn it, if you want to really challenge yourself and understand the lower levels of programming, I would recommend you learning (torturing yourself with) C/C++. There you will learn more of what's going on under the hood.

Alex Baranosky
  • 48,865
  • 44
  • 102
  • 150
1

You want to know that it is not directly interacting with the operating system and that it requires the .Net framework to run. So, if anyone wants to use your application, they will have to install the .Net framework. That's not as big a drawback as it sounds, and I am also a C# fan boy.

scottm
  • 27,829
  • 22
  • 107
  • 159
  • Thanks! I'm aware of the .NET requirement, and was slightly concerned, but figured I'm working at so many layers of abstraction that "what the hell..." – Will Worth Jan 12 '09 at 17:13
1

I recommend the Head First Series: Head First C# available at Amazon.com. They do a pretty good job explaining Object Oriented (OO) principles but you also may want to check out a dedicated (OO) book. Head First also makes a decent OO design book: Head First Object-Oriented Analysis and Design available at Amazon.com.

Joel
  • 357
  • 3
  • 15
0

You are trying to run before you can walk. If you were coming from another language like Java or Rails then it would be easy to point on nuances between the two, like "Java allows ??? while C# doesn't". Since your not doing that, C# is a great place to start, and seems to have a promising community around it. It's developing into a first rate language.

BBetances
  • 925
  • 1
  • 14
  • 23
  • Thanks! I know I don't know a lot, but I seem to gleam quite a bit from those "if programming languages were X" lists, and thought you guys might help. – Will Worth Jan 12 '09 at 17:14
0

Get a "step-by-step" style book and follow it along in the IDE.

Chris Ballance
  • 33,810
  • 26
  • 104
  • 151
0

To be honest I think you'd be better off playing with Javascript for a little while (a few weeks). Just to get the basics of flow control, assignment etc, it's less hassle (no IDE required), forgiving and can easily be tied into the skills you already have.

C# is a great language though, so as soon as you get anywhere near stuff like OOP it might be a nice idea to move over.

Quibblesome
  • 25,225
  • 10
  • 61
  • 100
-1

I started my c# journey with the book titled 'How to Code by Deital Brothers'

Assay Khan
  • 56
  • 9