Questions tagged [design-decisions]

general tips and guidelines for designing better applications, regarding APIs, Architecture and internal structures.

103 questions
39
votes
9 answers

When should I not use the ThreadPool in .Net?

When should I not use the ThreadPool in .Net? It looks like the best option is to use a ThreadPool, in which case, why is it not the only option? What are your experiences around this?
Vaibhav
  • 11,067
  • 11
  • 48
  • 70
35
votes
7 answers

Is it wrong to use the hand cursor for clickable items such as buttons?

I've always thought the hand cursor to be the ideal visual indicator for "you may click here" to the user. We are used to see it in this context daily because of it's usage on hyperlinks and hence all web buttons.                   However, most…
27
votes
1 answer

.NET Tuple and Equals performance

This is something I had not noticed until today. Apparently, the .NET implementation of the much used tuple classes (Tuple, Tuple etc) causes boxing penalties for value types when equality based operations are performed. Here is how the…
nawfal
  • 62,042
  • 48
  • 302
  • 339
16
votes
3 answers

Design decisions: Why and when to make an interface private?

Are private interfaces ever used in design decisions ? If so, what are the reasons and when do you know the need for a private interface?
Jon
  • 161
  • 1
  • 1
  • 3
15
votes
2 answers

Why are System.Drawing Rectangle, Point, Size etc mutable structs and not classes?

Is there a reason Microsoft decided to make these structs? All three are mutable. I would find them much easier to deal with if they were either immutable, or if they were reference types. If there are reasons they must be structs, why are they…
Flash
  • 13,804
  • 11
  • 65
  • 91
9
votes
6 answers

IdbConnection vs. SqlConnection

When I write an app, I use the System.Data interfaces (IDbConnection, IDbCommand, IDataReader, IDbDataParameter, etc...). I do this to reduce vendor dependencies. Unless, I'm doing a simple test app, it just seems like the ethical thing to do when…
John MacIntyre
  • 12,653
  • 12
  • 62
  • 102
8
votes
1 answer

How are IEEE-754 single and double precision formats determined?

I'm interested in how these are determined: Single precision has: 8 bits for e and rest (23 bits) are mantissa Double precision: 11 bits for e and rest (52 bits) are mantissa ofc there is 1 bit for sign. So how is it determined what number of bits…
8
votes
3 answers

Why Array#slice and Array#slice! behave differently?

I could not understand why, in Ruby, Array#slice and Array#slice! behave differently than Array#sort and Array#sort! (in the way that one returns the results on a new Array and the other works on the current object). With sort the first one…
Vargas
  • 1,940
  • 2
  • 30
  • 51
7
votes
5 answers

What scripting language for our .NET based IDE?

We have an IDE for machine automation that allows its users to develop solutions by connecting objects and components visually. They can also write "plugins" using C++ and C#. The IDE is written using .NET. Its users often are not founded in…
bitbonk
  • 45,662
  • 32
  • 173
  • 270
7
votes
3 answers

Windows Services -- High availability scenarios and design approach

Let's say I have a standalone windows service running in a windows server machine. How to make sure it is highly available? 1). What are all the design level guidelines that you can propose? 2). How to make it highly available like…
6
votes
8 answers

Bad design decision to throw an exception from an accessor?

I have read some answers re the pro's and con's of throwing an exception within an accessor, but I thought I would broach my specific question with an example: public class App { static class Test { private List strings; …
wulfgarpro
  • 6,129
  • 12
  • 62
  • 104
6
votes
4 answers

What is the difference between using cfinvoke and createObject to run a component function?

In my company's code, I've often seen component files used by initializing an object of that component and calling the methods off the object. However, it seems to me somewhat more straightforward to use the cfinvoke method, especially when only…
froadie
  • 71,770
  • 69
  • 154
  • 228
6
votes
2 answers

How to go about creating a prolog program that can work backwards to determine steps needed to reach a goal

I'm not sure what exactly I'm trying to ask. I want to be able to make some code that can easily take an initial and final state and some rules, and determine paths/choices to get there. So think, for example, in a game like Starcraft. To build a…
Ciph3rzer0
  • 522
  • 2
  • 4
  • 13
6
votes
1 answer

Why was "immediate" attribute added to the EditableValueHolders?

Initially immediate flag was only intended for ActionSource interface. But later on it was added to the EditableValueHolder interface also. What was the reason for design decision ?
Geek
  • 23,609
  • 39
  • 133
  • 212
5
votes
2 answers

Why is CompareTo on short implemented this way?

Consider the following code: namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Console.WriteLine(100.CompareTo(200)); // prints -1 …
sloth
  • 91,747
  • 17
  • 156
  • 204
1
2 3 4 5 6 7