C Sharp: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
m Created page with 'I wanted this page to be called C# but apparently mediawiki did not approve. Oh well. Maybe I will put all things beginning with the letter 'c' here. == Preprocessor Directives …'
 
Brian Wilson (talk | contribs)
mNo edit summary
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
I wanted this page to be called C# but apparently mediawiki did not approve.
I wanted this page to be called C# but apparently mediawiki did not approve.
Oh well. Maybe I will put all things beginning with the letter 'c' here.
Oh well. Maybe I will put all things beginning with the letter 'c' here.
== best practices ==
http://10rem.net/articles/net-naming-conventions-and-programming-standards---best-practices
== .Net ==
What is your favorite [http://en.wikipedia.org/wiki/.NET_Framework .Net] class library?
THe BCL (base class library) includes file io, database access, graphic rendering, xml...
Is it MEF? [http://msdn.microsoft.com/en-us/library/dd460648.aspx?ppud=4 Managed Extensibility Framework]
Do you like ADO.NET? I like ADO.NET because it sounds so ... technical.
Is it the Entity Framework?
So many options. I should insert a poll here.
Does [[Jabber.net]] count? It is not from Microsoft.
What about [[dotSpatial]]?
[http://en.wikipedia.org/wiki/Framework_Class_Library Framework Class Library]
Windows Forms
ADO.NET
ASP.NET
LINQ
WPF
WCF
== What are the 25 ways to process XML in .Net world? ==
I was getting pretty good at parsing XML at [[IncidentView]] 3, but then we re-wrote the whole thing
and the guy that took over that part used serialization.
[XMLElement]
[XMLIgnore]
[Setting]
and it's basically just "read" and "write" operations. No code to write.
== readonly ==
Yes, there is a readonly setting for variables. One would think 'const' would be enough.
Aren't these the same?
public static readonly string foo = "I am read - only."; // happens at program load
public const string foo = "I am read - only"; // happens at compile time
Check the debugger, you can see before the first line executes that foo = null.
Since it happens at load time, you can do this
public static readonly string foo = Something.StringThing();
so the value is set once, and it's done atomically so it is thread-safe.


== Preprocessor Directives ==
== Preprocessor Directives ==


CommandLine
#if DEBUG
  http://codeidol.com/csharp/essential-csharp/Operators-and-Control-Flow/Csharp-Preprocessor-Directives/
#endif
 
== What about things in square brackets ==
 
That I can't type in a wiki, like "bracket CommandLine bracket"
 
== When would I ever use a Struct? ==
 
Read the official documentation [http://msdn.microsoft.com/en-us/library/ms173109.aspx?ppud=4 here.]


=== When would I ever use a Struct? ===
== How can I get traction using command line builds with C#? ==

Latest revision as of 23:08, 24 April 2015

I wanted this page to be called C# but apparently mediawiki did not approve. Oh well. Maybe I will put all things beginning with the letter 'c' here.

best practices

http://10rem.net/articles/net-naming-conventions-and-programming-standards---best-practices

.Net

What is your favorite .Net class library?

THe BCL (base class library) includes file io, database access, graphic rendering, xml...

Is it MEF? Managed Extensibility Framework

Do you like ADO.NET? I like ADO.NET because it sounds so ... technical.

Is it the Entity Framework?

So many options. I should insert a poll here.

Does Jabber.net count? It is not from Microsoft.

What about dotSpatial?

Framework Class Library

Windows Forms

ADO.NET

ASP.NET

LINQ

WPF

WCF

What are the 25 ways to process XML in .Net world?

I was getting pretty good at parsing XML at IncidentView 3, but then we re-wrote the whole thing and the guy that took over that part used serialization.

[XMLElement]

[XMLIgnore]

[Setting]

and it's basically just "read" and "write" operations. No code to write.

readonly

Yes, there is a readonly setting for variables. One would think 'const' would be enough. Aren't these the same?

public static readonly string foo = "I am read - only."; // happens at program load
public const string foo = "I am read - only"; // happens at compile time

Check the debugger, you can see before the first line executes that foo = null. Since it happens at load time, you can do this

public static readonly string foo = Something.StringThing();

so the value is set once, and it's done atomically so it is thread-safe.

Preprocessor Directives

#if DEBUG
 http://codeidol.com/csharp/essential-csharp/Operators-and-Control-Flow/Csharp-Preprocessor-Directives/
#endif

What about things in square brackets

That I can't type in a wiki, like "bracket CommandLine bracket"

When would I ever use a Struct?

Read the official documentation here.

How can I get traction using command line builds with C#?