Questions tagged [language-agnostic]

Use this tag for PROGRAMMING QUESTIONS that are independent of any particular programming language.

Questions that are independent of programming language. These questions are typically more abstract than other categories.


A typical usage scenario with this tag is that you have a problem and you don't know how to solve much less what to write in a specific programming language.

So you would first ask a how type question with the tag and usually . Then when you get an acceptable answer you would code it in a specific programming language. If you have problems then you can refer back to the related question with the tag then in the new what question add the specific programming language, e.g. ,


Free Language Agnostic Programming Books


References:

Dictionary of Algorithms and Data Structures (NIST)

8332 questions
1032
votes
22 answers

What is the difference between a framework and a library?

What is the difference between a framework and a library? I always thought of a library as a set of objects and functions that focuses on solving a particular problem or a specific area of application development (i.e. database access); and a…
anbanm
  • 13,425
  • 5
  • 22
  • 17
1031
votes
64 answers

What is the best regular expression to check if a string is a valid URL?

How can I check if a given string is a valid URL address? My knowledge of regular expressions is basic and doesn't allow me to choose from the hundreds of regular expressions I've already seen on the web.
Vitor Silva
  • 17,114
  • 8
  • 33
  • 27
1020
votes
38 answers

What's the difference between an argument and a parameter?

When verbally talking about methods, I'm never sure whether to use the word argument or parameter or something else. Either way the other people know what I mean, but what's correct, and what's the history of the terms? I'm a C# programmer, but I…
rohancragg
  • 5,030
  • 5
  • 36
  • 47
972
votes
320 answers

Strangest language feature

What is, in your opinion, the most surprising, weird, strange or really "WTF" language feature you have encountered? Please only one feature per answer.
Andreas Bonini
  • 44,018
  • 30
  • 122
  • 156
964
votes
16 answers

What's the difference between faking, mocking, and stubbing?

I know how I use these terms, but I'm wondering if there are accepted definitions for faking, mocking, and stubbing for unit tests? How do you define these for your tests? Describe situations where you might use each. Here is how I use them: Fake:…
tvanfosson
  • 524,688
  • 99
  • 697
  • 795
914
votes
33 answers

What does it mean to "program to an interface"?

I have seen this mentioned a few times and I am not clear on what it means. When and why would you do this? I know what interfaces do, but the fact I am not clear on this makes me think I am missing out on using them correctly. Is it just so if…
Damien
  • 13,927
  • 14
  • 55
  • 88
907
votes
23 answers

Database, Table and Column Naming Conventions?

Whenever I design a database, I always wonder if there is a best way of naming an item in my database. Quite often I ask myself the following questions: Should table names be plural? Should column names be singular? Should I prefix tables or…
GateKiller
  • 74,180
  • 73
  • 171
  • 204
845
votes
28 answers

Understanding "randomness"

I can't get my head around this, which is more random? rand() OR: rand() * rand() I´m finding it a real brain teaser, could you help me out? EDIT: Intuitively I know that the mathematical answer will be that they are equally random, but I can't…
Trufa
  • 39,971
  • 43
  • 126
  • 190
845
votes
23 answers

What is a lambda (function)?

For a person without a comp-sci background, what is a lambda in the world of Computer Science?
Brian Warshaw
  • 22,657
  • 9
  • 53
  • 72
836
votes
132 answers

What's your favorite "programmer" cartoon?

Personally I like this one: P.S. Do not hotlink the cartoon without the site's permission please.
Dan Williams
  • 4,910
  • 11
  • 37
  • 46
835
votes
38 answers

Interface vs Base class

When should I use an interface and when should I use a base class? Should it always be an interface if I don't want to actually define a base implementation of the methods? If I have a Dog and Cat class. Why would I want to implement IPet instead…
Howler
  • 2,252
  • 6
  • 22
  • 27
827
votes
22 answers

What is a callback function?

What is a callback function?
paul
793
votes
83 answers

What are the lesser known but useful data structures?

There are some data structures around that are really useful but are unknown to most programmers. Which ones are they? Everybody knows about linked lists, binary trees, and hashes, but what about Skip lists and Bloom filters for example. I would…
f3lix
  • 29,500
  • 10
  • 66
  • 86
792
votes
6 answers

How do I determine whether my calculation of pi is accurate?

I was trying various methods to implement a program that gives the digits of pi sequentially. I tried the Taylor series method, but it proved to converge extremely slowly (when I compared my result with the online values after some time). Anyway, I…
Ishan Sharma
  • 6,545
  • 3
  • 16
  • 21
780
votes
50 answers

Should a function have only one return statement?

Are there good reasons why it's a better practice to have only one return statement in a function? Or is it okay to return from a function as soon as it is logically correct to do so, meaning there may be many return statements in the function?
David
  • 14,047
  • 24
  • 80
  • 101