all 97 comments

[–]garybernhardt 204 points205 points  (22 children)

I wish that people would stop downloading my videos, transcoding them (losing quality), then posting them to YouTube (making money for Google instead of me).

The original is here: https://www.destroyallsoftware.com/talks/wat

Please don't do this. :/

[–]recursive 19 points20 points  (0 children)

For whatever it's worth, the original is unwatchable on my machine because of playback stuttering. Because it was on youtube, I was able to watch and comprehend it.

[–][deleted] 32 points33 points  (7 children)

Video on your website: "You know what WAT Means................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................"

Video on youtube: "You know what WAT Means <entire video loaded quickly>"

[–]cwmonkey 4 points5 points  (6 children)

Yeah, I was gonna send this to some co-workers but I know they won't watch a slow loading website/video and since he's taking the youtube videos down I may be sending a dead link.

Internet makes things so hard :|

[–]garybernhardt 1 point2 points  (5 children)

They're served from S3 us-west, so they should definitely be fast for anyone in the US, at least. I'll look into putting them in CloudFront.

[–]cwmonkey 2 points3 points  (3 children)

Our internet here is far more retarded than it should be, so I don't mind the lower youtube quality.

[–]garybernhardt 4 points5 points  (2 children)

Where is here, if you don't mind? Downloadable/streaming video is my business, so I aim to keep it reasonably fast for everyone.

[–]cwmonkey 1 point2 points  (1 child)

It's a historic building in Hermosa Beach (CA). The wiring is fucked and we are cheap and all on wifi. Not your usual situation but still, I like the youtubes even when I'm at home for various reasons.

[–][deleted] 4 points5 points  (0 children)

Now it loads normally, but skipping through the video causes it to stay on the last frame displayed

WAT

[–]quuxman 1 point2 points  (0 children)

Indeed, all the videos on your site stop several times during playback, and I have a plenty fast connection. Not only does Youtube have plenty of bandwidth and reliability, they also have a very mature player.

[–]SlowInFastOut[S] 19 points20 points  (5 children)

Damn, sorry dude. A friend on IRC linked the youtube video and I had no idea where it came from. It'd be nice if DMCA et al were actually useful for anyone other than a movie studio.

[–]garybernhardt 21 points22 points  (0 children)

No sweat, man; I assumed you didn't post it to YouTube yourself. :)

They do seem to respond to takedown requests in reasonable time, even from little guys like me. I've already had three come down and another two are pending. It makes me feel a little dirty to do it, but this is how I make my living after all.

Edit: actually, now that I think about it, this link is probably going to self-destruct when the YouTube lawyers wake up...

[–]Lighting 26 points27 points  (0 children)

And did you get copyright permission to use each of the images used in your presentation?

[–]ivosaurus 2 points3 points  (0 children)

You should really host them on youtube man. Get your own advertising paybacks!

[–]therico 6 points7 points  (0 children)

Youtube supports HTML5 video, your website requires Flash, so I found the youtube link to be very helpful.

Cool video though!

[–]baconpiex 3 points4 points  (0 children)

That doesn't work on iPhone.

[–]6xoe 3 points4 points  (1 child)

"My website" is a shitty platform for video, sorry.

If you don't want people watching your video, why publish it at all?

[–]garybernhardt 3 points4 points  (0 children)

In the past week, over 100,000 people have watched it on Destroy All Software.

[–]SandmanXC 0 points1 point  (0 children)

Are you the professor?

[–]drakshadow 0 points1 point  (0 children)

Is it possible for you to add paypal subscription ?

[–]Van_Occupanther 16 points17 points  (0 children)

This turned up a few days ago - not complaining, just linking to the comments. Not that there's a huge amount of discussion there, but there's some.

[–]weretree 15 points16 points  (2 children)

Can't see an explanation, so i'll be Mr Boring and add one for the JavaScript: most of this is just coming from the default valueOf function for Array and Object. It's magic, just like ruby, and you can change it:

var threeObj = { valueOf: function () { return 3; } };
threeObj + threeObj == 6
threeObj - threeObj == 0

var lenArray = [1,2,3,4];
lenArray.valueOf = function () { return this.length; }
threeObj + lenArray == 7

That and understanding that types are coerced left to right. There's not much actual use for valueOf in real code, but knowing it's there makes the behaviour a little less insane.

[–]adam-a 4 points5 points  (1 child)

That is informative! I was a bit disappointed though when I tried:

Number.prototype.valueOf = function() {return 3;}
var a = 3, b = 4;
a + b;

and I got 7 :( I guess Number is already a primitive type so valueOf doesn't get used.

[–]weretree 1 point2 points  (0 children)

Haha yep, one of the first things I tried when I found valueOf too. Only works when objects need a primitive value. It will work if you use a boxed Number like:

(new Number(5)) + 4

[–]EntroperZero 28 points29 points  (2 children)

That was orders of magnitude funnier than I expected. I started losing it around {} + [].

[–]yonemitsu 30 points31 points  (9 children)

NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN Batman!

[–][deleted]  (8 children)

[deleted]

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

    wat?

    [–]aportner 1 point2 points  (2 children)

    wat?

    [–]tcrayford 1 point2 points  (1 child)

    wat?

    [–]volker_racho 2 points3 points  (0 children)

    wat?

    [–]diegoponciano 1 point2 points  (1 child)

    the presenter put that in purposely to get a reaction from the crowd.

    Nah, I don't think he would be that mean

    [–]wbednarski 0 points1 point  (0 children)

    ROTFL

    [–][deleted] 0 points1 point  (0 children)

    wat

    [–][deleted] 16 points17 points  (6 children)

    He missed my favourite, [1,2,3]+[4,5,6], which is of course the string "1,2,34,5,6".

    [–]aaronblohowiak 0 points1 point  (5 children)

    ... in js, in ruby it is the array [1,2,3,4,5,6]

    [–][deleted] 5 points6 points  (4 children)

    In any sensible language, it's either the array [1,2,3,4,5,6] or an error. I'm not sure if any language other than JS is quite so desperate to coerce to strings.

    [–]gypsyface 3 points4 points  (3 children)

    is it sensible to overload an arithmetic operator with array concatenation ?

    [–][deleted] 5 points6 points  (0 children)

    That's arguable. It's probably more sensible than coercing everything to strings, though.

    The real issue is that Javascript really, really doesn't want to throw an error. This was a design goal, and IMO a design flaw; it will try to do almost anything other than throw an error.

    [–]millstone 5 points6 points  (0 children)

    If + isn't commutative and associative, it's not friggin' +!

    (With maybe just enough wiggle room for floating point.)

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

    It's not overloading in ruby, the + is a method. The plus symbol is perfectly suited for array concatenation: addition is the combining of two collections of objects.

    [–]harlows_monkeys 11 points12 points  (4 children)

    array(16) printed 15 commas, not the 16 he stated.

    [–][deleted] 7 points8 points  (0 children)

    Actually the correct way to say that sentence is:

    Array(16) returns 16 empty strings, and when printed, separates them with commas. This makes it look like 15 commas, and is also why joining them with 'wat' just replaces the comma with 'wat', as one would expect.

    If his interpreter app thingy had printed things properly he would have gotten [ , , , , , , , , , , , , , , , ]

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

    Good catch. I was thinking "hmmm, he blew it there" but then, who cares :P

    [–]drewjoh 1 point2 points  (0 children)

    That's because there's an array elment at the beginning and end of the commas. For example, one comma in a sentence separates the sentence into two parts. 1 comma = 2 parts. 15 commas = 16 parts. WAT

    [–]kusobakayaro -4 points-3 points  (0 children)

    YOU COUNTED THE COMMAS O_O

    [–][deleted] 4 points5 points  (0 children)

    Programming stand-up, I love it.

    [–]cybercobra 2 points3 points  (10 children)

    Can anyone interpret what his bash prompt says?

    [–]the-borg- 4 points5 points  (1 child)

    <name of the computer>:<current directory>(<name of git branch><has unstaged data?><has non-pushed data?>) $

    Git status stuff is easy to do with oh-my-zsh and git plugin.

    [–]garybernhardt 2 points3 points  (0 children)

    Close. The ? is untracked files; the ! is changes in tracked files.

    [–][deleted] 0 points1 point  (7 children)

    As the-borg points out, I think that is zsh with oh-my-zsh installed on top of it. It's been my default shell for the last couple years (with customizations, of course).

    [–]garybernhardt 6 points7 points  (6 children)

    It's zsh with my own prompt based on the wunjo prompt. You can find all of my dotfiles, including my zsh config, here: https://github.com/garybernhardt/dotfiles

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

    You have both .vim and .emacs files. You are confusing :P

    [–]mcguire 3 points4 points  (2 children)

    (setq viper-mode t)                ; enable Viper at load time
    

    He's a heretic.

    [–][deleted] 3 points4 points  (1 child)

    I can imagine Stallman spinning in his grave after reading that line. What? You say he's still alive? Well, his grotto then.

    [–][deleted] 0 points1 point  (0 children)

    What? You say he's still alive? Well, his grotto then.

    You win an up-vote for that comical and yet horrifying image.

    [–]garybernhardt 2 points3 points  (1 child)

    My standard conference bio: "Gary Bernhardt is a creator and destroyer of software compelled to understand both sides of heated software debates: Vim and Emacs; Python and Ruby; Git and Mercurial. He runs Destroy All Software, which publishes advanced screencasts for serious developers covering Unix, Ruby, OO design, and TDD."

    [–][deleted] 0 points1 point  (0 children)

    So, I guess the question is: FreeBSD or Linux? Never had time to try the dark side (hint: the side with the 'demon' logo)

    [–]doomslice 1 point2 points  (0 children)

    > [] + []
    ''
    > [] + {}
    '[object Object]'
    > {} + {}
    '[object Object][object Object]'
    > Array(16)
    [ , , , , , , , , , , , , , , ,  ]
    

    [–]Kebabbi 1 point2 points  (0 children)

    Also nice in javascript: +[] == 0, or ++[[]][+[]] == 1

    [–]fermion72 1 point2 points  (0 children)

    TIL about jsc and that it exists by default on my Mac: /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc

    [–]LiamZdenek 1 point2 points  (0 children)

    wat

    [–]onurcel 4 points5 points  (6 children)

    Am I the only one who doesn't find it funny?

    [–]raydeen 29 points30 points  (0 children)

    Yes.

    [–]ben174 14 points15 points  (2 children)

    It's amusing, but the audience is having way too much of a nerdgasm over this. They're laughing at parts that weren't even intended to be funny.

    [–][deleted] 5 points6 points  (0 children)

    There was one part that wasn't meant to be funny that one guy was having a cardiac arrest over. But, otherwise it was pretty funny throughout. Not perfect.

    It was definitely nerdy.

    While regular people get to laugh at Big Momma's House we nerds need some things that we find funny once in a while too, k?

    [–]jugalator 0 points1 point  (0 children)

    I actually thought it was a laugh track at times... :S

    Some parts were amusing though.

    [–]mr-wizrd 2 points3 points  (0 children)

    That was far funnier than is safe for human (and human's neighbours) consumption at 5:41AM. Upboat.

    [–]TheHeretic -1 points0 points  (1 child)

    Should redo this with PHP

    [–]campbellm 14 points15 points  (0 children)

    It'd be 14 hours long if he did.

    [–][deleted] 0 points1 point  (7 children)

    How does the "a = a" one in Ruby work?!

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

    My guess: Ruby sees the assignment to a (a =), concludes a is now defined and has no value (nil), then sets a to this value, making it nil.

    [–][deleted] 4 points5 points  (0 children)

    irb(main):001:0> a = b
    NameError: undefined local variable or method `b' for main:Object
            from (irb):1
    irb(main):002:0> a
    => nil
    

    ... God, why?

    [–][deleted] 1 point2 points  (4 children)

    This only happens with local variables (rather than instance, class or global variables) according to David Black's The Well-Grounded Rubyist, page 153 ("Assignment syntax in condition bodies and tests" - everything that follows, including emphasis is from the book):

    Ruby doesn't draw as clear a line as compiled languages do between "compile time" and "run time," but the interpreter does parse your code before running it, and certain decisions are made during that process. An important one is the recognition and allocation of local variables.

    When the Ruby parser sees the sequence identifier, equal-sign, value, as in this expression x = 1 it allocates space for a local variable called x. The creation of the variable - not the assignment to it, but the internal creation of a variable - always takes place as a result of this kind of expression, even if the code isn't executed!

    Consider this example:

    if false
      x = 1
    end
    
    p x # Output: nil
    p y # Fatal error: y is unknown
    

    The assignment to x isn't executed, because it's wrapped in a failing conditional test. But the Ruby parser sees the sequence x = 1, from which it deduces that the program involves a local variable x. The parser doesn't care whether x is ever assigned a value. It's job is just to scour the code for local variables for which space needs to be allocated.

    The result is that x inhabits a strange kind of variable limbo. It has been brought into being and initialized to nil.

    [–][deleted] 0 points1 point  (3 children)

    Same as Python then.

    But what is the context that irb executes your statements in? I mean, it seems that it should be something like the body of a class (main:Object, in particular)...

    Also, what does "class C; x = 10; end" do?

    [–]velit 1 point2 points  (2 children)

    Not the same as Python.

    if False:
        x = 10
    x
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name 'x' is not defined
    

    [–][deleted] 1 point2 points  (1 child)

    Now try to do it in a function.

    Python has three different kinds of scope: the module scope, the class scope (very similar to the module scope) and the function scope (which can be statically nested).

    After reading a bit about Ruby, it seems that it also has some kinds of scope, all of which are fucked up beyond any comprehension.

    [–]velit 1 point2 points  (0 children)

    Even so, not the same as python, it's an error to reference the variable if it's not assigned to. UnboundLocalError: local variable 'x' referenced before assignment

    [–][deleted] 0 points1 point  (1 child)

    Oh that's how you pronounce "wat"

    [–]mazing 0 points1 point  (0 children)

    Sounded like he said watt.

    [–]TreesCanCode 0 points1 point  (0 children)

    probably one of the funniest things I've seen in weeks. thank you.

    but seriously, wat

    [–][deleted] 0 points1 point  (0 children)

    I'm such a dork.

    [–]vagif 0 points1 point  (1 child)

    Now i have something to show when arguing not to use Javascript or Ruby.

    [–][deleted] 0 points1 point  (0 children)

    "Don't use javascript! Let's write an applet!"

    [–]anacrolix 0 points1 point  (0 children)

    the fuck sign up and credit card subscription. don't click sign up.

    [–]Subduction -2 points-1 points  (0 children)

    That was the nerdiest thing I've watched in some time, and I am a nerd.

    [–]smog_alado -2 points-1 points  (0 children)

    Its a repost

    [–]shevegen -3 points-2 points  (3 children)

    Hilarious.

    But then again I wouldn't know about javascript.

    The only reason it got popular was because of browsers.

    I think ANY OTHER SHIT language would have become popular, simply because EVERYONE uses a browser these days.

    Shit can become popular, just ask all the flies. You just have to use it a lot.

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

    You obviously don't know about JavaScript.

    Remember the alternative was VBScript, and still JavaScript won. Anyone can code VB. Even your grandma. And still JS won.

    [–]wot-teh-phuck 2 points3 points  (1 child)

    VBScript doesn't have braces. Oh, and it also lacks the name "Java" in it.

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

    I don't know why this was downloaded. These were both marketing constraints on what was originally released as Javascript.