Tagged Questions
1
vote
1answer
123 views
Unit-testing databases: test all possible permutations of read and write to table?
I am testing a resource management class that is interacting with a database or a file system, or a combination of both. I was wandering if it is the norm to test all possible permutations of read and ...
4
votes
3answers
286 views
Exceptions vs ErrorCodes when working with devices
Out team is at the cusp of a new project.
One of the components at the boundary of the system is the component which interacts with a printer through an external COM component (referenced as a usual ...
5
votes
2answers
587 views
Is sticking to one language on a particular project a good practice?
I'm developing a pipeline for processing text that will go into production. The question I keep asking myself is: should I stick to one language for the project when I'm looking for a tool to do a ...
0
votes
1answer
54 views
How to record/store edits?
In many programs and web apps (stack exchange included) the program is able to backtrack what edits where made to the piece. My issue is similar: I want to be able to store a "timeline" of edits, ...
4
votes
4answers
895 views
Is it a good practice to create a ClassCollection of another Class?
Lets says I have a Carclass:
public class Car
{
public string Engine { get; set; }
public string Seat { get; set; }
public string Tires { get; set; }
}
Lets say we're making a system ...
1
vote
1answer
305 views
Which practice is the best for database connection? (PHP, etc)
Leave a open database connection throughout the execution of the aplication, or for each time a operation will be executed a new connection will be created?
Open throughout the execution:
Open ...
6
votes
3answers
168 views
Holding mutable data in a single place
Given a mutable property, it generally makes sense to only hold/store that property in a single place. When the data needs to change you only need to update a single field, and you can completely ...
8
votes
7answers
715 views
Is it appropriate for a class to only be a collection of information with no logic?
Say I have a class Person that has instance variables age, weight, and height, and another class Fruit that has instance variables sugarContent and texture. The Person class has no methods save ...
9
votes
8answers
609 views
When does 'optimizing code' == 'structuring data'?
A recent article by ycombinator lists a comment with principles of a great programmer.
#7. Good programmer: I optimize code. Better programmer: I structure data. Best programmer: What's the ...
5
votes
2answers
367 views
Returning an IQueryable from an IRepository
Using the Repository pattern, is it proper to return an IQueryable of a data set (table), for generic usage?
It is very handy in many cases, especially when using external libraries that leverage ...
5
votes
6answers
369 views
What are best practices when switching between projects/coming back to projects frequently?
The nature of my job is that I have to switch back and forth between projects every few weeks. I find that one of the biggest impediments to my productivity is the ramp-up time to getting all the ...
8
votes
2answers
235 views
Low coupling processing big quantities of data
Usually I achieve low coupling by creating classes that exchange lists, sets, and maps between them. Now I am developing a Java batch application and I can't put all the data inside a data structure ...
6
votes
4answers
433 views
Should injecting dependencies be done in the ctor or per method?
Consider:
public class CtorInjectionExample
{
public CtorInjectionExample(ISomeRepository SomeRepositoryIn, IOtherRepository OtherRepositoryIn)
{
this._someRepository = ...
1
vote
1answer
714 views
How frequent should the Token Updation in CSRF security be?
To start with the background, this post is what Jeff Atwood says about CSRF tokens. In this very page, he goes on to say:
An even stronger, albeit more complex, prevention method is to
leverage ...
2
votes
3answers
149 views
Alternate approaches to creating custom forms in a web application
We are putting together some distribution software, selling about 150K SKU's. Some of our items have additional requirements in order to be sold that are dictated by our vendors. For instance one type ...