Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c#]

C# is a multiparadigm, managed, garbage-collected object-oriented programming language created by Microsoft in parallel with the .NET platform

21
votes
9answers
3k views

How to teach Exception Handling for New Programmers? [closed]

How do you go about teaching Exception Handling to Programmers. All other things are taught easily - Data Structures, ASP.NET, WinForms, WPF, WCF - you name it, everything can be taught easily. With ...
6
votes
3answers
680 views

What benefits for the developer does the Ruby language offer that C# does not have?

What benefits for the developer does the Ruby language have that are not available in C# (preferably with code examples)?
11
votes
1answer
2k views

How would I unit test database logic?

I am still having a issue getting over a small issue when it comes to TDD. I need a method that will get a certain record set of filtered data from the data layer (linq2SQL). Please note that i am ...
6
votes
1answer
662 views

Workflow Foundation to separate data from business logic on a mid-sized App?

We are currently developing a .net app in WPF, that will be a desktop app with a good bit of data-access to local (and some remote) servers. The business logic here is very complex, and currently it ...
9
votes
6answers
5k views

Should I learn java for mobile application development or will C# just do?

I'm looking forward to delving into the .NET framework but most mobile applications seem to be developed in Java. I'll most probably be targeting the less pricier phones like Nokia and motorolla not ...
7
votes
3answers
3k views

What is the best practice for refactoring a static method in order to make it more testable?

Let's say you have a static method that looks something like this: public static bool Foo() { var bar = new Bar(); //do some stuff here } This method as it stands can be a real headache to ...
12
votes
5answers
2k views

Why have minimal user/handwritten code and do everything in XAML?

I feel the MVVM community has become overzealous like the OO programmers in the 90's - it is a misnomer MVVM is synonymous with no code. From my closed StackOverflow question: Many times I come ...
3
votes
1answer
201 views

FromXYZ vs Overloaded Method

I'm trying to think of the cleanest way to implement a couple of methods that open a file. Consider the following method signatures: public static DomainObject Load(Uri urlToFile) { /* downloads ...
6
votes
4answers
319 views

Is there a standard for when you include libraries or not?

I often come across a class which has a single reference to another library and was wondering if its better to include the library or to reference the object by it's full name. Is one better then the ...
13
votes
6answers
24k views

What should I include in my class documentation header

I'm looking for informative class documentation format for my Entity, Business Logic and Data Access classes. I found following two formats from here Format 1 ///------------------------------...
25
votes
5answers
8k views

MonoTouch vs Objective-C for iPhone/iPod/iPad development [closed]

For someone with .Net experience and wanting to develop for iPhone/iPod/iPad, is it worth learning Objective-C? Is MonoTouch a good alternative? What are some of the trade-offs when using MonoTouch vs ...
19
votes
11answers
41k views

Recommended .NET / C# coding standards? [closed]

What coding standards do you think are important for .NET / C# projects? This could be anything from dealing with curly braces and spacing and pedantry like that. Or it could be more fundamental ...
13
votes
4answers
1k views

What are some good practices when trying to teach declarative programming to imperative programmers?

I offered to do a little bit training in F# at my company and they seemed to show some interest. They are generally VB6 and C# programmers who don't follow programming with too much passion. That ...
48
votes
11answers
25k views

Why are /// comment blocks important?

Someone once said we should prefix all our methods with the /// <summary> comment blocks (C#) but did not explain why. I started to use them and found they annoyed me quite a bit, so stopped ...
82
votes
11answers
54k views

Is static universally “evil” for unit testing and if so why does Resharper recommend it? [closed]

I have found that there are only 3 ways to unit test (mock/stub) dependencies that are static in C#.NET: Moles TypeMock JustMock Given that two of these are not free and one has not hit release 1.0, ...
12
votes
2answers
2k views

Should we compile our website to a single dll, or a dll per page?

We're developing a new project that is to be deployed on a large number of client sites. The project contains a web-based GUI as one of it's "access points". Speed of the web interface is a priority ...
1
vote
2answers
247 views

Does anyone else feel that iterator syntax sugar is a must have in a modern language? [closed]

I work with C# professionally and I write code like this all the time. private IEnumerable<Something> GetAlotOfSomething() { if (somethingA.IsReady) yield return somethingA; if ...
18
votes
20answers
15k views

VB.Net vs C# debate [closed]

I've been in workplaces where, at the start of a project, the "Should we use VB.Net or C#" question has been raised. Granted, it's probably less common to have to make that decision now than it was ...
9
votes
10answers
13k views

Switch from C# to Java, which “gotchas” I should care?

I may have to switch to Java for new project. I have very little knowledge about Java, because I've mainly studied and used C#, and I'm afraid of the differences between these two language/platform ...
15
votes
5answers
6k views

What do you do when a client requires Rich Text Editing on their website?

As we all know by now, XSS attacks are dangerous and really easy to pull off. Various frameworks make it easy to encode HTML, like ASP.NET MVC does: <%= Html.Encode("string"); %> But what ...
28
votes
22answers
61k views

Why is VB so popular? [closed]

To me, Visual Basic seems clumsy, ugly, error-prone, and difficult to read. I'll let others explain why. While VB.net has clearly been a huge leap forward for the language in terms of features, I ...
20
votes
10answers
4k views

Best Practices and Etiquette for Setting up Email Notifications

If you were going to set up a Email Alerts for the customers of your website to subscribe to, what rules of etiquette ought to be followed? I can think of a few off the top of my head: Users can Opt-...