This tag is for questions that aren't specific to a programming language or environment.

learn more… | top users | synonyms

1
vote
3answers
272 views

is using a PUT with side affects acceptable (REST)

I want to create an undo history whenever the user updates a form. Because it's an update, I want to use a PUT request. However, I read that PUT needs to have no side effects. Is it acceptable to ...
5
votes
1answer
372 views

How can I implement a modular “save” function for a game?

I have to implement a method to save my game in such a way that I can change the storage medium with the change of only a single variable. Ideally I'd use an interface to designate the required ...
11
votes
1answer
578 views

How is machine learning incorporated into search engine design?

I am currently building a small in-house search engine based on Apache Lucene. Its purpose is simple - based on some keywords, it will suggest some articles written internally within our company. I am ...
7
votes
2answers
202 views

Definition of a type

Conceptually, I used to think of types as sets. However, I think I've seen people wishing to distinguish types A, B even if they represent identical collections of values. So I figured a better ...
4
votes
2answers
353 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 ...
-1
votes
1answer
89 views

Term to describe keyword followed by statement block [closed]

Is there a general term to describe a keyword followed by a statement block? E.G. if() {statement block} while() {statement block} try{statement block} finally{statement block} Or even something ...
28
votes
5answers
998 views

Updating password hashing without forcing a new password for existing users

You maintain an existing application with an established user base. Over time it is decided that the current password hashing technique is outdated and needs to be upgraded. Furthermore, for UX ...
7
votes
4answers
817 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, ...
1
vote
2answers
241 views

How to handle editing a large file for a non-technical user

I have a client who is given a tab delimited .txt file containing hundreds of thousands of rows. I have a user story as follows: As a user I want to take the text file and add a new value at the ...
14
votes
3answers
381 views

Does usage of advanced language features decrease maintainability? [duplicate]

On a code review, I've stumbled on an interesting idea, which I can't properly judge alone. Is it OK to improve readability of code by means of not widely known language syntax? When the original ...
5
votes
2answers
302 views

Exposing domain models over API

I'm building a simple RESTful API for a web-based application I'm working on, and I'm wondering about the best way to go about exposing my domain models. Let's say I have a User class and I want to ...
13
votes
1answer
1k views

How do I test a file reader?

I am working on a project with a few file formats. Some formats are specified by .xsds, others by documentation on their respective websites, and some are custom in-house formats that have no ...
1
vote
2answers
146 views

Will a binary include methods that are not called in the source code?

[Potentially misleading title, but I'm not sure how best to word it.] Theoretical question on compilers and language design. Say I'm re-implementing a method in a code base. Instead of removing or ...
3
votes
3answers
436 views

Good Procedure or Function Design

This is in reference to the question posted here. As I would judge it, the question there should be closed simply because it seems to ask why the Borland developers made one thing a function and ...
8
votes
2answers
835 views

What is an example of a continuation not implemented as a procedure?

An interesting discussion about the distinction between callbacks and continuations over on SO has prompted this question. By definition, a continuation is an abstract representation of the logic ...
4
votes
3answers
482 views

Where can I find an authoritative comparison of computer languages? [closed]

I've reached a point in my career where I want to consider myself less "an {x} engineer" where {x} is a specific programming language, and I want to be more of a language-agnostic software engineer. ...
2
votes
2answers
273 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 ...
5
votes
4answers
501 views

How can I stop myself overwriting member variables with 'new' ones?

The bulk of my programming experience has been with C++ and (shudder) FORTRAN (I'm a scientist not a programmer as such, but I do my best). I've recently started using python extensively and find it ...
3
votes
3answers
402 views

What is the job of a language virtual machine, and creating one [closed]

Recently I have become incredibly interested in language development. The past few weeks I have written many language front ends (lexer, parser) including a calculator language/expression parser and ...
3
votes
2answers
598 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 ...
2
votes
3answers
359 views

Why is float the default in the majority of languages?

In programming languages, for represent numbers you have (mainly) two types: Int(s) and floats. The us of Int is very easy. However floats cause a lot of unexpected surprises: ...
2
votes
1answer
168 views

Strategy for normalising and interpreting location data

I'm a bit stuck with a problem involving the normalisation of location input data from the user (which comes from a third party). Aim To logically breakdown and interpret the user location input ...
-1
votes
2answers
719 views

Why don't we have a non-turing complete general purpose language yet? [duplicate]

Non-turing complete languages can solve every practical problem that a turing-complete language can. Also, they are much more analyzable than turing complete languages. The compiler can comprehend the ...
2
votes
0answers
119 views

Are there non-turing complete dynamic languages which can be used to create useful programs? [duplicate]

While it takes a turing complete language to create any imaginable program, is it possible to compute most "useful" programs with a non-turing complete dynamically typed language? For example, is ...
8
votes
3answers
553 views

I have to compromise: DRY, or Command-Query-Separation?

I was recently refactoring a method that was both a command and a query method. After separating it into a one command method and one query method, I found that there are now multiple places in the ...
5
votes
3answers
353 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 ...
1
vote
2answers
244 views

is there a programming language designed to express data combinations? [closed]

Very often, when using the command line or just programming, you want to express some kind of combination that you end up using a for - which is often verbose. for (int i = 0; i<10; ++i) ...
1
vote
2answers
105 views

Creating documents from snippets [closed]

From time to time I create whole documents (e.g. XML or proprietary) programmatically. If it easy enough, I just write something like stringbuilder.append("<blah>"); ...
2
votes
1answer
185 views

Representing floating-point numbers in bytecode

How do interpreted languages typically go about representing floating-point numbers in their bytecode? For example, suppose I've got a Java program with the line double a = 3.0; What does 3.0 look ...
3
votes
3answers
314 views

Can we reduce confusion in line-based diff tools by annotating the code with some unique tokens?

Let's say I have procedure1() { --body of first procedure-- } Then I rename it into procedure2 and create a procedure1 above it: procedure1() { --body of second procedure-- } procedure2() ...
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(); ...
2
votes
1answer
195 views

Algorithm in undirected BFS graph

I'm trying to put together an algorithm that will display the node degree for every node in a breadth first tree graph (assume BFS was called). Assume it's an undirected graph. I'm not sure how to ...
2
votes
6answers
409 views

Should all classes have a default constructor as part of good coding convention

From the texts I have read so far, the conventions talk about organizing constructors, starting with the default, if any. I am wondering, should all classes have a default constructor anyway. This ...
-1
votes
3answers
202 views

Is there a core set of language agnostic problems? [closed]

I would like to design a programming language by solving a specific set of problems. I am looking for a core set of programming problems that are language agnostic. It seems that there are a number ...
6
votes
6answers
1k views

If the model is validating the data, shouldn't it throw exceptions on bad input?

Reading this SO question it seems that throwing exceptions for validating user input is frowned upon. But who should validate this data? In my applications, all validations are done in the business ...
5
votes
3answers
331 views

Why is it rare to collect analytics/usage data in open source software?

So, I've been developing some analytic software at my work and also have started to take more notice to analytics in general. For instance, I recently installed Google Analytics on my blog(which is ...
3
votes
5answers
244 views

Testing From A Developer's Perspective [closed]

I have a book which mentions: "There are many types of testing, including unit testing, integration testing, functional testing, system testing, performance testing, and acceptance testing". It ...
3
votes
2answers
1k views

How to write a HTTP server?

As the title says, I would like to write a HTTP server. My question is this, how do I do this? I know this sounds VERY general and too "high level", but there is a method to my madness. An answer to ...
31
votes
6answers
20k views

What is early and late binding?

In many interviews I've been asked this question. I found the following answer: Early binding refers to assignment of values to variables during design time whereas late binding refers to ...
6
votes
7answers
1k views

Making Simple IF Statements Shorter

If we assume we have this little snippet of code: string str = "checked"; bool test1; if (str == "checked") { test1 = true; } else { test1 = false; } Is it bad practice to change a simple ...
12
votes
5answers
868 views

Strengthening code with possibly useless exception handling

Is it a good practice to implement useless exception handling, just in case another part of the code is not coded correctly? Basic example A simple one, so I don't loose everybody :). Let's say I'm ...
2
votes
1answer
142 views

What are the pros and cons of temporary variables vs multiple returns [duplicate]

Take the following examples: public static String returnOnce() { String resultString = null; if (someCondition) { resultString = "condition is true"; } else { resultString ...
2
votes
5answers
372 views

Other than XML, what are some examples of “coding” a GUI design?

I've been trying to think outside of the box as to how desktop GUIs can be designed in code(not a graphical designer!). I've come across basically three ways this is done: XML Raw code (create a ...
3
votes
2answers
121 views

Prevent anomalies caused by signal propagation time

In electrical engineering class we learned that signal lines are not ideal, so it takes time for the signal to reach the other end of the cable, and if we doesn't take this into account, it can lead ...
1
vote
2answers
377 views

Fundamental TDD: stuck with writing a test so I can write code that I want

I have a Season class. This Season has a few properties: among them, a list of Games. This should be populated from the same source that populated the rest of the Season properties. I have a test ...
2
votes
1answer
167 views

Where does UI fit in a Multi Agent system

tl;dr How would I represent GUI as agents in a multi agent system. I am learning more about Multi Agent Systems. I like the concepts of such systems, it makes a lot of sense and it sounds very ...
2
votes
3answers
266 views

Dependency injection and ease of use

I'm writing a handy library (we'll call it Thinger) that goes off and fetches an XML document, does some X-Path query on it and does something helpful with the result of that. (What I'm actually doing ...
2
votes
5answers
246 views

Best practice to sort then reverse, or write “backwards” comparator?

I wrote a comparator for a custom class of mine and when I ran my code I realised the output of my list of these objects was in the reverse order as to what I wanted. It was "ascending" as opposed to ...
0
votes
3answers
296 views

How do I tell a user that bps means bits per second or bytes per second?

I'm writing an application that deals with the network and the hard drive. For the network portion, the application measures in bits per second, while the disk portion measures in bytes per second. ...
1
vote
2answers
400 views

Can we create a program that writes out its source code?

Can we create a program that print out its source code what if we (or the program itself) compile than the new program would have the same exact functionality what the original program has? So somehow ...