0
votes
3answers
117 views

One method with many behaviours or many methods

This question is quite general and not related to a specific language, but more to coding best practices. Recently, I've been developing a feature for my app that is requested in many cases with ...
0
votes
5answers
261 views

Is it a good practice to wrap collection in Java? [closed]

I came across a snippet like this, and find it's over engineering. Is it a good practice? public class SchoolList extends ArrayList<School> { } public class School extends ...
4
votes
2answers
882 views

When is it worthwhile to replace working mature code with frameworks+patterns

I fear that frameworks in many cases have become a fashion or trend and are being abused. In many ways people are sacrificing speed just because they want to keep up with every single lib that comes ...
5
votes
4answers
305 views

Is it normal to write all logs into a single file?

Our teamlead said that many files much worse than a single, despite of we are working on a big project. He argued that our customers could more easily send logs to us if there will be just a single ...
1
vote
1answer
206 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
4answers
884 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
650 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
63 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, ...
7
votes
4answers
5k 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
434 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
186 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
730 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
642 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
635 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
426 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
252 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
585 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
1k 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
156 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 ...
4
votes
4answers
383 views

What determines when an application requires mvvm?

I'm developing mobile applications for Windows Phone 7. This application calls some web services and occasionally sends responses out via web services. I recently started looking into MVVM and noticed ...