2
votes
2answers
101 views

Form cancellation. Where should any data rollback occur?

You have a form that has an object injected into it. The user interacts with the form and updates the injected object via the UI. If the user then 'Cancels' the form, whose responsibility is it to ...
5
votes
5answers
403 views

Finding most Important Node(s) in a Directed Graph

I have a large (≈ 20 million nodes) directed Graph with in-edges & out-edges. I want to figure out which parts of of the graph deserve the most attention. Often most of the graph is boring, or at ...
14
votes
2answers
635 views

Which is better: a bunch of getters or 1 method with a selection string parameter?

Our knowledge domain involves people walking over a pressure-recording plate with their bare feet. We do image recognition which results in objects of the 'Foot' class, if a human foot is recognized ...
4
votes
2answers
320 views

How to implement loose coupling?

I want to implement loose coupling in a project. I know two examples of successful loose coupling designs: On a Unix workstation, shell scripts realise a loose coupling between basic utilities. The ...
8
votes
4answers
769 views

How do we keep dependent data structures up to date?

Suppose you have a parse tree, an abstract syntax tree, and a control flow graph, each one logically derived from the one before. In principle it is easy to construct each graph given the parse tree, ...
2
votes
2answers
270 views

What are appropriate metaphors for the pieces of a word processor? [closed]

A word processor is a complicated creature of many layers and pieces, but it represents a relatively simple concept: a piece of paper with writing on it. This leads to the problem of having many ...
3
votes
2answers
528 views

Confusion with Factory pattern regarding Liskov's Substitution Principle, code maintainability and Unit Testing?

I have a confusion regarding Factory Pattern there are basically two ways You can implement that. Approach 1: public interface IProductFactory { IProduct GetProductA(); IProduct ...
5
votes
3answers
330 views

Where to load and store settings from a file?

I think this question should apply to most programs that load settings from a file. My question is from a programming point of view, and it is really how to deal with the loading of settings from a ...
8
votes
5answers
203 views

Gathering all data in single iteration vs using functions for readable code

Say I have an array of runners with which I need to find the tallest runner, the fastest runner, and the lightest runner. It seems like the most readable solution would be: runners = getRunners(); ...
1
vote
3answers
240 views

About classes and their valid states

I get stuck each time I need to write a constructor for any class I design. The reason is that I am not sure what should go into a constructor and what should not. On googling for this, I got the ...
0
votes
1answer
334 views

Client-Server connection response timeout issues

User creates a folder in client and in the client-side code I hit an API to the server to make this persistent for that user. But in some cases, my server is so busy that the request timesout. The ...
2
votes
1answer
82 views

String patterns that can be used to filter and group files

One of our application filters files in certain directory, extract some data from it and export a document from the extracted data. The algorithm for extracting the data depends on the file, and so ...
2
votes
3answers
167 views

Overloading interface buttons, what are the best practices?

Imagine you'll have always a button labeled "Continue" in the same position in your app's GUI. Would you rather make a single button instance that takes different actions depending on the current ...
83
votes
10answers
9k views

The modern way to perform error handling…

I've been pondering this problem for a while now and find myself continually finding caveats and contradictions, so I'm hoping someone can produce a conclusion to the following: Favour exceptions ...
2
votes
1answer
198 views

Form Follows Function in Programming?

Does the saying, "form follows function" hold true in programming or language-design? Why or why not?
4
votes
2answers
154 views

Deprecated Methods in Code Base

A lot of the code I've been working on recently, both professionally (read: at work) and in other spheres (read: at home, for friends/family/etc, or NOT FOR WORK), has been worked on, redesigned and ...
13
votes
5answers
2k views

What is the good explanation of Tennent's Correspondence Principle?

I found myself struggling to see what is this principle about and why is it so important for language design. Basically, it states, that for every expression expr in language should be exactly the ...
21
votes
2answers
3k views

What are the advantages of prototype-based OOP over class-based OOP?

When I first started programming Javascript after primarily dealing with OOP in context of class-based languages, I was left confused as to why prototype-based OOP would ever be preferred to ...
6
votes
5answers
310 views

Does project architecture have a strong relation to used libraries?

Programmers, when it comes to talk about popular patterns in enterprise applications, preach that you should code against interfaces to remove strong relations between components; doing this will aid ...
8
votes
9answers
379 views

Internationalization : What things to think about?

I was listening to Jon Skeet's talk at the last StackOverflow Dev Days and he piqued my curiousity regarding internationalization. Suppose I have a waffle-making program, either complete, or still in ...
4
votes
6answers
400 views

Code reuse: Reusing complex method vs. cherry-picking parts

I am currently facing a situation where I am not quite sure how to best proceed. Background I am planning a new data import process, which will import personnel and salary information from a text ...
7
votes
5answers
504 views

Separation of Concern/Single Responsibilty Principle

I've just been reading through the SOLID principles, and this is one I have real difficulty with when designing software. I am relatively new (4 months professionally) at coding. The idea is simply ...