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

learn more… | top users | synonyms

2
votes
2answers
105 views

How does one handle an incorrect resource file?

I'm starting the parser that will handle one of the key features of my app and realizing exactly who easy it would be for me to screw up a resource file that is provided to the application. For ...
26
votes
4answers
3k views

Can you use Pi as a crude random number generator?

I recently saw this question over at math.SE. It got me thinking. Could Pi be used as a crude random number generator? I mean the results are well known(how long has pi been computed to now?) but, Pi ...
33
votes
15answers
4k views

Why use other number bases when programming

My coworkers and I have been bending our minds to figuring out why anyone would go out of their way to program numbers in a base other than base 10. I suggested that perhaps you could optimize longer ...
4
votes
3answers
314 views

Is Reading the Spec Enough? [closed]

This question is centered around Scheme but really could be applied to any LISP or programming language in general. Background So I recently picked up Scheme again having toyed with it once or twice ...
4
votes
3answers
246 views

In dependency injection, is there a simple name for the counterpart of the injected object? [closed]

In tutorials and books, I have never seen a single word describing the object that the injected object is injected into. Instead, other terms are used, like "injection point" which don't denote the ...
-3
votes
3answers
305 views

In what practical ways is it good to remember the memory/pointers model? [closed]

A variable refers to a value. A variable is also stored in a memory address. People say that it's good to have this memory model in mind. Is that true? What is some sample code that shows this as ...
3
votes
4answers
1k views

Why should one use a single-use temporary variable?

Let's say we have a class called 'Automobile' and we have an instance of that class called 'myCar'. I would like to ask why do we need to put the values that our methods return in a variable? Why ...
0
votes
2answers
242 views

What is the standard for describing functions and objects?

What is the standard for describing functions/methods (function name, number of arguments, argument type, return type, etc...) in a manner that is language independent? EDIT: More specifically, how ...
2
votes
1answer
83 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 ...
13
votes
5answers
2k views

Why are invariants important in Computer Science

I understand 'invariant' in its literal sense. I also recognize them when I type code. But I don't think I understand the importance of this term in the context of computer science. Whenever I read ...
3
votes
2answers
396 views

Questions about identifying the components in MVC

I'm currently developing an client-server application in node.js, Express, mustache and MySQL. However, I believe this question should be mostly language and framework agnostic. This is the first ...
2
votes
2answers
1k views

Relationship between SOA and OOA

Thomas Erl defines SOA as follows in his site: Service-oriented computing represents a new generation distributed computing platform. As such, it encompasses many things, including its own ...
2
votes
2answers
139 views

Naming variables with fixed point units

What should I name a variable that has units with a fixed point? int herpLimitLo_psig2 = 6000; // 60.00 psig int derpLimitLoPsigwithtwodigits; int herpLimitHiPsigfixedtwo; int ...
2
votes
3answers
172 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 ...
12
votes
10answers
2k views

What's the next level of abstraction? [closed]

Since programming languages initially only used lines of code executed sequentially, and it evolved into including functions which were one of the first levels of abstraction, and then classes and ...
3
votes
3answers
2k views

What defines code readability? [duplicate]

Possible Duplicate: How would you know if you've written readable and easily maintainable code? It is often said that readability is perhaps the most important quality-defining measure ...
10
votes
3answers
208 views

How could I avoid a distributed deadlock during a mutual connection between two nodes?

Suppose we have two peer nodes: the first node can send a connection request to the second one, but also the second one can send a connection request to the first one. How to avoid a double connection ...
5
votes
2answers
305 views

Use of versioned objects/data to handle program version compatibility?

Is there a common name for the practice of keeping a version number on your data, so that different versions of your program can identify, for example, "current", "legacy", and "too-old-to-deal-with" ...
4
votes
3answers
341 views

Naming a “do X if needed” method

What is a good way to name a method that checks if X needs to be done, and does X it if necessary? For example, how to name a method that updates a user list if new users have logged in? ...
8
votes
1answer
12k views

Programming language trends

Are there some statistics out there that show the approx. number of users that popular programming languages have and the rate this number increases over time?
6
votes
6answers
608 views

Generating different combinations from a list of muscles

Suppose we have a model of a human muscular system containing the following muscles each within a specific muscle group: Arms Biceps Triceps Forearms Torso Front Abs Chest Shoulders Torso Back ...
36
votes
12answers
3k views

Is there ever a reason to do all an object's work in a constructor?

Let me preface this by saying this is not my code nor my coworkers' code. Years ago when our company was smaller, we had some projects we needed done that we did not have the capacity for, so they ...
18
votes
8answers
2k views

Should laying out a GUI graphically be considered “cheating?”

I have a friend who has a slightly greater amount of programming experience as me. We were talking about all the different programming technologies we use and Interface Builder came up in ...
2
votes
2answers
124 views

What direction should I consider the offset when searching strings in reverse?

I'm making an indexOfReverse utility function in my C++ program, and I have caught a bit of a snag. Implementing the offset and maxOffset in my indexOf was very intuitive to me.. These start from the ...
2
votes
3answers
371 views

Why are the arguments for substring functions mismatched?

In many languages, the substring function works like this: substring(startIndex, endIndex) returns the substring from startIndex until endIndex-1 (if you view startIndex and endIndex as 0-based) / ...
7
votes
2answers
294 views

Parsing multiple file formats/protocols

We are starting a project where we will need to write parsers for a bunch of binary file formats, each of them representing very similar data (time-value series from different measurement devices). ...
42
votes
4answers
7k views

Which algorithms/data structures should I “recognize” and know by name? [closed]

I'd like to consider myself a fairly experienced programmer. I've been programming for over 5 years now. My weak point though is terminology. I'm self-taught, so while I know how to program, I don't ...
5
votes
7answers
512 views

if you were asked to answer to the question “ what is the difference between the English language and a programming language” how you will respond? [closed]

Basically in both cases you have: a well defined vocabulary a syntax to respect they both can express a business logic they can define semantics I don't think that will be fair to say "A ...
4
votes
3answers
439 views

Is case after case in a switch efficient?

Just a random question regarding switch case efficiency in case after case; is the following code (assume pseudo code): function bool isValid(String myString){ switch(myString){ case "stringA": ...
5
votes
5answers
532 views

When decomposing a large function, how can I avoid the complexity from the extra subfunctions?

Say I have a large function like the following: function do_lots_of_stuff(){ { //subpart 1 ... } ... { //subpart N ... } } a common pattern is to decompose it ...
4
votes
9answers
709 views

Why are effect-less functions executed?

All the languages I know of would execute something like: i = 0 while i < 100000000 i += 1 ..and you can see it take a noticeable amount of time to execute. Why though, do languages do ...
27
votes
11answers
2k views

Should a server “be lenient” in what it accepts and “discard faulty input silently”?

I was under the impression that by now everyone agrees this maxim was a mistake. But I recently saw this answer which has a "be lenient" comment upvoted 137 times (as of today). In my opinion, the ...
5
votes
3answers
476 views

Is there a phrase or word to describe an algorithim or program is complete in that given any value for its arguments there is a defined outcome?

Is there a phrase or word to describe an algorithim or programme is complete in that given any value for its arguments there is a defined outcome? i.e. all the ramifications have been considered ...
5
votes
4answers
732 views

Is there any functional difference between immutable value types and immutable reference types?

Value types are types which do not have an identity. When one variable is modified, other instances are not. Using Javascript syntax as an example, here is how a value type works. var foo = { a: 42 ...
9
votes
6answers
2k views

Maybe monad vs exceptions

I wonder what are the advantages of Maybe monad over exceptions? It looks like Maybe is just explicit (and rather space-consuming) way of try..catch syntax. update Please note that I'm intentionally ...
3
votes
5answers
969 views

First dedicated IDE?

What was the first program that was created as a dedicated IDE? That is, purpose built for coding, rather than simply allowing integration as part of its expansion options. This is opposed to a text ...
2
votes
5answers
540 views

Teaching Programming Concepts Without a Specific Language

I'm teaming up with a guy who has no programming experience. We're using a tool to make our game (RPG Maker) that has an event-based system that allows you to do pretty much everything you want. They ...
7
votes
6answers
6k views

Design: Calling back to the parent class

When modelling an object with children it's common to include the children via composition, as a member of the parent class. Sometimes however the children need to tell the parent something, they need ...
2
votes
2answers
566 views

Using a DSN database connection is a bad practice?

During all my professional lifetime that I have been programming in Windows enviroments, I advised my friends and coworkers to not use a DSN database connection in their applications, based on my own ...
5
votes
3answers
853 views

Style for control flow with validation checks

I find myself writing a lot of code like this: int myFunction(Person* person) { int personIsValid = !(person==NULL); if (personIsValid) { // do some stuff; might be lengthy int myresult ...
2
votes
3answers
339 views

Programming without target platform? [closed]

I have a idea for a program and have began laying out the software design concept in a traditional SDLC model of charts and instructions for what I want all parts to achieve. A quick explanation of ...
36
votes
15answers
5k views

Is it bad practice to name an unused variable with a single underscore?

Often when the syntax of the language requires me to name a variable that is never used, I'll name it _. In my mind, this reduces clutter and lets me focus on the meaningful variables in the code. I ...
89
votes
11answers
12k 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 ...
3
votes
3answers
165 views

Class fields/variables. Keep single reference point at class level or pass to individual methods?

Often I see a class where a value is injected into a method or even a constructor. That value is then used by several methods within that class and a reference is simply passed through to each method ...
2
votes
4answers
257 views

Where can I learn about how programs handle file systems like NTFS?

I'm writing a program to handle the xbox 360's STFS files. I'm encountering all sorts of problems about how to keep track of used vs unused blocks, reading non-sequential files, etc. These aren't so ...
19
votes
11answers
892 views

How To Explain To My Dad What I have Programmed [duplicate]

Possible Duplicate: My Dad is impatient with the pace of my learning to program. What do I do? I am 14 and have been studying programming for 4 months now (3 months Python, 1 Month of ...
0
votes
3answers
579 views

Programming Without A Computer [duplicate]

Possible Duplicate: Learning to program without a computer I have a bit of experience programming (6 Months) and am soon to go on a 2 month trip where I will be without a computer, but with ...
0
votes
2answers
93 views

Reinforcing Syntax Elements

I am currently learning Javascript, and there is one element of the syntax that I can just not seem to nail down. That element is adding semicolons at the end of each line. I have learned Python and ...
2
votes
1answer
239 views

Form Follows Function in Programming?

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

Why is it called a 'Here Document'?

(Let me know if this is the wrong SE for this) Why is a Here Document (or Heredoc) called that? Wikipedia didn't have anything to say on that particular subject. I did find unix docs describing a ...