Hacker News new | ask | show | jobs
by omnigoat 6032 days ago
I do believe this is why my university teaches Java for one year, then C for the second, before you even get to glance at (C++|Python|Perl|C#|other). I'm a compiler-writer, and we don't need different names - they have well defined meanings. What we need is people to stop misusing them. You've done it yourself, because C doesn't have pass-by-reference. C++ does (ie, references...), but C does not. Stop doing it! Stop misusing those terms! You just read an article that actually spelled it out, and still misused them!
3 comments

Redefining terms that have precise meanings into terms that have imprecise meanings based on vulgar precedent is a symptom of a pop culture. Cue Alan Kay quote in 3, 2, 1, ...
If it's a symptom of pop culture, then why is Middle English different from Old English?

It's a symptom of language, and it's impossible to stop.

To answer your (clearly rhetorical) question: Because language is the ultimate pop culture medium.
"In the last 25 years or so, we actually got something like a pop culture, similar to what happened when television came on the scene and some of its inventors thought it would be a way of getting Shakespeare to the masses. But they forgot that you have to be more sophisticated and have more perspective to understand Shakespeare. What television was able to do was to capture people as they were.

So I think the lack of a real computer science today, and the lack of real software engineering today, is partly due to this pop culture."

Full conversation: http://queue.acm.org/detail.cfm?id=1039523

Blah blah blah.

In Shakespeare's day, his plays were ribald entertainment for the masses. People are continuously complaining about how the old ways were better, and one is entitled to one's opinion, but the old ways are in the past and gone. Soon the last person who remembers them will be dead and there will be no one to complain about it, so what's the point?

Wow, that's one of the most pretentious paragraphs I've ever read. I mean, let's use the exact same argument, swapping television for books:

"In the last 25 years or so, we actually got something like a pop culture, similar to what happened when widespread literacy came on the scene and some of its perpetrators thought it would be a way of getting the Bible to the masses. But they forgot that you have to be more sophisticated and have more perspective to understand the Bible. What books were able to do was capture people as they were."

Except, historically that's absolutely wrong. Since the advent of printing, the Bible has been the most widely published book in the world because the masses, as they are, have historically been religious people.
OT: I did find it very interesting to learn that the second most popular book (up to the beginning of the twentieth century) was Euclid's The Elements after the printers were done pressing bibles.
The word 'reference' have precise meanings both when taking about references to objects in Java and when taking about pass-by-reference vs pass-by-value in function call semantics. But it is two different meanings.
Python, for one, doesn't help to make the matter any clearer. In fact, Python makes it look like pass-by-reference is used, even when it isn't.

For a better explanation than I could ever come up with: http://stackoverflow.com/questions/986006/python-how-do-i-pa...

Just to play devil's advocate: if it looks like a duck and quacks like a duck, why would I call it anything other than "duck"? It may be technically correct to say that (in Python, at least) everything is passed by value. But if it helps someone remember that lists may be altered when passed to a function and that tuples can't, what's the real harm?

Again: devil's advocate.

It is just the terminology that is confusing, because the word 'reference' has a different meaning when talking about parameter passing semantics, than when talking about references to objects.

The Effbot suggest we call Python call semantics for 'call-by-object-reference' http://effbot.org/zone/call-by-object.htm which makes it a lot clearer.

I think it's really important to understand why tuples can't be modified and lists can. If you explain it away with something factually incorrect about pass-by-reference, your doing a real disservice to whomever you are teaching.

After all, the issue here has nothing to do with parameter passing and everything to do with object design. It's important to understand that tuples are truly immutable and what the implications of that is.

Misuse of tuples and lists are one of the biggest problems I see in novice (and often not so novice) python code. How often do you see someone copying tuples (often inadvertently) when list semantics are far more efficient? That stems from a fundamental misunderstanding of immutability, something that might stem from not understanding how parameters are truly passed in the language.

Because it means they don't understand what's going on in the language runtime. That is, it betrays ignorance.
Meanings are only well-defined in their particular contexts.
In this case, the context is "programming languages." The term has a very well-defined meaning for all lanugages.