Questions tagged [.net]

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++.

Filter by
Sorted by
Tagged with
12
votes
11answers
12k views

Examples of operator overloading, which make sense [closed]

While I learning C#, I found that, the C# supports operator overloading. I have problem with good example which: Make sense (ex. adding class named sheep and cow) Is not an example of concatenation ...
12
votes
2answers
2k 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 ...
12
votes
2answers
8k views

Should classes, enums and other entities be placed in separate files?

My company's team lead\architect argues that a large-scale project is easier to understand if "entities connected by logic" are placed in one .cs file. I quote: "The whole structure of the logic and ...
12
votes
4answers
7k views

Is there a proper way to create a file format?

I'm building a proprietary file format for an application I wrote in C# .NET to store save information and perhaps down the line project assets. Is there a standard on how to do this in any way? I was ...
12
votes
4answers
10k views

Why does Microsoft still ship VBA within Office products, instead of integrating .NET directly? [closed]

I know that it's possible to call .NET code from your VBA code, but why does VBA continue to exist? The only reason I can think about is legacy. I just had to sort a Scripting.Dictionary and the ...
12
votes
4answers
4k views

Is it wrong to use flags for “grouping” enums?

My understanding is that [Flag] enums are typically used for things that can be combined, where the individual values aren't mutually exclusive. For example: [Flags] public enum SomeAttributes { ...
12
votes
7answers
186 views

What happens at [platform] user groups?

I'm a .NET developer, but I've never been to a .NET user group meeting or anything like that. I might have the opportunity soon to start attending one, but I'm wondering. What happens at user groups? ...
12
votes
4answers
3k views

How would I design an interface such that it's clear which properties may change their value, and which will remain constant?

I am having a design issue regarding .NET properties. interface IX { Guid Id { get; } bool IsInvalidated { get; } void Invalidate(); } Problem: This interface has two read-only ...
12
votes
6answers
3k views

any document which says exactly what range of numbers are .NET BigIntegers designed for?

I'm playing around with the .NET BigInteger and basically I'm wondering what number --an estimated answer would be fine-- is the point of deviation of the curve of (the graph of (increase of time ...
12
votes
2answers
12k views

Dependency injection with n-tier Entity Framework solution

I am currently designing an n-tier solution which is using Entity Framework 5 (.net 4) as its data access strategy, but am concerned about how to incorporate dependency injection to make it testable / ...
12
votes
2answers
13k views

Webkit as GUI in .Net/Mono

I want to make a cross platform application, which will also have a website where the desktop applications (Windows, iOS, Linux) will talk to the server and keep the users data in sync. So far the ...
12
votes
1answer
218 views

Is there any way to make a .Net library for Windows and Mac, with platform dependent references?

We're trying to develop a cross-platform app for desktops (Windows and Mac) using C#. The app contains a massive amount of platform dependent stuff and our team lead wants us to write all of that code ...
12
votes
2answers
562 views

Why do Unit Testing Attributes usually require public Methods?

I recently noted that adding [TestInitialize] to a protected method in a .NET assembly wasn't respected, but if I made the method public it was called by the unit test runner (Resharper in this case). ...
12
votes
3answers
2k views

Question on design of current pagination implementations

I have checked pagination implementations on asp.net mvc specifically and i really feel that there is something less efficient in implementations. First of all all implementations use pagination ...
11
votes
3answers
5k 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 ...
11
votes
10answers
9k views

How do I explain to non-programers what .NET is? [closed]

I don't work at a software company, and I'm one of a small handful of people in the company that know anything about programming. I spend a lot of time automating other programs that are used in the ...
11
votes
6answers
1k views

Which is more maintainable — boolean assignment via if/else or boolean expression?

Which would be considered more maintainable? if (a == b) c = true; else c = false; or c = (a == b); I've tried looking in Code Complete, but can't find an answer. I think the first is more ...
11
votes
4answers
20k views

What type of encoding can I use to make a string shorter?

I am interested in encoding a string I have and I am curious if there is a type of encoding that can be used that will only include alpha and numeric characters and would preferably shorten the number ...
11
votes
8answers
5k views

What is the market share of programs written in .NET nowadays? [closed]

We are currently migrating our Visual Basic 6.0 program to .NET. The target audience are just normal desktop users at home. Discussing this, we realized that we cannot come up with mainstream programs ...
11
votes
3answers
7k views

Why do we not prefix Enums, Abstract classes and Structs?

The C# community has so ubiquitously used the "I" prefix to denote an interface that even the most inexperienced programmers know to use it. Why is it then that we do not prefix enums, abstract ...
11
votes
3answers
8k views

Where should I draw the line between unit tests and integration tests? Should they be separate?

I have a small MVC framework I've been working on. It's code base definitely isn't big, but it's not longer just a couple of classes. I finally decided to take the plunge and start writing tests for ...
11
votes
5answers
7k views

What data structure should I use for this caching strategy?

I am working on a .NET 4.0 application, that performs a rather expensive calculation on two doubles returning a double. This calculation is performed for each one of several thousand items. These ...
11
votes
2answers
936 views

Why does F# Core define generic array types?

I just noticed that the FSharp.Core namespace includes generic array types of up to 4 dimensions, i.e. Core.[]<'T>, Core.[,]<'T>, etc. C# and VB seem to be doing just fine with System.Array - ...
11
votes
4answers
515 views

Does an iterator have a non-destructive implied contract?

Let's say I'm designing a custom data structure like a stack or a queue (for example - could be some other arbitrary ordered collection that has the logical equivalent of push and pop methods - ie ...
11
votes
3answers
697 views

How are hybrid VB6/.Net applications functioning in the Real World?

I am maintaining a VB6 application and we are studying how to migrate to .Net We are considering doing this gradually by implementing new features in COM visible .Net classes and migrating existing ...
11
votes
3answers
3k views

Storing n-gram data

I was hoping to brainstorm a little bit on the subject of storing n-gram data. In my project, I am trying to solve linguistic problems where I know all (n-1) data items and want to statistically guess ...
11
votes
3answers
1k views

Why don't mobile platforms support generational garbage collection?

Both Windows Phone/Xbox and Android lack support for generational garbage collection. This is frustrating for a lot of programmers. There seems to be a legitimate engineering reason to it, but I can't ...
11
votes
4answers
1k views

Virtualized Development Environments in Enterprise Networks

We are attempting to implement a development environment using virtualization for a small team of 4 developers within an enterprise organization. This would allow us to set up separate development, ...
11
votes
1answer
1k views

Does anyone have insight into whether MonoDroid is really dead?

My company just recently invested in the Mono for Android tools for Visual Studio as we have a lot of .NET developers and were impressed with how powerful the monodroid tools seemed. After reading the ...
11
votes
4answers
13k 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 ...
11
votes
3answers
382 views

Videos on Unit Testing [closed]

I've been searching for good presentations (slides+audio or video preferred) on Unit Testing but all I seem to find are books and blog posts. The presentation should not be longer than 50 minutes ...
11
votes
4answers
2k views

How far to go with unit tests

A question asked many times before but with a specific slant twds mvc development. I've been a very good boy and have been coding all my controller actions with corresponding unit tests which has ...
11
votes
2answers
710 views

.Net developer trying to learn ruby on rails

I am a .NET developer and I just had the chance to play with Ruby on Rails this weekend. In .NET we separate layers of the application by creating separate class library projects. From the design ...
10
votes
12answers
10k views

Is there a supported way to run .NET 4.0 applications natively on a Mac?

What, if any, are the Microsoft supported options for running C#/.NET 4.0 code natively on the Mac? Yes, I know about Mono, but among other things, it lags Microsoft. And Silverlight only works in a ...
10
votes
4answers
4k views

Learning path for web developer .NET or Java [closed]

I am interested to know how many real world web application servers are hosted by windows? I am going to learn C# and ASP.NET and want to convert my self from an embedded developer to a web app ...
10
votes
5answers
6k views

Why C# doesn’t support multiple inheritance?

Even if it could be bad practices, I would say that there is time that it would fulfill its purpose.
10
votes
3answers
1k views

Are XML Comments Necessary Documentation?

I used to be a fan of requiring XML comments for documentation. I've since changed my mind for two main reasons: Like good code, methods should be self-explanatory. In practice, most XML ...
10
votes
8answers
595 views

Why is Reflector such an essential utility?

Reading the brouhaha surrounding Reflector going paid got me thinking about the product and its uses. Many people seem to consider it an essential tool. I have to admit, I haven't used Reflector in ...
10
votes
5answers
797 views

What are some possible alternatives for providing an 'Admin Password' for a desktop application?

I'm currently managing and re-factoring a piece of software that has been used at my company for over a decade now. One of the elements of this application is a sort of admin or power-user mode which ...
10
votes
6answers
5k views

How to verify/prove orthogonality of a programming language?

I know the concept of orthogonality, but from a programming language point of view, is there a way to verify/prove it? For instance in C#, one can use public or static for a method signature. You can ...
10
votes
2answers
16k views

What is .NET framework backward compatibility?

We develop a windows application in .NET 4 with a database of MySQL. When we are about to deploy that application, we install the .NET 4 framework in our client, then when installing the .NET ...
10
votes
3answers
985 views

What's the reasoning behind the “I” prefix naming convention for interfaces in .NET?

I know the "I" convention has been around since COM, but I've never understood why it hasn't been reconsidered like every other naming convention before .NET has. Consumption wise, the only thing ...
10
votes
3answers
1k views

How are you using the Managed Extensibility Framework?

I have been working with MEF for about 2 weeks. I started thinking about what MEF is for, researching to find out how to use MEF, and finally implementing a Host with 3 modules. The contracts are ...
10
votes
6answers
978 views

What factors to consider when choosing runtime/language for Windows desktop applications?

My users all have Windows. Some of them use Linux or a Mac, but if they do they're generally capable of using something like Mono, Wine, Parallels or dual-boot. My development team (including myself) ...
10
votes
4answers
3k views

LINQ vs Data Access Layer

I've taught myself always to handle any data access code in a completely separate 'layer' to my business logic and UI code. This has always been a very good architecture for me and any 'rules' or best ...
10
votes
7answers
4k views

What is the difference between a prototype and a production level solution?

This question is purely for learning and to step-up my technical understanding. I know there is no perfect solution and this question has possible never ending solution list but I think it's very ...
10
votes
7answers
2k views

Is Entity Framework ready for production? [closed]

I'm looking into Entity Framework for a new project that I'm going to be taking on and as part of my research into it I'm asking some industry professionals if it's stable and ready for 'real world' ...
10
votes
6answers
971 views

Starting new project with TDD

I'm studying TDD and I read that it also helps you to define the design of the app, correct? So I decided to start creating a new project to help me understand it better. I want to create a simple ...
10
votes
3answers
4k views

How can I get started as a freelance programmer?

Assume that I know zero about freelancing, but I am a good .NET programmer. I want to start freelancing. How would I get started?
10
votes
5answers
12k views

Windows Service or Windows Task Scheduler?

I am planning to create a utility, which will query the database and store some information (on another table in the database). Its a multi-threaded utility and require to run for every 5 or 10 ...