As I’m programming I haven’t seen an instance where an array is better for storing information than another form thereof. I had indeed figured the added “features” in programming languages had improved upon this and by that replaced them. I see now that they aren’t replaced but rather given new life, so to speak.
I saw this on Reddit, and the reaction wasn’t kind. Most of the discussion centered around how it was such a dumb question, and what is it that has failed in our educational or professional communities that such basic knowledge isn’t known. My initial reaction, unfortunately, wasn’t much different.
But then as I thought a little more about it, I realized it really isn’t such a dumb question. I found I really don’t use arrays in Erlang, they aren’t necessary. In C and C++, I used them all the time, you pretty much have to. But in Erlang, lists rule the day. Erlang has facilities for arrays, but the closest thing I use is small fixed-sized tuples. It’s weird, but until just now I never really noticed how little I use arrays any more. The only place I can think of ever using them in Erlang is in the CouchDB btree code for doing binary key searches.
The truth is, unless you are doing low level programming, arrays (or even vectors) are rarely necessary or even optimal for most coding problems. The most notable feature of arrays are constant time access to any value given it’s ordinal key. The problem is few programming problems call for a structure that gives them constant time access to ordinal mapped values. Most uses of arrays are just as a collection of values, and can be better satisfied with a list.
Categories: Blogs Damien Katz
Erlang on Twitter
» VinodShintre (Vinod Shintre): How and Why We Switched from Erlang to Python http://t.co/9jpvH6VH5Z #attribo
How and Why We Switched from Erlang to Python http://t.co/9jpvH6VH5Z #attribo
» MadelynGary (MadelynGary): Feel close confirmed measure time gear pertinent to erlang woof interlude http://t.co/1oqrQBl5og
Feel close confirmed measure time gear pertinent to erlang woof interlude http://t.co/1oqrQBl5og
» auroberjo (John Roberts): How and Why We Switched from Erlang to Python at Mixpanel Engineering http://t.co/RUWgrnjiji
How and Why We Switched from Erlang to Python at Mixpanel Engineering http://t.co/RUWgrnjiji
» yuxhuang (Yuxing Huang): @gokeeper wish you could do apt-get install erlang?
@gokeeper wish you could do apt-get install erlang?
» BlackBerryOS6 (BlackBerry OS 6): Présentation du langage Erlang | Blog MTI
Présentation du langage Erlang | Blog MTI
» qwmp (QWMP - Chaotic): … because they do not know Erlang very well.
… because they do not know Erlang very well.
Number of aggregated posts: 10648
Most recent article: May 14, 2013
» Moraru on This is Why You Spent All that Time Learning to Program: It is true that computer science was a pain in the back at time that i’ve had to learn it…
» Commercial hand dryers on Couchbase Meetup at new HQ: Buy online from here where you will get so much of variety in Commercial hand dryers for people. If you…
» Fort McMurray Homes on Motivated Reasoning and Erlang vs Python vs Node: I don’t really understand why this post is motivational? I don’t even see a post, just a title. Fort McMurray…