The .NET Framework is a software framework for Microsoft Windows operating systems. It includes an implementation of the Base Class Library, Common Language Runtime, and Dynamic Language Runtime. It supports many programming languages, including C#, VB.NET, F# and C++.

learn more… | top users | synonyms

45
votes
16answers
15k views

Why use an OO approach instead of a giant “switch” statement?

I am working in a .Net, C# shop and I have a coworker that keeps insisting that we should use giant Switch statements in our code with lots of "Cases" rather than more object oriented approaches. His ...
21
votes
7answers
2k views

How to Avoid Fragile Unit Tests?

We have written close to 3,000 tests -- data has been hard coded, very little reuse of code. This methodology has began to bite us in the ass. As the system changes we find ourselves spending more ...
100
votes
8answers
82k views

How do you organize your projects? [closed]

Do you have any particular style of organizing projects? For example, currently I'm creating a project for a couple of schools here in Bolivia, this is how I organized it: TutoMentor (Solution) ...
161
votes
10answers
22k views

Mono is frequently used to say “Yes, .NET is cross-platform”. How valid is that claim? [closed]

In What would you choose for your project between .NET and Java at this point in time? I say that I would consider the "Will you always deploy to Windows?" the single most important technical decision ...
19
votes
11answers
22k 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 ...
51
votes
8answers
21k views

Return magic value, throw exception or return false on failure?

I sometimes end up having to write a method or property for a class library for which it is not exceptional to have no real answer, but a failure. Something cannot be determined, is not available, not ...
21
votes
7answers
781 views

Does making source code available affect your ability to generate revenue?

We’re working on a .Net framework which ultimately amounts to a single DLL. We intend to charge for commercial use of the framework, but make it free for open source/non-commercial use. The rough ...
15
votes
7answers
659 views

How do you structure your shared code so that it is “re-findable” for new developers? [duplicate]

I started working at my current job about 8 months ago, and its been one of the best experiences I've had as a young programmer. It's a small company, and both my co-developers are brilliant guys. ...
10
votes
3answers
2k views

Why are CIL and CLR required in .NET?

I saw this nice image here. I learned that all the compilers that support .net language convert the source code to CIL format. Now Microsoft is never bringing in .NET for all the operating system by ...
66
votes
6answers
13k views

When to go Fluent in C#?

In many respects I really like the idea of Fluent interfaces, but with all of the modern features of C# (initializers, lambdas, named parameters) I find myself thinking, "is it worth it?", and "Is ...
11
votes
2answers
9k views

Multiple applications in a single Visual Studio solution [closed]

I am doing work for a company that is wanting to put all their .Net applications (web applications, Windows applications and console applications) together in a single Visual Studio solution. I am ...
2
votes
1answer
2k views

How to handle exception in REST API

Given a REST API, which throws an exception when handling a request from a client. Whenever the REST API throws an exception, it's logged and the application (in this case a console application) ...
10
votes
7answers
3k views

Is throwing an exception from a property bad form?

I've always been of the mindset that properties (ie, their set/get operations) should be fast/immediate and failure-free. You should never have to try/catch around getting or setting a property. But ...
5
votes
1answer
2k views

Knowledge Transfer and software development [duplicate]

I have been working on an application alone for several years. I am now asked to transfer knowledge to a few other developers, which I think is a good idea because it will allow us to share the ...
9
votes
10answers
10k 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 ...
46
votes
5answers
15k views

As a C# developer, would you learn Java to develop for Android or use MonoDroid instead? [closed]

I'd consider myself pretty well versed in C#. It's my language of choice at the moment, and it's where basically all my professional experience lies. Still, I'm puzzled by the existence of the ...
13
votes
9answers
10k views

Are too many if-else statements for validation bad? [duplicate]

From the book Professional Enterprise .Net, which has 5 star rating on Amazon that I am doubting after having a read through. Here is a Borrower class (In C# but it's pretty basic; anyone can ...
18
votes
20answers
11k 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 ...
12
votes
6answers
9k views

What would you choose for your project between .NET and Java at this point in time? [closed]

You are just starting a new project and you have these two technologies to choose from, Java and .NET. The project you are working doesn't involve having features that would make it easy to choose ...
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 ...
14
votes
10answers
867 views

How do you normally layout a class's regions?

I was wondering if there was a standard for laying out a class's regions. I currently use Fields Constructor Properties Public Methods Private Methods Fields being Private Properties and ...
6
votes
3answers
4k views

Is it bad practice to use public fields? [duplicate]

Possible Duplicate: When are Getters and Setters Justified Why are public and private accessors considered good practice? In my time as developer I learned that properties can be very useful....
9
votes
3answers
2k views

.NET Dependency Management Systems

I have some .NET projects that are starting to get large enough to merit looking into Dependency Management solutions, so we don't have to copy binaries from one project to another. Here's what I've ...
22
votes
5answers
4k views

Is my usage of explicit casting operator reasonable or a bad hack?

I have a big object: class BigObject{ public int Id {get;set;} public string FieldA {get;set;} // ... public string FieldZ {get;set;} } and a specialized, DTO-like object: class ...
7
votes
1answer
1k views

if I use .NET Framework for my application, do I have to pay anything to Microsoft?

I am planning to develop an enterprise application using .NET Framework. I will sell that application to other companies. Do I have to make any payment to Microsoft, like royalties or something else?
4
votes
7answers
2k views

What is the objective of unit testing? [duplicate]

Possible Duplicate: Is unit testing or test-driven development worthwhile? I've been working with C# for the last 2 years, and I've never done any unit testing. I just need to know what the ...
5
votes
7answers
1k views

Is using a lot of free third party libraries a good thing? [closed]

For your proprietary projects at work? Problems I can imagine are: more dlls (can be a problem when for example you have to include a big DLL but you only need few functions in that library), a lot ...
3
votes
6answers
1k views

How to include database changes during application publish

I am maintaining a WinForms application, which talks to a SQL Server database. Sometimes I have to change database schema (for example to alter a sql procedure or add new one). For this purpose I have ...
3
votes
6answers
1k views

Why isn't the line count in Visual Studio zero-based? [closed]

This just struck me as an oversight by Microsoft. Since arrays and other data-structures within the .NET framework begin from zero (zero-based) why don't we have a line 0 within the code view in ...
-1
votes
1answer
326 views

Designing XML - confused between attributes and elements [closed]

I have to design an xml structure to set standard data exchange with my client. We deal with payments and its related data. At now, my XML data looks like this: <PAYMENTS> <CURRENCY>...
107
votes
7answers
170k views

Relationship between C#, .NET, ASP, ASP.NET etc [closed]

I'm really unclear on the difference between C#, C#.NET and the same for ASP and other '.NET' languages. From what I understand, .NET is a library/framework of... things. I think they're essentially ...
116
votes
1answer
16k views

Effective Strategies for Localization in .NET [closed]

I am developing the UI for a .NET MVC application that will require international localization of all content in the near future. I am very familiar with .NET in general but have never had a project ...
34
votes
13answers
30k views

Career advice: stay with PHP or start a new career in something else ( .Net?) [closed]

I'm planning on moving to NY in 6-12 months tops, so I'm forced to find a new job. When I'm planing to start my life in another city it's also probably a good time to think about career changes. I've ...
66
votes
13answers
7k views

My boss has a bad case of “Not Invented Here” [closed]

My department specializes in converting customer data into our database schema so that they can use our software. Right now, we have C# applications that take an IDataReader (99% of the time it is a ...
49
votes
11answers
4k views

I don't understand how TDD helps me get a good design if I need a design to start testing it

I'm trying to wrap my head around TDD, specifically the development part. I've looked at some books, but the ones I found mainly tackle the testing part - the History of NUnit, why testing is good, ...
32
votes
8answers
2k views

S.O.L.I.D., avoiding anemic domains, dependency injection?

Although this could be a programming language agnostic question, I'm interested in answers targeting the .NET ecosystem. This is the scenario: suppose we need to develop a simple console application ...
18
votes
13answers
25k views

What are the practical uses of Windows Services? [closed]

I am new to working with Windows Services. Although I have learnt to create Windows Services in VS2010 I would like to know some practical ways in which windows services could be used? I tried ...
18
votes
3answers
27k views

Best design for Windows forms that will share common functionality

In the past, I have used inheritance to allow the extension of Windows forms in my application. If all of my forms would have common controls, artwork, and functionality, I would create a base form ...
26
votes
6answers
56k views

.NET Properties - Use Private Set or ReadOnly Property?

In what situation should I use a Private Set on a property versus making it a ReadOnly property? Take into consideration the two very simplistic examples below. First example: Public Class Person ...
24
votes
17answers
5k views

Does Silverlight have a future? [closed]

Recently I have read some articles/blogs/comments about the development and history of WPF and Silverlight. In some forums many developers and users criticize the performance of WPF applications (for ...
4
votes
8answers
2k views

What do you consider to be the essential design patterns? And do you use them? [closed]

It seems to me that programmers have an increasingly uphill task of staying up-to-date. In my efforts to improve my programming ability, I am in search of the essential design patterns that are ...
21
votes
7answers
10k views

Best practices for moving large MS Access application towards .Net?

We have a really huge MS Access application developed in-house initially for our personal needs which then was turned into a commercial software and successfully sold. The software is a sort of "all-...
8
votes
2answers
1k views

How to Implement Error Handling [closed]

Even though I've programmed on a professional level for some years I still do not fully understand error handling. Although my applications work fine, the error handling isn't implemented at a ...
28
votes
7answers
4k views

Why do .Net books talk about stack vs heap memory allocation?

It seems like every .net book talks about value types vs reference types and makes it a point to (often incorrectly) state where each type is stored - the heap or the stack. Usually it's in the first ...
17
votes
9answers
2k views

Constraints in a relational databases - Why not remove them completely?

Is there any reason to build constraints between tables (inside SQLserver) nowadays? If so, when? Most applications in my area are built on object principles and tables are joined on demand. Demand ...
31
votes
4answers
5k views

Why does F# have an interactive mode but not C#?

F# comes out of the box with an interactive REPL. C# has nothing of the sort and is in fact kinda difficult to play around without setting up a full project (though LINQpad works and its also possible ...
12
votes
7answers
1k views

What constitutes proper use of threads in programming?

I am tired of hearing people recommend that you should use only one thread per processor, while many programs use up to 100 per process! take for example some common programs vb.net ide uses about 25 ...
9
votes
4answers
10k views

Business Objects within a Data Access Layer

So I've been creating a data access layer via TDD and have approached somewhat of a concern. I'd rather not start down the wrong path, so I figured I'd ask you guys to see if my thoughts were in line ...
9
votes
1answer
447 views

Naming of related classes and interfaces

I have created an ObjectParser class which parses data into strongly typed objects using an IObjectParserDataSource as the data source (the data could be an Excel file, text file, array, query string, ...
8
votes
6answers
950 views

Would you re-design completely under .Net?

A very extensive application began as an Access-based system (for database storage). Forms were written in VB5 and/or VB6. As .Net became a fixture in the development community, certain modules have ...