C# is a multiparadigm, managed, garbage-collected object-oriented programming language created by Microsoft in parallel with the .NET platform
4
votes
2answers
299 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 ...
0
votes
1answer
72 views
What are the reasons for rebuild and redeployment libraries?
It's difficult to understand the meaning of the question from the topic's name.
Here is what I mean.
I'm watching Uncle Bob's Clean Code Episodes. In many episodes where he is talking about SOLID ...
2
votes
3answers
446 views
Microsoft's coding standards for ASP.NET controls
I cannot find any naming standards/conventions in MSDN for naming ASP.NET controls.
One of the following standards tends to be used by programmers:
lblAddress
AddressLabel
Address
According to ...
3
votes
1answer
309 views
How to prevent my executable being treated from AV like bad or virus?
I'm creating a piece of software, that will run on windows and will act like launcher for the game, to serve as an auto-updater and file verifier in client siede PC.
One thing I don't understand, why ...
2
votes
1answer
224 views
OOP when using a GUI Designer
I usually do database and web development but at the moment I'm learning desktop development with Mono and Gtk# using using the MonoDevelop IDE. I'm also using the Stetic GUI Designer inside ...
-5
votes
2answers
214 views
C# The Complete Reference by Schildt: does it matter about using an older edition? [closed]
So i'm learning C# and want to get really great book that I can rely on to gain my knowledge of the language from. I've picked C# The Complete Reference by Schildt. The first and second editions can ...
12
votes
3answers
385 views
Is there any real value in unit testing a controller in ASP.NET MVC?
I hope this question gives some interesting answers because it's one that's bugged me for a while.
Is there any real value in unit testing a controller in ASP.NET MVC?
What I mean by that is, most ...
1
vote
2answers
141 views
Restrictions Calling DLLs Across Technologies?
I want to call a DLL in my programming language of 'choice'. The documentation surrounding this clearly states that it must be a 32-bit DLL written in C, C++ or Delphi. But I wanted to call a DLL ...
1
vote
0answers
56 views
Steps to open source a small project [duplicate]
I've been working for a couple of years on a small project, almost by myself, with the eventual help of some colleagues. The project is getting out of my hands, because the size of the code is growing ...
0
votes
0answers
246 views
Making the case for .net [closed]
I work for a small company of about 10 developers. My boss considering dumping .net and moving over to java for new developments. His brother in law convinced him that windows server license cost is a ...
1
vote
1answer
125 views
Log design approach
Logging was always a nightmare for me! Now I have to implement it again for a proxy system.
In this proxy application, some systems ask proxy system to call some other services.
What I have to log is
...
1
vote
3answers
173 views
combining (something like) Flash in a windows form application
I know this is a place where people ask advice for designing code.
I am at a bit strange side on my coding quest, on one side people send me design stuff.
Special graphics and ideas on how they should ...
0
votes
1answer
166 views
How to turn a website into an offline usable directed graph for searching shortest ways between pages [closed]
I am an advanced-intermediate level student focused on the .NET and C#. I know all the basics as well as classes, methods, objects, inheritance, OOP principles and all that. Problem is we haven't ...
-5
votes
2answers
125 views
Where should I keep the central database and which database would be appropriate? [closed]
I am developing a gym software in C# as a window application but need to connect it to a central server so that people can install it on their PC's and connect to the same database. I want to package ...
12
votes
3answers
479 views
Brittle unit tests due to need for excessive mocking
I've been struggling with an increasingly annoying problem regarding our unit tests that we are implementing in my team. We are attempting to add unit tests into legacy code that wasn't well designed ...
-1
votes
1answer
275 views
Is Visual Basic worth learning? [closed]
I am a new c++ and Java programmer. I've been exploring other languages lately. Recently I installed visual studio 2012 and there were two possible languages that can be used. (c# and visual basic). I ...
0
votes
2answers
143 views
Implementing Context-based Undo/Redo Functionality
I'm currently implementing an undo/redo mechanism using the Command Pattern. Everything works so far. My problem now is to implement the undo/redo functionality in a way that it is bound to a given ...
0
votes
1answer
196 views
I/O interface for portable library
I'm writing a new .NET portable library that can read a file format, and file I/O is not available for portable libraries. The article "How to Make Portable Class Libraries Work for You" states that ...
5
votes
2answers
256 views
Which design pattern is illustrated by inheriting IStructuralComparable interface?
We know that some design patterns are found so useful that they become features of the language itself.
For instance, the interface IEnumerator which is implemented by Array object.
This helps in ...
5
votes
2answers
379 views
What could an algorithm look like that iterates through all combinations of two variables to aim at a certain number of entries?
For background information, see "Some background" further down.
I have a list that looks like this:
Start-Time-In-Seconds;End-Time-In-Seconds
1;2
4;6
12;15
...
This works together with a wave file ...
-5
votes
3answers
401 views
How is an IDE compiled?
I'd like to know the general procedure of how an IDE is built/compiled/created.
Additionally, what are some tools/scripts used to create an IDE?
I don't mean to say that compiling IDE needs an IDE. ...
7
votes
7answers
974 views
Prevent developers from using constants
I have one one software system which allows developers to specify an ID or name to create NodeReferences. Both work fine, but ID's are not guaranteed to be the same across different environments. I've ...
22
votes
4answers
702 views
Do not declare interfaces for immutable objects
Do not declare interfaces for immutable objects
[EDIT] Where the objects in question represent Data Transfer Objects (DTOs) or Plain Old Data (PODs)
Is that a reasonable guideline?
Up to now, I've ...
11
votes
1answer
341 views
Why does Resharper prefer “as” to “is”?
When I write code like this, where obj is a local variable:
if (obj is IMyInterface)
{
var result = (IMyInterface)obj;
// ....
}
Resharper offers to change it into code like this:
var result ...
3
votes
3answers
157 views
Web Project Class Architecture
I think this is a good question for here but I'm not 100% sure. Please flag if it's too vague.
I've worked on many websites where common framework classes are overridden.
Since I work mostly in ...
2
votes
2answers
217 views
Moving from local storage to a remote database: how should I cache the data locally?
I have a .NET (C#) application that I am releasing soon, which also has some support files. Right now I am storing those files as .txt files, and I update them as necessary whenever the application ...
-3
votes
1answer
194 views
Reinventing the wheel, or the technology that drives it? [closed]
I recently asked a question on StackOverflow that was related to string splitting and pattern matching in .NET.
Some beady eyed developers that viewed the question said: "It looks like you're trying ...
10
votes
5answers
634 views
What is the functional-programming alternative to an interface?
If I want to program in a "functional" style, with what would I replace an interface?
interface IFace
{
string Name { get; set; }
int Id { get; }
}
class Foo : IFace { ... }
Maybe a ...
5
votes
3answers
144 views
Index independent character comparison within text blocks
I have the following task: developing a program where there is a block of sample text which should be typed by user. Any typos the user does during the test are registered. Basically, I can compare ...
2
votes
2answers
417 views
Technology for C#, Windows, 2D game development? [closed]
I need a nudge in the right direction from someone more experienced in windows game development.
I want to write simple C# 2D windows game for fun (think something like old Sim City or Civilization). ...
7
votes
3answers
242 views
Is it safe to assume that one controller will only ever use one primary model?
So, I'm designing an MVC framework. In the name of keeping everything statically typed and non-magical, I've come to quite a problem with "automatically" passing models to a controller.
So, ...
6
votes
3answers
216 views
Building a string translation database for multiple (in-house) projects
At our company we have an existing translation ms-sql table wich stores strings like this:
Id | Key | Language | Value
1 | hello-world | nl-BE | Hallo Wereld
2 | hello-world | en-GB ...
0
votes
1answer
488 views
How do I create a .NET WebService for File Upload [closed]
I need to create a web service using the .NET platform for accepting file uploads. What are the options available for doing this in C#?
What is the best approach to use? Can please you provide me with ...
3
votes
1answer
130 views
Are Request/Response Parameter Wrappers Good Practice?
I've seen several different ways to design WCF services, and it seems some developers prefer parameter wrappers while others favor 'naked' parameters. To explain what I mean, consider the following ...
1
vote
1answer
102 views
Storage and naming of log data
I'm in the process of rewriting a small application from console mode to a GUI mode.
The input is a file with log data from a measuring device:
...
00029;00044;00076;00044;00021
...
4
votes
2answers
440 views
Use of `is` and `as` in multiple conditions
Quite recently, I thought about the use of as, is and direct cast in C#.
Logically, is it a better idea to use :
var castedValue = value as type;
if (null != castedValue)
{
// Use ...
1
vote
1answer
66 views
Storage Client Library 2.0 - Why is the API not as intuitive to use as 1.7?
I am migrating to using the new Storage Client Library for my Azure Table Storage.
Querying with the previous Storage Client Library 1.7 namespace:
var orders = serviceContext
...
2
votes
1answer
232 views
What kind of abstraction/SoC should I use here?
I am starting a new project, and I want to follow the separation of concerns pattern, and I have been reading on the topic, and now I am in doubt of how I should go about this.
Here is how I ...
7
votes
3answers
452 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 ...
8
votes
1answer
274 views
Unit testing on visualization (3D graphics) frameworks
This is a follow up to this question. There I was asking how to do unit testing when you have a library of scientific algorithms. I have a similar problem now but with a different project.
I'm ...
6
votes
3answers
762 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 ...
3
votes
3answers
277 views
Should I use abstract or virtual methods?
If we assume that it is not desirable for the base class to be a pure interface class, and using the 2 examples from below, which is a better approach, using the abstract or virtual method class ...
9
votes
3answers
459 views
Best way to unit test methods that call other methods inside same class
I was recently discussing with some friends which of the following 2 methods is best to stub return results or calls to methods inside same class from methods inside same class.
This is a very ...
5
votes
1answer
162 views
Unit testing for a scientific computing library
I've had a bit of experience with unit testing before, in what I call (not pejoratively) the classic software engineering project: an MVC, with a user GUI, a database, business logic in the middle ...
4
votes
3answers
389 views
Novel polymorphism - any reasons for this code?
As part of my work on a legacy C# application I've come across a novel (to me) use of an interface & concrete implementations. I can't think of any reason why you'd do the following, but I'm ...
1
vote
2answers
324 views
coding style for If condition [duplicate]
I came across below style of writing if statements in C#, on msdn code examples. Usually when I write if statements, the conditions I would write `(Customer != null)
I want to know if there is any ...
3
votes
7answers
269 views
Naming guard clauses that throw exceptions
I have a function evaluate() that parses a String for some variables and replaces them with their corresponding value:
public String evaluate() {
String result = templateText;
for ...
0
votes
1answer
186 views
How can my code structure be improved? [closed]
I am looking for advice on the neatest way to structure my code.
class Password
{
private string cipher;
Password(string cipher)
{
this.cipher = cipher;
}
public string ...
4
votes
3answers
216 views
How do ORM'S manage CRUD operations in multi thread environment
Suppose I have code which retrieves an object and modifies it and submits it via any ORM from a web application. Below is the pseudo code:
First request
var objCust = ...
3
votes
1answer
297 views
Should web service response use a base class or generic class?
In my RESTful WCF web service I have something like the following response object.
public class WebResponse<T>
{
public bool Success { get; set; }
public T Data { get; set; } ...

