language-agnostic

How do you code the "Hello World!" program in your favourite language?

Help make Stack Overflow become the definitive place to come to for examples of the classic "Hello World!" program. Feel free to use any language you like and keep to one example per answer please. ...

Pros and cons of Localisation of technical words ?

This question is directed to the non-english speaking people here. It is somewhat biased because SO is an "english-speaking" web forum, so... In the other hand, most developers would know english anyway... In your locale culture, are technical words translated into locale words ? For example, how "Design Pattern", or "Factory", or what...

Where can I learn about proven methods for sharing cryptographic keys?

Suppose that a group wants to encrypt some information, then share the encryption key among the group members in a way that requires the consensus of the group to decrypt the information. I'm interested in a variety of scenarios where the breadth of consensus ranges from unanimity to an absolute majority. A useful technique can apply to ...

Why shouldn't I use "Hungarian Notation"?

I know what Hungarian refers to - giving information about a variable, parameter, or type as a prefix to its name. Everyone seems to be rabidly against it, even though in some cases it seems to be a good idea. If I feel that useful information is being imparted, why shouldn't I put it right there where it's available? See also: Do peopl...

What is an invariant?

The word seems to get used in a number of contexts. The best I can figure is that they mean a variable that can't change. Isn't that what constants/finals (darn you Java!) are for? ...

How do you maintain your program vocabulary?

In a not-so-small program, when you have not-so-few entities, in order to maintain code readability, common terms, and otherwise improve mutual understanding between team members, one have to define and maintain program vocabulary. How do you (or your company) deal with this task, what discipline do you have, what arrangements do you in...

Stable, efficient sort?

I'm trying to create an unusual associative array implementation that is very space-efficient, and I need a sorting algorithm that meets all of the following: Stable (Does not change the relative ordering of elements with equal keys.) In-place or almost in-place (O(log n) stack is fine, but no O(n) space usage or heap allocations. O(n ...

Why Re-throw Exceptions?

I've seen the following code many times: try { ... // some code } catch (Exception ex) { ... // Do something throw new CustomException(ex); // or // throw; // or // throw ex; } Can you please explain the purpose of re-throwing an exception? Is it following a pattern/best practice in exception handling? (I...

What are Code Smells? What is the best way to correct them?

OK, so I know what a code smell is, and the Wikipedia Article is pretty clear in its definition: In computer programming, code smell is any symptom in the source code of a computer program that indicates something may be wrong. It generally indicates that the code should be refactored or the overall design should be reexa...

Visually designing a database structure

I am quite happy to code out tables by hand when making a database but it's not the easiest way to convey information about a database to someone else, especially someone that's not so comfortable coding the tables via a script and would instead use something such at phpMyAdmin. Is there thus a free program (for me to use it it'll have ...

Any experience with unusual technologies ?

99 bottles of beers made me realize that ADA, Erlang and Smalltalk were not so odd languages after all. There are plenty of unusual tools and I supposed that a lot of them are even used :-) Have you ever worked with very original technologies ? If yes, let us know in which context, and what did you think about it. Funny snippets strong...

What is a good reference for how calculation engines such as Excel work?

I am interested in learning how dependency-based calculation engines work in practice. Of course, I can make up my own algorithm, but I was curious if there were any well explained algorithms that are used in practice. I have tried Google, but most articles are < "good". ...

How to make a program bug-free (or, with the less possible bugs)

OK, I know it's a stupid question to ask, so let me clarify. My boss thinks that, "by now, with your level of knowledge, you should never have bugs in your software anymore". While it may be correct, given the correct set of tools and with a proper method, those are never allowed to me, maybe because I don't know what to answer him exac...

What is the semantic web, and why would I want to use it?

Just like it reads. ...

How would you display an array of integers as a set of ranges? (algorithm)

Given an array of integers, what is the simplest way to iterate over it and figure out all the ranges it covers? for example, for an array such as: $numbers = array(1,3,4,5,6,8,11,12,14,15,16); The ranges would be: 1,3-6,8,11-12,14-16 ...

What ideas from other professions have you applied to software development?

The software development community is always open to new ideas to improve the way we develop software, and it seems to me that we innovate more than other engineering disciplines or professions. However, it seems that it would be unfortunate if our relatively young industry failed to learn from established professions. There must be som...

What techniques do you use when writing your own cryptography methods?

For years, maybe 10, I've been fascinated with cryptography. I read a book about XOR bit-based encryption, and have been hooked ever since thing. I guess it's more fair to say that I'm fascinated by those who can break various encryption methods, but I digress. To the point -- what methods do you use when writing cryptography? Is obfus...

What is semantic markup, and why would I want to use that?

Like it says. ...

Dash vs. Underscore

Should it be /about_us or /about-us? From usability point of view, I personally think /about-us is much better for end-user yet Google and most other websites (and javascript frameworks) use underscore naming pattern. Is it just matter of style? Are there any compatibility issues with dashes? ...

Nested for loops in different languages

Here is a fairly common problem. We have an array of arrays. We'd like to call some function for every combination of elements from the different arrays. Conceptually we'd like to do something like this: for my $x (1, 2) { for my $y ('a', 'b') { for my $z ('A', 'B') { print "$x $y $z\n"; } } } except that we don't...