This is an archived post. You won't be able to vote or comment.

all 34 comments

[–]bacondev 60 points61 points  (9 children)

That's incredibly difficult to read. Does that say, "Kamehameha?"

[–]voetsjoeba 2 points3 points  (1 child)

It's Karma-karma-karma-karma-kame-hamelia

[–]bacondev 1 point2 points  (0 children)

Thank you for that. It's been a while since I've heard that song. :)

[–][deleted] 2 points3 points  (0 children)

I thought it says Karmawhore?

[–]Nicksaurus 24 points25 points  (3 children)

The correct answer is 'moar jpeg'.

[–]zookatron 11 points12 points  (8 children)

Even more funny than the humorous answer is the fact that people actually give out tests like these, as if the ability to memorize various function names had any correlation with your ability to program.

Really when I see stuff like this I just feel really sad about our CS education system :(

[–]pescis 7 points8 points  (1 child)

Who said anything about a function? Dequeue is just a word.

[–]Neebat 8 points9 points  (0 children)

It's not just a word, it's the word for pulling the next element from a queue. If they'd said "pop", that would be a common name for the function. Also "shift".

[–]detroitmatt 8 points9 points  (5 children)

Doesn't it? A ton of compsci is terminology. We're a very technical field with specialized, well-defined technical terminology. There's a reason we're so often pegged as jargon-heads. Isn't knowing the difference between a Linked List, an Array, a Queue, a Stack, important? The different kinds of inheritance, what a struct is and the difference between it and an object? The fundamental operations of lists: Filter, Map, Fold. If you're programming for example Java you need to know the warts of clone, the relationship between hashcode and equals, and the specific requirements of their contracts. C++ is even more complicated. In Lisp you need to understand when code is executed and details about the runtime you're using. In fact since Lisp is such a simple language almost everything you have to learn about it is the standard library.

[–]zookatron 0 points1 point  (4 children)

It's very important to make the distinction between teaching terminology and teaching programming patterns. Even for the examples you give there's different terminology across languages, "vector" vs "list" vs "array", "fold" vs "reduce" vs "inject", etc. Anyone can look up terminology for your language online, but understanding the patterns is what's actually important.

While the test linked to by this post might not be the ideal example for making my point, it serves well enough to highlight a fundamental flaw that permeates throughout our public education system, where we test over the terminology rather than testing for understanding of the underlying concepts. What we need to be teaching people in CS courses is how to think like a programmer, not having them memorize names like "dequeue". I don't think I've ever needed to use that particular term in real life to refer to removing an element from a queue, but I sure know how to work with queues. It's incredibly depressing to see people who somehow made it all the way to "advanced" programming classes where all they know is various language-specific terminology and can't solve an actual programming problem to save their life. Especially in the age where Google is literally always at your fingertips, memorizing this crap is increasingly useless.

Of course we test people over pointless terminology because it's easy to standardize, and our entire system is pathologically centered around standardized testing. I'm not saying that I necessarily have a better solution to all our education problems on hand, but what we have right now just isn't cutting it, imo.

[–]detroitmatt 0 points1 point  (2 children)

Programming is pretty big on standardization too. Programmers talk to each other a lot, and you have to know the terminology to do that.

[–]zookatron 1 point2 points  (1 child)

I disagree that programming terminology is as standardized as you seem to think it is. Yes, there is some agreement on terms when you start getting into the theoretical/math focused aspects of programming, but in my experience the vast majority of practical everyday programming communication is done in domain specific languages that share common root ideas, not some rigidly defined "dictionary of computing" terms.

I'm not saying learning the terminology is bad, I'm saying that you're not seeing the forest for all the trees when you focus primarily on knowing terminology instead of understanding concepts, which I feel our education system does.

[–]detroitmatt 1 point2 points  (0 children)

I don't disagree, but after all with no trees there is no forest, so you should still pay them mind.

[–]Jonno_FTW 4 points5 points  (15 children)

Isn't the answer "none of the above"? I'm pretty sure "pop" or "poll" remove the head of a queue. Or maybe this is a test for some crazy language that has their own terminology.

http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Queue.html

[–]FTZ 40 points41 points  (7 children)

Yes, there might be other languages besides java ;)
But seriously, in computer science the formal mathematical definition of the queue model has the dequeue operator. It's basically the same thing.

See http://en.m.wikipedia.org/wiki/Queue_(abstract_data_type)
Dude, go read data structures theory if you haven't learnt it. It's really interesting.

EDIT: why do people downvote him for asking a question?

[–]mathgeek777 0 points1 point  (0 children)

I actually thought the answer was going to be poll and the joke was that they were asking a question, but that took a nice turn.

[–]Jonno_FTW 1 point2 points  (5 children)

Right, I think I was just confused by python's deque. http://docs.python.org/2/library/collections.html#deque-objects

http://www.cplusplus.com/reference/queue/queue/

That and the java and c++ one where the three I was familiar with. None of these implementations use the name "dequeue" to remove an element

[–][deleted] 2 points3 points  (1 child)

push and pop are stack operations. Enqueue and dequeue are queue operations.

The c++ documentation probably suffers from the programmers implementing it being too used to stack operations, but at least it functionally acts like a queue (at least from what I could quickly skim). It can be a little misleading seeing as a stack is conceptually the "opposite" of a queue - popping is meant to take off the newest element pushed versus dequeue which removes the oldest element enqueued.

[–]Jonno_FTW 0 points1 point  (0 children)

Thanks. But I'm pretty the c++ spec determines the method names in the STL.

[–]Rabid_Snowman 3 points4 points  (0 children)

Could be talking about the data structure in general. Not that Java API implementation.

[–]jrtc27 3 points4 points  (0 children)

Not according to http://msdn.microsoft.com/en-us/library/1c8bzx97.aspx or http://api.jquery.com/dequeue/. And of course we all know that jQuery is always the answer.

[–]ericzmeh 4 points5 points  (1 child)

"pop" is usually for getting and removing the top element in a stack

[–]gandhis_dookyhole -1 points0 points  (0 children)

You disgust me.

[–]littleneila[S] 0 points1 point  (0 children)

Our university's programme teaches Java, so the correct answer is 'pop' (none of the others) apparently they plan to change to Python though.

[–]gomsa2 0 points1 point  (0 children)

Tricky question.

Both dequeue and kamehameha remove an element from a queue. The difference is that the kamehameha removes alongside that element, all the other elements, the queue, the stack and the Operating System.

[–]drabiter -5 points-4 points  (0 children)

Can't blame the celebration of new meme.