general tips and guidelines for designing better applications, regarding APIs, Architecture and internal structures.
Questions tagged [design-decisions]
93 questions
3
votes
2 answers
Rationale for numpy.split returning a list and not an array
I was surprised that numpy.split yields a list and not an array. I would have thought it would be better to return an array, since numpy has put a lot of work into making arrays more useful than lists. Can anyone justify numpy returning a list…

kilojoules
- 9,768
- 18
- 77
- 149
3
votes
1 answer
Algorithm to represent Decision tables
What would be the best algorithm to use if you wanted to store Decision tables in code, i've looked at the Adjacency matrix and Binary tree would anyone consider this to be the right direction? What other choices to I have?

driveBy
- 31
- 2
3
votes
7 answers
C# byte[] substring? (design)
I'm downloading some files asynchronously into a large byte array, and I have a callback that fires off periodically whenever some data is added to that array. If I want to give developers the ability to use the last chunk of data that was added to…

mpen
- 272,448
- 266
- 850
- 1,236
3
votes
1 answer
A lambda expression with a statement body cannot be converted to an expression tree
There are several questions on StackOverlow about statement body expressions. I am just wondering why it is not possible to do this in C#? (Where is the complexity why it was not implemented in the compiler?)
There is great explanation for…

TN.
- 18,874
- 30
- 99
- 157
3
votes
6 answers
Primary Keys - Native, Sequence, or GUID keys?
In reading this and this and then reading this (which references the other two ironically) I find myself wondering just how big the discussion of this topic is? I am a SQL Server guy and so I tend to use an Identity that is auto generated in the…

Andrew Siemer
- 10,166
- 3
- 41
- 61
3
votes
2 answers
What was the design decision for variadic functions needing an array?
I am curious and hopefully someone can shed somelight on this - but why do the C# functions that take 'params' have to be an array?
I get that the objects in the parameters list are entered into an array but what if someone wants to create a…
user110714
2
votes
3 answers
Why iterator::end( ) are non-static members and not similar as string::npos?
While iterating through a std::map or std::vector or any container which has iterator in it, is checked against the variable.end() and not something like container<>::end. For example,
map var;
for(map::iterator it = var.begin();…

iammilind
- 68,093
- 33
- 169
- 336
2
votes
3 answers
How do I know when to and whether to have a separate controller for a piece of code?
So I am in a situation where I have to decide whether or not to have a separate controller for a particular piece of code. We have a home page that acts like a hub for the rest of the site. The page is accessible to all users (logged in as well as…

Chirantan
- 15,304
- 8
- 49
- 75
2
votes
1 answer
A wizard's logical behavior
The question I have is about the general functionality of the back button in wizards. I was thinking about the possible behaviors of this button and I couldn't find any clue which one is the right choice between these two options.
1- It should show…

Saffar
- 520
- 1
- 5
- 13
2
votes
1 answer
Why is ImmutableList a class but ImmutableArray a struct?
When you read the documentation for ImmutableArray and ImmutableList, you can see that:
ImmutableArray has been implemented as a struct
ImmutableList has been implemented as a class
Question:
Can you explain why such design…

aybe
- 15,516
- 9
- 57
- 105
2
votes
2 answers
Why was getMonth deprecated on java.sql.Date and java.util.Date
I should preface this with I use Apache Spark, which uses java.sql.Date, in case anyone suggests I should use dates from java.time. The example below is in Scala.
The API that I use (which is deprecated) to get the month for a date is as…

Nick
- 645
- 7
- 22
2
votes
4 answers
If the stack grows at numerically lower address why does pointer comparison reverses this?
Since the stack grows downwards, ie towards numerically smaller memory addresses why does &i < &j is true. Correct me if I'm wrong, but I'd imagine this was a design decision of C creators (that C++ maintains). But I wonder why though.
It is also…

KeyC0de
- 4,728
- 8
- 44
- 68
2
votes
2 answers
Azure Apps - Distributed Architecture - 1 API Layer vs 2 API Layers - Design decisions
Background
Having run through the Getting started with API Apps and ASP.NET in Azure App Service tutorial (https://azure.microsoft.com/en-gb/documentation/articles/app-service-api-dotnet-get-started/), we had an architecture question arise today…

Arnie
- 33
- 3
2
votes
2 answers
Repeated properties design pattern
I have a DownloadManager class that manages multiple DownloadItem objects. Each DownloadItem has events like ProgressChanged and DownloadCompleted. Usually you want to use the same event handler for all download items, so it's a bit annoying to have…

mpen
- 272,448
- 266
- 850
- 1,236
2
votes
3 answers
Should I use Rails 3 for my application
I have been a user of Rails for a while and used version 2.3.4 recently.
Rails 3 Beta just came out recently and it seems have significant performance improvement especially with the merge with Merb.
I'm planning on building an application that will…

Tam
- 11,872
- 19
- 69
- 119