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
18
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 ...
18
votes
1answer
6k views

Why did Microsoft dropped the RESX model for RESW in Windows Store applications?

Why did Microsoft choose to change the resources management system from .NET's RESX files? RESX had useful code generation, providing developers auto-completion for resources names and outputting ...
18
votes
5answers
3k views

Are there well-known PowerShell coding conventions?

Are there any well-defined conventions when programming in PowerShell? For example, in scripts which are to be maintained long-term, do we need to: Use the real cmdlet name or alias? Specify the ...
17
votes
6answers
18k views

PHP and performance

I always hear that PHP is for medium and small websites whereas .NET and Java for enterprise applications. My question is about PHP. Why is PHP not a good option for enterprise web applications? Is it ...
17
votes
10answers
987 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 ...
17
votes
5answers
5k views

What does Windows 8 mean for the future of .NET? [closed]

Microsoft showed off a demo of Windows 8, including a new platform that allows developers to use HTML5 and JavaScript. Is this new platform the main way to develop for Windows 8? Is Microsoft ...
17
votes
2answers
16k 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 ...
17
votes
2answers
2k views

Is IronScheme complete enough or stable enough to be worth learning?

IronScheme is mentioned on Wikipedia as a successor to a failed project called IronLisp, bringing Lisp to CLR and .NET, the way Clojure does for the JVM. Does anyone have experience with this language?...
17
votes
7answers
803 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. ...
17
votes
1answer
9k views

Why do Microsoft's libraries depend on Newtonsoft.Json?

This had probably started way back when Microsoft created ASP.NET Web API library, at least that's when I remember it if I am not mistaken. Anyway, since then, its HTTP packages started depending on ...
17
votes
2answers
1k views

Is DDD-Lite a pattern language for dependency injection?

I stumbled upon Greg Young's talk 7 Reasons why DDD Projects Fail where he mentions something he calls DDD-Lite at 7:20. Summarizing, he basically says some use DDD as a pattern languages (entities, ...
17
votes
3answers
11k views

MVVM, DDD, and WPF Layered Application Project Structure Guidance

I am trying to setup my application's structure in VS and I want to "try" and future proof it to a reasonable level. This application will be a WPF re-write of an old Winform app that had followed no ...
16
votes
8answers
23k views

Senior Interview LINQ questions [closed]

I'm preparing a LINQ section in interview questions for senior programmers. What are the most interesting questions in LINQ to include? And why?
16
votes
11answers
4k views

Why all classes in .NET globally inherits from Object class?

Its very interesting for me which advantages gives "global root class" approach for framework. In simple words what reasons resulted the .NET framework was designed to have one root object class with ...
16
votes
3answers
1k views

What is the reasoning behind naming of the .NETs Select (Map) and Aggregate (Reduce)?

In other programming languages, I have seen Map and Reduce, and those are cornerstones of functional programming. I could not find any reasoning or history why LINQ has Aggregate (same as Reduce) and ...
16
votes
6answers
871 views

Methods of debugging code (Nightmare situation)

I am frequently tasked with debugging an application at my job. It is a BI Application that we deploy to businesses, which includes a test environment, and a production environment. I am wondering if ...
16
votes
6answers
32k views

Is it possible to use C++ with the .NET framework?

I've read many comments about GUI programming, in both, C# and C++. And I noticed that Microsoft's .NET framework is powerful for GUI programming. So is it possible to use C++ and .NET framework? I ...
16
votes
6answers
6k views

Convert from Procedural to Object Oriented Code

I have been reading Working Effectively with Legacy Code and Clean Code with the goal of learning strategies on how to begin cleaning up the existing code-base of a large ASP.NET webforms application. ...
16
votes
3answers
16k views

BackgroundWorker vs. Async/Await

I am new to C# development and wish to create a more responsive UI. In my preliminary research, I have seen two methods for achieving this: Multi-threading in conjunction with the BackgroundWorker ...
16
votes
5answers
570 views

Are my team's processes out of control?

I'm a software dev team leader (I recently took control of a new team), and ultimately responsible for maintaining high productivity, good quality and organized priorities. I have 6 senior developers ...
16
votes
2answers
6k views

What are the main practices and design patterns every .NET guy should know? [closed]

In my brief time as a professional programmer I've seen lots of applications written by programmers who's entire education appears to have been reading the first couple of chapters in a .NET 2.0 book. ...
16
votes
3answers
2k views

Which .NET REST approach/technology/tool should I use?

I am implementing a RESTful web service and several client applications that are mostly in Silverlight. I am finding a litany of options for developing both the server-side and client-side of the API ...
15
votes
3answers
6k views

How many are too many nested function calls?

Quoted from MSDN about StackOverflowException: The exception that is thrown when the execution stack overflows because it contains too many nested method calls. Too many is pretty vague here. How ...
15
votes
7answers
4k views

Use of NotImplementedException

Is it considered bad practice to throw NotImplementedException for code you haven't written yet? Possibly TODO comments would be considered safer?
15
votes
6answers
799 views

Introducing functional programming into your development environment [closed]

This is a long story but I will try to summarize it as best I can. We are a .NET shop that writes software for a variety of different types of funds. For example, we write health claims management ...
15
votes
1answer
1k views

How long was Microsoft working on .NET before they released it?

With the whole CLI, CTS, CLS, etc., not only did they release a powerful platform/infrastructure, but they released all the specs that describe it etc. It supports potentially infinite myriad ...
15
votes
1answer
11k views

Why did Microsoft abandon IronRuby and IronPython? [closed]

Several years ago, Microsoft announced that Ruby and Python were coming to .net. The projects were called IronRuby and IronPython, respectively. Microsoft said that the projects would be built on ...
14
votes
6answers
37k views

Difference between “String” and “string” in .NET and which is best?

In the .NET Framework, at least in the C# language, we have two "versions" of the string type: "string" "String" It appears that they are interchangeable, but are they really? If they are not ...
14
votes
4answers
1k views

Is Java to Linux what .NET is to Windows? [closed]

Is Java becoming the de facto standard from Linux application development in the same way .NET is the standard for Windows application development? If not why not?
14
votes
3answers
11k views

What is the benefit to having pure POCO models?

What is the major benefit of having pure POCO models? I get that Models should be clean and simple, but I tend to like to keep the maintenance of child objects within the model classes. For example ...
14
votes
4answers
9k views

Shortcomings of using dynamic types in C#

I have been recently studying more on the dynamic types in C#. With some examples I understood once the code is compiled, it does not need to be recompiled again but can be executed directly. I feel ...
14
votes
4answers
18k views

Should one use Dependency Injection even if the class is used only once? [duplicate]

During a code review I have started having a bit of a dilemma as to whether use dependency injection or not. I would like to hear your thoughts, because this is kind of an ongoing theme and would help ...
14
votes
4answers
12k views

Will the Database connection be closed if we yield the datareader row and not read all the records?

While understanding how yield keyword works, I came across link1 and link2 on StackOverflow which advocates the use of yield return while iterating over the DataReader and it suits my need as well. ...
14
votes
16answers
1k views

Should a c# dev switch to VB.net when the team language base is mixed?

I recently joined a new development team where the language preferences are mixed on the .net platform. Dev 1: Knows VB.net, does not know c# Dev 2: Knows VB.net, does not know c# Dev 3: Knows c# and ...
14
votes
4answers
421 views

Should consistency be favoured over programming convention?

When designing a class should consistency in behaviour be favoured over common programming practice? To give a specific example: A common convention is this: If a class owns an object (e.g. it ...
14
votes
2answers
5k views

Why use a generic method with a type constraint instead of the type itself?

In a different StackExchange question, I noticed someone using this prototype: void DoSomething<T>(T arg) where T: SomeSpecificReferenceType { //Code.... } Bearing in mind there is only a ...
13
votes
9answers
17k 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 ...
13
votes
6answers
10k 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 ...
13
votes
5answers
13k views

Refactoring constructor that has too many parameters [duplicate]

I'm in my first two months as a software engineer and just wanted to get advice on if this can be improved upon. I've created a class that represents data from RFID in the form of a message: class ...
13
votes
7answers
2k 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 ...
13
votes
5answers
7k views

Just how bad is it not to Dispose() SqlConnections?

Personally, I break out in hives if I don't put ADO objects that implement IDisposable in using statements. But at my current contract, I've found that their homegrown enterprise framework "data ...
13
votes
7answers
7k 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 ...
13
votes
4answers
45k views

What are the differences among the .NET certification exams? [closed]

I am a .NET developer using WPF and ASP.NET MVC and I was hoping to pass some kind of certification exam. There seems to be four exams but I am unable to understand what the differences are even ...
13
votes
5answers
16k views

How to ensure a single coding standard in .NET with tool support

Probably, the basic situation is familiar to everyone. You have agreed on certain coding standards in your team and now it is time to make sure that everybody follows them. Some do it via heavy ...
13
votes
3answers
1k views

Is using unit tests to tell a story a good idea?

So, I have an authentication module I wrote some time ago. Now I'm seeing the errors of my way and writing unit tests for it. While writing unit tests, I have a hard time coming up with good names and ...
13
votes
2answers
6k views

Isn't CQRS overengineering?

I still remember good old days of repositories. But repositories used to grow ugly with time. Then CQRS got mainstream. They were nice, they were a breath of fresh air. But recently I've been asking ...
13
votes
2answers
8k views

Should I swap from WCF to NserviceBus

We have a central server that sends and recieves messages from a number of PCs that are located on client networks in various locations. To facilitate this, currently I'm using WCF with TCPNetBindings,...
13
votes
2answers
5k views

Why is the Repository pattern needed in NHibernate?

I am reading the official Your first NHibernate based application. While the tutorial is good and easy to follow, I am wondering why the Repository pattern is used. In the various Add, Update, ...
13
votes
3answers
3k views

What is the best way to structure and name files which contain generic classes with the same name?

In my current project I have come across the requirement to create generic classes with the same name, but different numbers of generic parameters. For example: MyClass<T1> MyClass<T1, T2&...
13
votes
3answers
10k views

Microsoft's current best practices for building a .NET data tier? And reality?

The development team I'm working with will be moving to .NET 4.0 soon, however, the data access class library we use still uses ADO.NET "classic", meaning SqlDataReader, DataTable, and the like. ...