Questions tagged [c#]

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

Filter by
Sorted by
Tagged with
6
votes
3answers
334 views

What is the best way to lead a team of 4-5 students for a summer project?

We're a bunch(4-5) of 3nd year college students about to begin our 3 months summer vacation and we would like to get going on a project. We want to make a game with XNA, it doesn't have to be big or ...
20
votes
2answers
7k views

Is C# actually a multiplatform language?

C# (and the .NET platform in general) is looking like it's becoming a good option form multi-targeting applications: official Microsoft .NET framework: full-blow Windows development, ASP.NET ...
2
votes
3answers
26k views

c# interview with a programming task [duplicate]

Possible Duplicate: How to prepare yourself for programming interview questions? I am going for c#-sql server job and I was looking for some link where I could download some questions and answers ...
5
votes
4answers
1k views

Shouldn't the lazy evaluation/execution be syntactically differentiated from eager evaluation/execution in C#?

We know about the deferred execution or lazy evaluation features introduced in C#. But at times, people become confused with them. Because there is no significant difference. You can only know if you ...
10
votes
2answers
5k views

How Do You Organize Your ASP.NET MVC 3 Applications? [duplicate]

The one thing that I am having a hard time figuring out with developing an extensible application platform in ASP.NET MVC 3 is how to modularize everything into an easy to update and distributable ...
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 ...
5
votes
4answers
1k views

Best approach for bidding a project

We basicly have project that always turn around the same pattern. But, it sometime happens that we have project that go absolutly at the opposite of what we usualy do. It become now more difficult to ...
9
votes
8answers
18k views

How to abbreviate variable names [closed]

I always struggle in abbreviating variable names. Is there any standard for abbreviating variable names?
53
votes
7answers
172k 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 ...
4
votes
6answers
2k views

3-Tier Object-Oriented Design Flaw?

I am going through training at my new job to use good object-oriented design with a 3-tier programming style. My supervisor says I have a design problem with my code: class Program { public ...
2
votes
4answers
442 views

Standardised Programming Techniques / Procedures

I don't know if this is a question, or a start of a conversation or even a completely irrelevant topic. Why isn't programming more standardised? Im really new to this and I find it hellish ...
1
vote
4answers
548 views

Is the link between C# programming language and music obvious for English native speaker?

French is my native language and I just realized that the # in C# is the same character as for the diese music character that raises a note by a half tone. Also, As I made my music elementary class ...
8
votes
1answer
414 views

Are there tasks which require significantly less work with Ruby than C# 4.0?

I just finished reading the Ruby chapter of the book 7 Languages in 7 Weeks. Aside from some syntactic sugar here and there I can't really see anything which can't be done with C# with a similar ...
1
vote
7answers
793 views

Quick OOAD Question

Given the following set of classes: Camera, Photo, Photoshoot, Subject. How would they interact to model the following sentence? The next subject is called and has their photo taken. I want to see ...
75
votes
9answers
67k views

Why use partial classes?

In my understanding, the partial keyword does nothing but allow a class to be split between several source files. Is there any reason to do this other than for code organization? I've seen it used for ...
21
votes
7answers
10k views

How do programmers deal with low level software development in high level languages?

I am somewhat new to programming and the best way I can ask this question is with an example. I know how to do basic things in Java and C#. Things like a small windows forms application or make a ...
2
votes
2answers
173 views

Code reviewing in the presence of strong type inference and basic editors

I’m curious to know how folks deal with comparative code reviews (version x against y of a file) in the presence of strong type inference, that is when ‘var’ (in C#) or ‘auto’ (in C++ 0x) is used in ...
4
votes
2answers
9k views

In MVC where do you put action methods for views in the shared directory?

I have a website built using a MVC.NET framework with C# that uses some shared views and partial views. In order to display the views properly there is a bit of code that must reside in the ...
1
vote
5answers
1k views

How do I get my open-source idea started? [closed]

I have an idea for an open source project. It's about building developing tools for software developers. Yet I have never joined a development team and now I don't know much about these teams except ...
15
votes
6answers
21k views

What naming Convention to Use for C# Function Parameters

There are situations when a name passed in Parameter will be Cast into a new type, but the name of the Passed object should remain similar. For the case of Class Attributes, we can use this operator, ...
7
votes
1answer
313 views

Should I let my users write BnfExpressions to extend my grammar?

Preface I'm designing a templating language (please skip the don't/why?? speech). One of the major goals of this language is to be extensible. There are 2 main elements in my language. "Tags" and "...
2
votes
3answers
922 views

What should I name these methods? [closed]

I have two interfaces, one with and one without generic type parameters. The non-generic interface is used internally so that I can store instances of the generic interface in a collection. All would ...
5
votes
7answers
3k views

Costs of Switching to Java [closed]

I'm a C# dev and I have plans of starting to develop apps targeting Android, which of course means Java. I have heard good things about Mono for Android and the idea of reusing my skill set is ...
14
votes
12answers
4k views

What is the regarded current best practises regarding the “this” keyword in front of field and methods in c#?

Unless it is needed to differentiate between a variable and field with the same name, I never put this. in front of a field or any member access in C#. I see this as no different to m_ prefix that ...
3
votes
2answers
1k views

Has anyone used a Stub in production code?

I have a situation where some procedure returns an object (kind of like a DTO) with a certain interface: interface ISomeInterface { string StringReadOnlyProperty { get; } int ...
11
votes
6answers
7k views

What are good reasons to use explicit interface implementation for the sole purpose of hiding members?

During one of my studies into the intricacies of C#, I came across an interesting passage concerning explicit interface implementation. While this syntax is quite helpful when you need to resolve ...
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?
9
votes
6answers
1k 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 ...
81
votes
6answers
19k 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 ...
9
votes
3answers
3k views

Is it recommendable to program .net apps with C++

From what I can understand, C# is the defacto language when coding .NET apps. Is it recommendable to program .NET apps [let that be ASP.NET, WinPhone 7, GUI, etc] in C++? What are the pitfalls and the ...
3
votes
3answers
1k views

C# Coding Standard - Position of Attribute in relation to Target

I had thought that this was one of the few solved problems in C# coding standards / style; Attributes always appear on the line above the thing to which they are applied a la [SomeClassAttribute] ...
3
votes
4answers
921 views

How do you remember encapsulation types for effective use?

I've been attempting to learn C#.NET for the past month or so, and the array of ideas that seems to always trip me up is encapsulation. As this is one of the three pillars of OOP, I feel that I am ...
0
votes
2answers
570 views

What is the most pragmatic & basic UI pattern to follow for Silverlight and/or WPF

Here is the context. The apps will: consume existing (and standard) web services. app is UI intensive (UI updated frequently and lot of data to display). development team experience level is average. ...
2
votes
2answers
901 views

What is the best way to store files when using winforms and web?

I have to develop an application (in C#) that has to work with files. The application consists of two versions: a web version and a windows version. Therefore, the files must be stored on a place ...
1
vote
3answers
2k views

Should I keep all my class definitions in the same class library?

I am starting to work with class libraries in my C# class. We were told to write code that can be used more than one time. Should I keep all my class definitions in one class library for the length of ...
7
votes
5answers
7k views

Learning Test Driven Development [closed]

If I want to learn TDD on my own, where would I start apart from the usual Google Search? Are there any books that you would recommend or any method that you followed to learn it on your own? I am ...
14
votes
1answer
18k views

Prefered way to declare events

I am fairly happy with my understanding of the .NET event model. I think I might be misunderstanding a small nuance of the system. When I started out putting events into my classes I would use the ...
30
votes
5answers
32k views

When and why you should use void (instead of e.g. bool/int)

I occasionally run into methods where a developer chose to return something which isn't critical to the function. I mean, when looking at the code, it apparently works just as nice as a void and after ...
3
votes
1answer
4k views

How to generate nonce for Ajax web requests

As many of you know WordPress uses "secret key" like thing for every AJAX request. Making each request unique and also 'somewhat' secure (just a step ahead than nothing). How would I implement the ...
3
votes
6answers
2k views

“As” Naming Convention [closed]

I'm experimenting with a naming convention I've devised and am seeking opinion. It involves the use of an "As" infix, and at this point I am envisioning it in the context of JavaScript, C# and C++ ...
20
votes
12answers
1k views

What makes documentation good? [duplicate]

I need to write documentation for several projects I worked on. I was wondering what, according to your experience, makes documentation useful and complete. What part should I include, how deep should ...
2
votes
2answers
326 views

An event that raises itself - is it too complicated?

I have a little problem. I'm writing a resource loading and caching system, in which user can request a resource, and set a callback to be called when resource is loaded (and/or wait for load to ...
6
votes
1answer
3k views

What would your DB Schema look like if you are building a Reddit/Digg-like site? [closed]

Just found out something rather interesting about Reddit's database schema: The way we’ve changed is we use an “open schema”. Sometimes it’s called “entity attribute value”. It’s basically a ...
3
votes
7answers
876 views

Is the rule of 10% code is comments still valid?

I've used some older languages before C# and I always felt the need to comment what I was doing so it is clear for anyone who reads the code. But now that I use C# decently, I often feel that it's a ...
17
votes
9answers
3k views

Will Java catch up with C#? [closed]

Today I posted a question asking about which language C# or Java would be better for me to study. I had some great answers. One thing that came up was that perhaps Java is now rather behind C# with ...
5
votes
7answers
485 views

Is there a way to play the role of Javascript with any other language like C#? [closed]

Is there a way to play the role of Javascript with any other language like C#? One way came up in my head is, having silverlight installed, using C# instead of Javascript for all the client side ...
0
votes
1answer
1k views

Building a table (DataGridView) while keeping decoupled from Model

I'll try to keep this simple. Small C# app, dialog based, one has a DataGridView. I've got an UpdateTable function in the form that accepts a DataSet and passes it to the DataGridView.DataSource. &...
11
votes
10answers
8k views

What is the point of properties?

Here are some arguments for properties and my counter-arguments: Easier to use than writing getter and setter methods Getter and setter method pairs are a code smell. Making it easier to write ...
10
votes
2answers
773 views

Which GOF design patterns are already implemented as first-class language features in C#?

(This question was closed on Stack Overflow due to being "too broad" and "not a real question" so maybe it's more appropriate here?) Inspired by this question. We know events are a language-level ...
4
votes
6answers
7k views

C# Unit Testing In A Single Project

Alright, so I'm doing my first "real" C# project. I'm chugging along, enjoying myself, nice little language I've got here, fairly easy to use, la ti da. Then I get to the point that I realize there'...