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

learn more… | top users | synonyms

5
votes
7answers
520 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
449 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
576 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
710 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
492 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
758 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 ...
11
votes
6answers
3k 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
1k 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
600 views

Teaching Programming Concepts Without a Specific Language [closed]

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
7k 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
761 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 ...
7
votes
3answers
1k 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 ...
36
votes
15answers
6k 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 ...
91
votes
11answers
14k 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
172 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
264 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
904 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
591 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
95 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
272 views

Form Follows Function in Programming?

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

Techniques for getting off the ground in any language [closed]

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 ...
6
votes
3answers
479 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
171 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 ...
4
votes
2answers
251 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 ...
21
votes
7answers
2k 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; ...
54
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
2k 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
849 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
289 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
600 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
426 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
361 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 ...
15
votes
6answers
1k 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. ...
42
votes
17answers
6k 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 ...
11
votes
7answers
1k 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 ...
6
votes
3answers
4k 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
234 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 ...
10
votes
6answers
832 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
853 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
855 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 ...
41
votes
13answers
6k views

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

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 ...
12
votes
6answers
14k 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
185 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
239 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
507 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
129 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 ...