It similarly uses quotes from Sagan's audiobooks, but combines it with the Lost soundtrack (which fits surprisingly well), and footage from Discovery and the BBC. Really great stuff!
I reason I think this discussion is ever a problem is because in C++ "pass-by-value" has an extra meaning: that a deep copy occurs. There's no precise term for this, so people started (incorrectly) using "pass-by-reference" to talk about parameters that don't get deep copied. After all, in languages that do it right (Java, Ruby, Python, CL) there's only one parameter passing technique, and therefore no reason to make the distinction.
There is a precise term for that and you said it - pass-by-value. Recall that somewhere each language turns into assembly and that in order to pass a value to a subroutine you must either place values into registers or push the data of the object you are passing onto the stack. Passing by value is desirable if you want to make sure that your local value is not modified. This gives the called function the freedom to modify it without worrying about side effects and without worrying about explicitly calling a copy constructor. Pass-by-reference comes from C++'s pass by reference, which is really just some sugar around passing a pointer by value and referencing it with the * operator in the function body (hence reference passing).
I disagree that there is a right or wrong to this - C++ was made to be a generic programming language and thus gives many options to the programmer. If by "do it right" you meant "hide all options except the one most commonly used" okay. Otherwise I strongly disagree with that sentence especially because I use different kinds of "pass-by" whenever I program in C++ and will be using rvalue reference from the C++0x. Different languages suit different needs.
Well the term is not very precise if the way that you're using it and the way the article is using it are completely different. The article makes it clear that the term "pass-by-value" refers to the fact that the callers' references cannot be unseated by the function call; but it does not mean deep copies are made, like by copy constructor, hence that's why it applies to Java. Allow me to illustrate:
vector<int> numbers;
void f(vector<int> args);
Due to C++'s copying, args[0] has a different address than numbers[0], because a deep copy of the vector was made. As the article states, this is not what pass-by-value is referring to, otherwise it would be false that Java / Python / Ruby et al are pass-by-value. So I disagree that the terms are clear, but rather that there is confusion around these terms. As for wanting immutability, it's almost always better for C++ code to write functions not like f but instead like this:
void g(const vector<int>& args);
And apologies for the editorializing, but I do consider this a language design flaw, one inherited from the backwards compatibility for C, which already allowed struct's to be passed (non-pointer) as args and then copied to keep the caller untouchable. It makes C++ code more verbose and more error prone, and is quite difficult for new programmers to grasp.
The value being passed in java is the value of the pointer, where the original pointer value cannot be changed by the function. This is pass-by-reference. Think of pass-by-reference as a special case of pass by value where the value of the pointer to an object is passed rather than the object itself.
If I wanted to write a function that accepted a vector and returned a slightly altered version of that vector I would make a function that does a deep copy and would return that - without ever needing to call the copy constructor myself. I think that it is nice that C++ gives me that option. I don't think that any language is flawless and it's clear that one programmer's feature is, in this case, another programmer's flaw. Keep in mind that this applies to your favorite languages as well.
Edit:
It occurs to me that the distinction is important in multithreaded programs as well. Beyond just worrying about whether or not the underlying data structure is thread safe, passing something by reference might mean sharing memory between two CPUs which can easily lead to a slowdown as the CPUs need to repeatedly flush and resynchronize what's in their cache. Thus unless I have specifically built a thread-safe class whose data has a real need to be shared between between threads I would send data from one thread to another by value rather than by reference.
You just described why I believe pythons 'implicit is always better than explicit' is the most important language design fundamental ever conceived of.
The problem with the C++ approach is that it's default (pass by copy-constructor really) is rather implicit. Your doing a potentially a ton of work with a very innocent function call, with possible side-effects. At least the 'pass a reference by value' behaves the same way EVERY time.
For example, in C++:
myobj a;
somefunction(a);
That copy constructor might trigger a database hit to create a new object if myobj was some sort of ORM. It might call 23 other constructors to fully complete it's deep copy. Who knows, as it all happens rather implicitly. In python, that would look like:
a = myobj()
somefunction(a)
def somefunction(p):
p = copy.deepcopy(p)
In that version I'm now implicitly providing that copy. In your multi-threaded example this is still better, as I get the best of both worlds. Ya, I might lose a bit of convenience... but that explictness is worth the trade-off IMHO.
It's not a bubble, the product just became obsolete with newer technology and demand for industry slacked with internet marketing. CDs were (and still are to some extent) a fantastic media for storing music, but mp3 has huge advantages.
The late 90s was also the end of the pre-internet era, where the dominant way to market music was radio, TV, and print. In 1995 you had to try hard to discover music outside the mainstream. In 2005 you could go to MySpace and listen to an hour of music without ever hearing a top 40 song.
Well, there was a period when CD's were the cool new thing and everybody was buying all their record collection on CD again.
So, not only the labels were selling music by new artists at their usual pre-Internet levels, but there was also a big demand for old music in CD format. I suspect many older people that would not usually buy new music ended up buying many of their old albums again.
The question they must be asking themselves is how to repeat the bubble. The last one came from instituting a new technology which (in the popular imagination) rendered the old technology obsolete, and triggered a lot of repurchases. What kind of disruptive force, if any, could trigger this again?
> Obviously the answer was MP3s, but I think they might have missed the boat there...
The problem was that it was too close to their current bubble at the time. These are the kind of things that large businesses try to artificially separate out so that they can maximize profit. Why bring in a new technology now when I can wait until later and make more money in the interim?
I don't know if that's entirely true - it's tough to tell without including 'illegal' dowloads in this chart, which is equally difficult to accurately measure against the RIAAs sales data.
However, it is very interesting to not how Vinyl, Cassettes and CDs all dovetail into each other nicely. I would be willing to bet that the rise of mp3 downloads and the decline of CDs would dovetail equally as well.
The problem was, I think, the mp3 wasn't a media format invented by/for the music industry.
You can't include 'illegal' downloads in there. Something that is free doesn't have the same market pressures as something that costs money.
If I download music illegally, I can download GBs upon GBs of music which would cost me thousands of dollars were I to purchase it. What if I don't have those thousands of dollars? It's not like you can say that I would have bought all of those albums if it was impossible to pirate and then add the thousands of dollars to 'lost CD/Legal Download Service sales.'
No doubt. I don't disagree with that, as old as the argument is, but it would be interesting nonetheless to see how the rise of downloads dovetails with the decline of the CD format. If it's an even flow from CD to mp3, as it appeared to be with vinyl>cassette, then cassette>cd, or if it's disproportionate. It would actually go towards supporting or disproving your very argument.
However, I don't think there will ever be any trustworthy comparison like this, as the number of downloaded tracks was never reliably tracked in a manner that would be comparable to the RIAA unit sales data. Even if you could estimate the number of tracks downloaded, it would end up including things the RIAA doesn't include, like mashups, indy tracks, concert bootlegs, simpson quotes, etc.
To continue that train of thought it would be interesting to see a similar data visualization of consumption of all entertainment mediums (dvd video,blu ray video,video rentals,video games,video game rentals,etc) including piracy of those mediums as well.
I have a feeling that (other than the 'legal' vs 'illegal arguments) it would be very telling of the way that media consumption habits have trended over the past decade or so.
There was no bubble.. just a market whose time has come and gone, much like the fabled buggy-whip.
The record industry (as opposed to the music industry) was a 20th century anomaly. Prior to the invention of the gramophone, music was largely a participatory affair.. singing to pass the time while working, to celebrate at a social function, to amuse and entertain friends and family and to pass on folklore from generation to generation.
The record as a social object and the idolatry of the rock star were temporary aberations.
The live performance end of the music industry will likely survive, but once all the big stars of the last few decades die off, even that will likely shrink dramatically in size.
I've heard from a few family members that ever since they've started using their cell phones, they can't remember anyone's numbers, and they felt this was making them stupider. As if memorizing sequences of 7 digits is desirable and conducive to being intelligent. I tried explaining that they shouldn't have to memorize phone numbers - they don't represent anything real, they aren't convenient, and there's no advantage to using them. It's much easier to put a number in your Contacts list and reach someone using their name instead, at which point the technology is strictly empowering, and like TFA says, the number is just for backwards compatibility.
Remembering numbers is a form of mental exercise that we used to engage in regularly, and as exercise it was good for the brain, just like stretching.
You seem to have the implicit model where the less we burden the brain with mundane tasks, the better, as if we had a fixed daily capacity for thought, or that mundane tasks are somehow wasteful.
I'm not sure this is the case--neither that mundane applications of brainpower is burdensome, nor that capacity is fixed.
I suspect that someday, after more and more mundane mental tasks are replaced by more automation and better design, a market will emerge for mental fitness clubs to help thin the "fog" that will come to characterize our mental lives..
Remembering numbers is a form of mental exercise that we used to engage in regularly, and as exercise it was good for the brain, just like stretching.
You seem to have the implicit model where the less we burden the brain with mundane tasks, the better, as if we had a fixed daily capacity for thought, or that mundane tasks are somehow wasteful.
I'm not sure this is the case--neither that mundane applications of brainpower is burdensome, nor that capacity is fixed.
I suspect that someday, after more and more mundane mental tasks are replaced by more automation and better design, a market will emerge for mental fitness clubs to help thin the "fog" that will come to characterize our mental lives..
The brain does have a fixed daily capacity, but it is far higher than what we use in average.
My prick with phone numbers is not that remembering them on itself is wasteful, but simply that people seem to change phone numbers so often (due to lost, broken, change of company, etc) that I stopped bothering to remember them.
Also, I play Sudoku and Dual N-Back in a daily basis to keep my mind sharp.
Point taken, though I do suspect there is a qualitative difference between solving Sudoku puzzles and practicing one's capacity for direct recall. Sudoku is algorithmic--you're focused on how to solve, rather than building up an index of solutions which you would then access by key.
eg, 6x7 is a key, the lookup yields 42, and you could work it out algorithmically, and that might include methods like "type expression into Google", but imagine if that was all you knew. No index of multiplication tables in your head. When you skimmed a text, your eyes would gloss "6x7" as "multiplication product--undetermined". There might be a pointer to a method to get the answer, but the answer itself wouldn't be directly available. It could be quite crippling.
Similarly with language: our facility of direct recall, our capacity for internalization, makes communication possible. If you are consciously working through the grammar that gives meaning to a phase, you have lost the discussion.
In programming, we get so much mileage out of the "how" that the "what" becomes incidental. Our mental map is a map of methods, where return values only persist long enough to call the next method. We know how we got there, but hardly remember any landmarks along the way.
So with phone numbers, we have lost one more opportunity to train and practice our capacity to create mental indexes to actual data. Why remember one number when you can remember how to get all numbers with less effort? Why store multiple keys when a single function will do?
People once developed algorithms to create vast mental indexes, eg. method of loci. One could commit incredible volumes of information to memory with such techniques.
Now compare that to the modern person w/ lazy evaluation in place of memorization. In memorization, lookup costs are zero. Consciousness stays focused on the matter at hand. Supporting data is pulled up as needed. Without memorization, consciousness must make repeated detours to supply the supporting data, or gloss over it all together.
I'd suggest that mastery of a subject occurs when consciousness can stop making these detours. When you know the behavior of various programming constructs by heart, you can stop checking the reference documentation at every turn.
So in aggregate, if you no longer know any phone numbers by heart, you may indeed be getting dumber.
The problem is that there are lot of situations where you need to make a phone call with a phone that isn't yours. Most common one, especially with modern smartphones, is that your phones battery is dead. In such situations its helpful to remember phone numbers.
The problem with not memorizing phone numbers occurs when you don't have your contacts list with you. Automatic synchronization of your list to multiple places is a partial solution.
I'm one of those few people who completely hated Primer. I found it to be masquerading poor narrative as intellectual mystery. It's possible to present an intricate, complex logic puzzle as story without being totally incoherent, but Primer doesn't even bother.
For a movie that matches Primer in everything it does right, but none of what it does wrong, check out Timecrimes (Los Cronocrimenes). It is far superior.
It similarly uses quotes from Sagan's audiobooks, but combines it with the Lost soundtrack (which fits surprisingly well), and footage from Discovery and the BBC. Really great stuff!