1
vote
2answers
158 views

Why a hashtable? Why not just a non-hashed associative array?

I've been learning about using a hashtable to efficiently check for items in a list without looping through the whole thing, but there's one thing that I don't get: Why hashed keys? It seems like: ...
0
votes
1answer
134 views

Why is first column of list called 0th in so many languages? [duplicate]

If you want first element of list or array you reference it as 0 in many languages (like C or Clojure). Is there are some really good reasons why the programming languages was design this way? In ...
0
votes
1answer
49 views

Design Pattern : Static Array/List in Class Object

I'm a CS alumni, but we didn't learn much by the way of OOP, or Design Patterns. I've heard the phrase C with iostreams and thought it fitting. Anyway that's besides the point. I am just curious about ...
4
votes
2answers
4k views

Should I use a list or an array?

I'm working on a windows form to calculate UPC for item numbers. I successfully create one that will handle one item number/UPC at a time, now I want to expand and do it for multiple item ...
2
votes
3answers
241 views

What language has integrated “list insertion” as part of code *syntax*?

Many programming languages permit natural manipulation of strings, and some languages permit the manipulations of lists too. More often then not (always?), these operations are done as procedure ...
2
votes
3answers
514 views

Best way to choose random element from weighted list

I want to create a simple game. Every so often, a power up should appear. Right now the different kinds of power ups are stored in an array. However, not every power up should appear equally often: ...
4
votes
3answers
841 views

Lisp: Benefits of lists as code over arrays as code?

Question for lisp programmers: Lisp code is lisp data, usually lists. Is there an advantage to code being lists over code being arrays? Would macros be easier to write/faster to run? You can ...