Disclaimer: I have a bias toward C#, having used it nearly everyday since 2003.
Originally Posted by Squeegee Beckenheim
Let's break this out:
 Is C# a good beginners language?
Yes. C# is a great first language, its very easy for beginners to learn and has plenty of features for experts as well.
 Is C# widely used?
Yes it is. People use it for creating websites, including one especially popular website
, web services, enterprisey business applications, small games, robotics, desktop applications.
C# is the go-to language for any kind of Windows development.
 What does object-oriented mean?
Object-oriented programming describes a style of programming which attempts to model "things" by grouping their data, their attributes, and behaviors into a single unit called an "object".
A cat, person, computer, and a roll of duct tape are all "real" things in the tangible sense. When we think about these things, we can broadly describe them in terms of a number of attributes:
- Properties: a person has a name, a cat has four legs, computers have a price tag, duct tape is sticky.
- Behaviors: a person reads the newspaper, cats sleep all day, computers crunch numbers, duct tape attaches things to other things.
- Types/group membership: an employee is a type of person, a cat is a pet, a Dell and Mac are types of computers, duct tape is part of the broader family of adhesives.
Object-oriented programmed was developed around the idea that applications should model entities and simulate their interactions in code. You can absolutely model "real" things in an application like like cats, people, and adhesives, but nothing in principle stops you from representing less concrete things, such as a bank account or a business rule.
Simulating models and interactions of things as "objects" strongly effects the structure and organization of an app. You may want to define a types (any blob of data used in our application), but then derived a new type which is a specialized version of the parent type
, forming a type or inheritance hiearchy. For a concrete example, imagine you're writing a Space Invaders
You might have an object called Sprite which represents the base type used in all of your game; Sprites are drawn on screen, they can move around, can be added or removed from the game at will. You can have a Spaceship type which derives from Sprite, and you can even have more specific XWing and MilleniumFalcon which derive from Spaceship. Likewise, you have your different kinds of enemies each with their own properties and behaviors, CombatPlane, Tanks, FlyingSquid, HypnoToad, etc. After you define all the objects in your game, you might have inheritance tree similar to:
/ \ \ \ \
SpaceShip Enemy Obstacle Projectile PowerUp
/ | | | |
| |- CombatPlane |- Asteroid |- Bullet |- ExtraLife
|- XWing |- Tank |- Fence |- Laser |- FasterAmmoReload
|- MilleniumFalcon |- FlyingSquid |- AirBase |- FreezeEnemies
The idea would be that each more specific type of sprite has its own attributes (its life/damage, position on the board, velocity), behaviors (enemies might have different attack strategies), and type (an XWing is a
Sprite, but a Sprite is not always
an XWing. XWing is a
SpaceShip, while CombatPlane is not
In practice, most object-oriented languages follow the "everything is an object" philosophy. In addition to the objects you define, every
piece of data in an application is represented by an object. Including numbers, strings/text, the values TRUE/FALSE. Architecture of your application from top to bottom is implemented with objects and specific interactions between objects, often in the form of design patterns
and other abstractions (for example, you might create objects for reading/writing from the database, an object which represents a timer or stopwatch, object which represents the setting in a programs config file).
Object-oriented design is one of the dominant programming paradigms
used to implement applications. A programming paradigm describes how certain features (like objects and inheritance) shape the style and implementation of your program, and the way you define and manipulate data.
This description is not, in any manner, a comprehensive description of OO, but this should give you a least some context of what people mean when they use the term.
 Is C# ideal for writing games?
Probably good for prototyping, writing small games, mobile games, indie games, and so on. Not long ago, I saw a job posting for looking for C# game devs to create simulations and learning aids for medical students, which is pretty cool if you ask me. Many C# developers use Unity
for writing games, which I believe is the successor to Microsoft XNA
is making its way on browsers. C# has a large game dev community, but its a tiny share of the market.
C++ will probably dominate the gave dev world for a long time for one major reason: it has a very predictable cost model. Memory allocation and freeing is quite explicit; you can look at any function have a good idea of exactly the machine operations being executed to run that piece of code. C#, on the other hand, is garbage collected
, meaning that freeing memory occurs implicitly and non-deterministically. C# periodically halts the execution of an application for a fraction of a second to run the garbage collector, then resumes program execution normally; this has the effect of introducing small freezes and hiccups in your application anywhere and anytime. C#'s cost model is therefore less deterministic and less predictable. This isn't a problem in most applications because the freezes are usually too brief to be perceptible, but its unacceptable in the gaming industry where performance must
be predictable and graphics must
render constantly, consistently, and in roughly uniform slices of time.
Head First C#
is probably the best beginners book. Lots of examples, lots of sample coding projects which gradually and gently introduce more language features, the book is even funny at times.
You can find PDFs of this book for free on some sites, but these guys worked hard to write and illustrate it, I'd suggest spending the money to buy it.
You don't need VS to write C# apps, learn to program, etc. But its just a nice tool with lots of killer features: Intellisense to discover classes and methods, really nice debugger, easy to create simple GUIs with drag/drop. There's a reason why VS is the standard tool in virtually every C# dev shop anywhere. I would recommend a newbie programmer using Windows should stick with the standard tools. It'll get you up to speed faster, giving you more time to "look under the hood" later.
If you really insist on learning the principles of programming and algorithm design in the most "pure" way possible, SICP
is unbeatable, but may not be easily accessible to a first-time programmer.