C# is a multiparadigm, managed, garbage-collected object-oriented programming language created by Microsoft in parallel with the .NET platform
0
votes
3answers
159 views
How is an IDE compiled?
What procedures are used to compile an IDE? For instance, Visual Studio 2012 is written in both C++ and C#, while Eclipse is written in Java. So then, is Visual Studio 2012 compiled from Visual Studio ...
-1
votes
0answers
34 views
Are there any C# libraries to assist in CRD and BSA anti money laundering reporting? [closed]
I'd like to automate BSA and CRD reporting as much as possible to FinCEN and other relevant agencies.
Is there any reliable C# program that can assist in creating and submitting the batches?
Are ...
6
votes
7answers
645 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 ...
18
votes
4answers
241 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 ...
8
votes
1answer
241 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 ...
1
vote
0answers
22 views
Is there a way in asp.net web api / mvc to use a context model coming from a referenced dll? [migrated]
I just want to know if it is possible to use a context in asp.net web-api / mvc that was coming from a referenced DLL file. Because what I did here was that I created a separate project library for my ...
-3
votes
0answers
67 views
What skill set and experience are required of C# developers to break into sectors like Banking, Telecom, and Financial? [closed]
I have around 10 years software development experience, and 7 years in C#, The Official Microsoft ASP.NET Site, The Official Microsoft ASP.NET Site MVC, SQL Server, MySQL , TDD, IoC, WCF, and other ...
-5
votes
0answers
123 views
Carreer opportunities for A C++ developer : should I go for Java or C#? [closed]
I'm a 5 years experienced software developer, but I basically only know how to program in C and C++.
I would like to expand my knowledge to another "main" language, because I often find myself ...
-6
votes
0answers
51 views
Read words that are bold and Italic from word document using c# [closed]
I have no idea how to separate bold and italicized words from normal words.
Can any one suggest how to identify bold and italic words using C#?
Here is what I have so far:
foreach (Word.Paragraph ...
3
votes
3answers
75 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 ...
-1
votes
0answers
10 views
C# Windows Store APP -> Get all types of all assemblies [migrated]
in good old normal ... .net i did this:
List<Assembly> loadedAssemblies = new List<Assembly>
{
Assembly.GetCallingAssembly(),
...
2
votes
2answers
35 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 ...
0
votes
0answers
30 views
Interpretation requested [migrated]
Can someone kindly point me to an explanation, if there is one, to this chunk of code and what it does and why? Specifically the bottom line...
protected uint uMask;
int nBits = ...
-4
votes
2answers
158 views
Advice about Learning C# [closed]
I was an accomplished programmer in Microsoft Basic and Clipper5 (dBaseIII kinda) under DOS and I’m pretty good with XML, I suppose.
I want to get into Visual C# to write some business software but I ...
0
votes
0answers
18 views
C# color conversion CMYK - RGB - Lab with WCS by using a ICC Profile [migrated]
Since last week I try to use the Windows Color System for my color conversion. By the conversion from CMYK to RGB i get the correct values:
// Example CMYK - VALUES with 0
float[] cmykValues ...
-3
votes
1answer
162 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
541 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 ...
4
votes
2answers
60 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
167 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). ...
6
votes
3answers
190 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
169 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 ...
-1
votes
1answer
134 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
51 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
81 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
321 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
47 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
118 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 ...
6
votes
2answers
251 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 ...
3
votes
1answer
118 views
Rosyln versus T4 for code generation [closed]
So I have a lot of knowledge invested in T4. I've wrote a few code generators of varying complexity and generally love it with the caveat of code-generating-code being difficult to unit test(but I ...
8
votes
1answer
172 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 ...
5
votes
3answers
175 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
198 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
176 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
109 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
356 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
249 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
215 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
152 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
140 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
70 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; } ...
3
votes
2answers
203 views
I need advice developing a sensitive data transfer/storage/encryption system
I got closed on SO and told to post this here as it's about general application design as opposed to specific code.
Intro
I'm currently working on a project which involves the daily extraction of ...
3
votes
2answers
96 views
Domain Services as facades
I read .NET Domain-Driven Design with C#: Problem - Design - Solution and I noticed that the author created a domain service for each aggregate root.
However, the domain services were only facades to ...
0
votes
1answer
140 views
Is C# namespace should be Project-Name?
I am working with multiple websites (freelancer) and a good amount of them I write using C# MVC4.
I created a very good boilerplace project that I plan to use on every next starting mvc4 application ...
2
votes
3answers
118 views
Is it possible to get dynamically generated html in asp.net tags using HTTP Modules?
I want to know if it is possible to write to a log/text file dynamically generated HTML in asp.net tags in an .aspx page using HTTP modules.
By dynamically generated HTML, I mean the html content ...
3
votes
1answer
47 views
How to best distribute client specific configuration settings
I'm writing a WinForms desktop application which will be shipped out to several different clients and am wondering what the best way to implement a user configuration file is. Normally I would use the ...
4
votes
3answers
320 views
Is there a cleaner way of caching data
We've started implementing some caching code in our MVC project. We've derived from .Net's ObjectCache to store it in a SQL database.
What we do right now is in each method we want to cache we have ...
7
votes
2answers
314 views
Why do we need the async keyword?
I just started playing around with async/await in .Net 4.5. One thing I'm initially curious about, why is the async keyword necessary? The explanation I read was that it is a marker so the compiler ...
3
votes
7answers
333 views
Should object oriented programming be the first thing students learn? [closed]
My high school is starting a program where, instead of following the 'traditional' method of teaching programming (learning variables, then operations, loops, methods, and finally OOP), students are ...
10
votes
4answers
417 views
Always pull out common cases and branch separately? [duplicate]
We had a disagreement in a code review.
What I had written:
if(unimportantThing().isGood && previouslyCalculatedIndex != -1)
{
//Stuff
}
if(otherThing().isBad && ...
3
votes
1answer
194 views
The array class in C# - Implementation questions
I am studying the Array class in C#. The following is the implementation of System.Array class:
[SerializableAttribute]
[ComVisibleAttribute(true)]
public abstract class Array : ICloneable, IList, ...