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

learn more… | top users | synonyms

2
votes
2answers
373 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
426 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
324 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 ...
34
votes
15answers
3k 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 ...
82
votes
10answers
8k 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
155 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
250 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
855 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
532 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
92 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
194 views

Form Follows Function in Programming?

Does the saying, "form follows function" hold true in programming or language-design? Why or why not?
10
votes
4answers
702 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 ...
26
votes
12answers
2k views

Techniques for getting off the ground in any language

When I start learning a new language, I have a couple of simple implementations that I like to complete to familiarise myself with the language. Currently, I write: Fibonacci and/or factorial to get ...
1
vote
8answers
569 views

Motivation Problems, Middle School Programmer [closed]

I'm in middle school at the moment and have been programming for about a year and a half. I mostly work with Python and Ruby, and am currently learning Rails. I know, you can never learn enough, it ...
6
votes
3answers
353 views

Strategy for backwards compatibility of persistent storage

In my experience, trying to ensure that new versions of an application retain compatibility with data storage from previous versions can often be a painful process. What I currently do is to save a ...
4
votes
2answers
152 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 ...
3
votes
2answers
230 views

Benchmarking CPU processing power

Provided that many tools for computers benchmarking are available already, I'd like to write my own, starting with processing power measurement. I'd like to write it in C under Linux, but other ...
2
votes
3answers
371 views

How to learn the math behind the code? [closed]

I have recently gotten into programming. (Although I know that the number of books you have read does not determine your programming competency or ability, just to paint a "map" of where I am in terms ...
16
votes
6answers
1k views

while(true) and loop-breaking - anti-pattern?

Consider the following code: public void doSomething(int input) { while(true) { TransformInSomeWay(input); if(ProcessingComplete(input)) break; ...
55
votes
17answers
4k views

How to deal with tautology in comments?

Sometimes I find myself in situations when the part of code that I am writing is (or seems to be) so self-evident that its name would be basically repeated as a comment: class Example { /// ...
1
vote
1answer
1k views

How are Implicit-Heap dynamic Storage Binding and Dynamic type binding similar?

"Concepts of Programming languages" by Robert Sebesta says - Implicit Heap-Dynamic Storage Binding: Implicit Heap-Dynamic variables are bound to heap storage only when they are assigned ...
2
votes
1answer
426 views

What is meant by elaboration of a declaration statement?

Intuitively I understand "elaboration" and have a very mild idea. But I want to know exactly what is elaboration of a declaration? I came across this word in this context: Stack dynamic storage ...
1
vote
3answers
283 views

When checking for transposed day and month values between two Dates - should comparing 11/11/2000 and 11/11/2000 return true or false?

Assuming a function with a signature of boolean isTransposed(Date date1, Date date2); Example outcomes: date1 date2 Outcome 06/02/2000 02/06/2000 true 02/06/2000 06/02/2000 true ...
1
vote
3answers
427 views

Calculate Ellipse based on 4 points

I need to move an object based on 100 images rotating. The object needs to move in a path that is forming an ellipse when I'm rotating the image based on my gestures. I have 4 points, 2 pairs of ...
10
votes
7answers
378 views

What is a good alternative to the name variable for a language that only has immutable references or labels?

For example, in functional languages, variables are single assignment and their values are immutable once assigned. So they have two states unbound and bound, once bound they can't be changed. Is ...
3
votes
6answers
342 views

Would the concept of source code layers be of any use?

I'm talking about something like layers in photoshop, except they apply directly to the source code. For example, in pseudo-code... inventing what some project might look like - say a computational ...
14
votes
6answers
943 views

Do I really need a unit test framework?

Currently at my job, we have a large suite of unit tests for our C++ application. However we don't use a unit test framework. They simply utilize a C macro that basically wraps an assert and a cout. ...
38
votes
17answers
4k views

Why Use !boolean_variable Over boolean_variable == false

A comment on this question: Calling A Method that returns a boolean value inside a conditional statement says that you should use !boolean instead of boolean == false when testing conditions. Why? To ...
10
votes
7answers
871 views

Which statically typed languages support intersection types for function return values?

Initial note: This question got closed after several edits because I lacked the proper terminology to state accurately what I was looking for. Sam Tobin-Hochstadt then posted a comment which ...
5
votes
3answers
2k views

When is method overloading appropriate?

Suppose I am working on an existing, reasonably large system. I have an object, myObject of class MyClass (for the example's sake, suppose I'm working in Java). myObject is a composition containing a ...
3
votes
3answers
220 views

Patterns for Maintaining Model State in Real Time

While some platform in some languages already address this issue, I would like to keep this semi-language agnostic and to focus on patterns associated with this issue. I have a data model that ...
9
votes
6answers
586 views

How do you name your GUI controls?

It's a generally considered a bad practice to use the Hungarian notation, but is common to find GUI controls named userNameTextBox and userNameLabel. Do you put the control type in it's name? Isn't ...
31
votes
13answers
2k views

Problems (such as maintenance) in development with unpopular language

I'm developing some application with clojure(lisp) alone in my team. It starts as small application. No problem. But as it's having features and extending the area, it's becoming important program. I ...
2
votes
2answers
718 views

What is the reason behind the if syntax of CoffeeScript?

In most other languages the condition comes before the statement to be executed when the condition is met. However, in CoffeeScript (and maybe some other languages) the syntax is: number = -42 if ...
6
votes
3answers
1k views

Various programming concepts (from a Python viewpoint)

Ever since I've started lurking on stackoverflow, I keep coming across programming concepts such as abstract classes, virtual functions, contracts, interfaces, etc., from a questions about other ...
11
votes
3answers
720 views

Randomly generate directed graph on a grid

I am trying to randomly generate a directed graph for the purpose of making a puzzle game similar to the ice sliding puzzles from Pokemon. This is essentially what I want to be able to randomly ...
37
votes
13answers
5k views

Is it bad interview practice to have candidates write a linked-list implementation?

Reading this site and SO I've seen many stories of interview questions and answers saying a candidate had to implement a linked list from scratch. Usually this is a "gimme" exercise for programming ...
8
votes
6answers
6k views

What are concrete examples of use cases of linked lists?

A linked list can be used when you want cheap insertion and deletion of elements and when it doesn't matter that the elements aren't next to each other in memory. This is very abstract and I would ...
2
votes
1answer
164 views

Publishing an internal web app on the internet to a much larger group of users than before

My company has developed a web application based on GWT (Google Web Toolkit) and Ext GWT in the browser, JBoss application server and Oracle in the backend. The app allows users of different ...
2
votes
3answers
192 views

Package name best practice when porting a library

What is the suggested way (specifically in the open-source world) for the package name when porting a library. Say I am porting someone else's library where they have used a reverse domain name ...
6
votes
5answers
365 views

Finding an A* heuristic for a directed graph

In a previous question, I asked about finding a route (or path if you will) in a city. That is all dandy. The solution I chose was with the A* algorithm, which really seems to suit my needs. What I ...
1
vote
3answers
124 views

Encapsulating a single property

If you have a single property that is relevant across a full project, but you should logically have only a single representation of, how would you represent this? In my case, I am developing a simple ...
23
votes
6answers
1k views

What are the arguments against parsing the Cthulhu way?

I have been assigned the task of implementing a Domain Specific Language for a tool that may become quite important for the company. The language is simple but not trivial, it already allows nested ...
0
votes
3answers
491 views

Collection providing lookup by one of several keys [closed]

What do you call a collection in which each item may be looked up by one of multiple keys? A partial, simplified definition in C# might be: class MyDataStructure<TKey1, TKey2, TValue> { ...
29
votes
9answers
4k views

Why is it impossible to produce truly random numbers?

I was trying to solve a hobby problem that required generating a million random numbers. But I quickly realized, it is becoming difficult to make them unique. I picked up Algorithm Design Manual to ...
7
votes
1answer
197 views

Need help with naming (marshaling interface calls) [closed]

This question was reopened on "English Language & Usage": http://english.stackexchange.com/questions/53683/synonyms-for-multiplexing-and-demultiplexing/ This question is related to something ...
9
votes
5answers
748 views

Should code review be performed before or after unit tests

I am debating with my colleague on when to perform code review - before or after unit tests. What is the best practice? Some factors we might need to take into account (there may be more): Size ...
4
votes
2answers
193 views

How to “back track”?

I find that I start projects and, due to my lack of experience, find that old database structures and huge blocks of code are inefficient and memory-costly. However, by the time I realize a re-design ...
9
votes
4answers
483 views

Are there any language agnostic unit testing frameworks?

I have always been skeptical of rewriting working code - porting code is no exception to this. However, with the advent of TDD and automated testing it is much more reasonable to rewrite and refactor ...
7
votes
2answers
126 views

What do you do when working with multiple languages with different capitalization schemes?

I'm making a webapp using Django. The Python convention for naming variables is lowercase_with_underscores, but the Javascript convention is camelCase. In addition, I've seen many people use ...