tags:

views:

444

answers:

12

You often see, on sites like The Daily WTF, examples of overengineered code that should have just been a call to a built-in method within the .NET framework.

What namespaces/classes should be considered essential knowledge for a developer starting his/her first .NET job?

As per Joel Spolsky's instruction for these types of questions, please limit your answers to individual items for voting purposes.

+4  A: 

System.String

and learn how to use regular expressions that are exposed via the System.Text.RegularExpressions namespace.

This will save you a huge amount of time if you end up re-writing text parsers or other string related tasks that have built in functions for them already.

http://www.regular-expressions.info/dotnet.html

And the daily WTF is awesome :D

nlaq
A: 

http://msdn.microsoft.com/en-us/library/system.xml.aspx

System.Xml is also very good. Learn how to use these classes/methods so that you can manipulate XML files very quickly and easily without reinventing the wheel. Even if you never use XML yourself, you will come across it everywhere. Put some time into learning:

XML

XSLT

Schemes

RSS

SOAP

As all of these are used extensively in .net applications. You can find good information for almost all of these at:

http://www.w3schools.com/

And also; when you learn how to use it - please don't abuse it :D

nlaq
I would not class XML as "good for beginners".
RCIX
+6  A: 

using System;

System is probably the most important namespace as it contains the core features such as Object and Array as well as the GC (Garbage Collector).

tdyen
A: 

System.Data, particularly Datatable,

Wayne
+13  A: 
System;
System.Collections;
System.Collections.Generic;
JTA
I'd like to add System.Text.RegularExpressions as well.
Vivek
Not System.Collections though, eeee-vil weakly typed collections....
RCIX
RegularExpressions for absolute beginner? Yeah right...
Arnis L.
+9  A: 

System.IO is very important.

Understanding how Streams and the various implementations work (FileStream, MemoryStream, CompressionStream) when combined with binary data or text from a TextReader/TextWriter instance is an essential skill.

James Newton-King
The streams are an essential part to understand. However its not the most intuitive (and in my opinion one of the worst designed bits of the framework)
alexmac
+1  A: 

You should thoroughly look over this application. It contains many patterns and best practices that you should follow.

patterns & practices Guidance Explorer

PhantomTypist
+1  A: 

If you're working in VB.NET I'd say the My namespace is very important. It contains shortcuts to a lot of areas of the framework that used to be spread all over the place in the framework. It's also quite intuitive. You can write things like:
For Each Printer in My.Computer.Printers
or
My.Computer.FileSystem.OpenFile(Filename)
My.Computer.Info.AvailablePhysicalMemory
My.Computer.Screen.PrimaryScreen.WorkingArea

Steve Hiner
Yeah, and a great way not to be able to transition to C# when needed :) Really, I would suggest avoiding the My namespace unless working alone. Oh, and in BCL it's System.IO.File.Open(FileName) - it's even shorter :D
OregonGhost
Yep agreed I would avoid My namespace
alexmac
While not explicitly stated in the question (I'm debating changing it now), my intent is to learn C# first so the My namespace, while useful to many, isn't useful to me. Thanks though!
AgentConundrum
+8  A: 
System.IDisposable

Not properly disposing objects that implement it (streams, database connections, sockets, etc) leads to locked file errors, open database connections and a whole lot of other unpleasant and hard to find bugs in your software.

http://www.codeproject.com/KB/cs/idispose.aspx

James Newton-King
Dispose is clearly not a beginner issue in my opinion.
madgnome
Just because new and "experienced" high level developers do now know how important it is to manage resources you should not ignore it as a beginner.
nlaq
Knowing how to implement IDisposable isn't for beginners but knowing that it exists and that you should dispose of objects that implement it is.
James Newton-King
A: 
  • System.IO for file operations
  • System.Collections & System.Collections.Generic - learn how to manipulate / use Lists, Dictionary, etc.
David Robbins
A: 

There should be some line to be drawn between a Windows Developer and a Web Developer, where either can be using the .NET Framework. System.Web is very useful if you are doing Web Development as well as knowing how .NET interacts with IIS, while this may be irrelevant for a Developer who does Windows and Console Applications.

These are starting to blur at times so a developer should try to see where they want to be in the stack, e.g. do they want to do it all like in a small business environment or focus mainly on development like bigger shops can do.

JB King
+4  A: 

System.Brains and System.CommonSense

Ilya Ryzhenkov