Discuss Scratch

joefarebrother
Scratcher
500+ posts

What are some funny programming/mathematical jokes?

Found this one on Facebook:



And it was delicious! Play TBGs! Check out my Scheme Interpreter!
;
bharvey
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

Not really fair to Lisp, which is just as much about functions as Scheme, although people didn't realize that right away.

__init__
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

The classic…

I have to say, this is the one I can most relate to.

thisandagain pls explain
joefarebrother
Scratcher
500+ posts

What are some funny programming/mathematical jokes?

bharvey wrote:

Not really fair to Lisp, which is just as much about functions as Scheme, although people didn't realize that right away.
True. and scheme is also just as much about lists/pairs


And it was delicious! Play TBGs! Check out my Scheme Interpreter!
;
Jonathan50
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

What about Self? (Smalltalk, Self and JavaScript are the only languages I know of where everything is an object)

Oh, and some assembly languages don't have any registers.

Last edited by Jonathan50 (June 6, 2016 00:22:14)


Not yet a Knight of the Mu Calculus.
__init__
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

Jonathan50 wrote:

What about Self? (Smalltalk, Self and JavaScript are the only languages I know of where everything is an object)

Oh, and some assembly languages don't have any registers.
If everything's an object in JS then
  • what are functions?
  • what is the function statement?

Java is closer to a language with everything being an object, than JS imo.

thisandagain pls explain
Jonathan50
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

__init__ wrote:

Jonathan50 wrote:

What about Self? (Smalltalk, Self and JavaScript are the only languages I know of where everything is an object)

Oh, and some assembly languages don't have any registers.
If everything's an object in JS then
  • what are functions?
  • what is the function statement?
Functions are objects! And there is no such thing as the “function statement”
Java is closer to a language with everything being an object, than JS imo.
No, in Java then int, bool, char, etc. aren't objects.

Not yet a Knight of the Mu Calculus.
birdoftheday
Scratcher
500+ posts

What are some funny programming/mathematical jokes?

Jonathan50 wrote:

__init__ wrote:

Jonathan50 wrote:

What about Self? (Smalltalk, Self and JavaScript are the only languages I know of where everything is an object)

Oh, and some assembly languages don't have any registers.
If everything's an object in JS then
  • what are functions?
  • what is the function statement?
Functions are objects! And there is no such thing as the “function statement”
Java is closer to a language with everything being an object, than JS imo.
No, in Java then int, bool, char, etc. aren't objects.
In Ruby everything is an object and everything has a class. However, you aren't forced to explicitly do a class declaration for a program, like you have to do in Java, which makes it nice.

Am I the only person who likes 3.0 better than 2.0, or do the people who do just not talk about it?
__init__
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

Jonathan50 wrote:

__init__ wrote:

Jonathan50 wrote:

What about Self? (Smalltalk, Self and JavaScript are the only languages I know of where everything is an object)

Oh, and some assembly languages don't have any registers.
If everything's an object in JS then
  • what are functions?
  • what is the function statement?
Functions are objects!
oops. they're instances. just like in python. I'm stupid
And there is no such thing as the “function statement”
function  hi() {
//  ^ what is that?? it's a statement, not an object
}
Java is closer to a language with everything being an object, than JS imo.
No, in Java then int, bool, char, etc. aren't objects.
what are you talking about? int, bool and char are all classes.

thisandagain pls explain
birdoftheday
Scratcher
500+ posts

What are some funny programming/mathematical jokes?

__init__ wrote:

Jonathan50 wrote:

__init__ wrote:

Jonathan50 wrote:

What about Self? (Smalltalk, Self and JavaScript are the only languages I know of where everything is an object)

Oh, and some assembly languages don't have any registers.
If everything's an object in JS then
  • what are functions?
  • what is the function statement?
Functions are objects!
oops. they're instances. just like in python. I'm stupid
And there is no such thing as the “function statement”
function  hi() {
//  ^ what is that?? it's a statement, not an object
}
Java is closer to a language with everything being an object, than JS imo.
No, in Java then int, bool, char, etc. aren't objects.
what are you talking about? int, bool and char are all classes.
Integer, Boolean, and Character are classes. The thing is, int, bool, and char aren't those.

Am I the only person who likes 3.0 better than 2.0, or do the people who do just not talk about it?
NickyNouse
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

__init__ wrote:

Jonathan50 wrote:

__init__ wrote:

Jonathan50 wrote:

What about Self? (Smalltalk, Self and JavaScript are the only languages I know of where everything is an object)

Oh, and some assembly languages don't have any registers.
If everything's an object in JS then
  • what are functions?
  • what is the function statement?
Functions are objects!
oops. they're instances. just like in python. I'm stupid
And there is no such thing as the “function statement”
function  hi() {
//  ^ what is that?? it's a statement, not an object
}
Yeah but it's mostly equivalent to storing an anonymous function in a variable like so:
var hi = function() {...}
because functions are a type of object. They're all basically lambdas and they can be passed by reference like any other object.
/offtopic
Jonathan50
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

__init__ wrote:

function  hi() {
//  ^ what is that?? it's a statement, not an object
}
That is a function declaration! Anyway, I'm talking about data at runtime, not syntax.

Last edited by Jonathan50 (June 6, 2016 01:24:54)


Not yet a Knight of the Mu Calculus.
liam48D
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

Jonathan50 wrote:

__init__ wrote:

function  hi() {
//  ^ what is that?? it's a statement, not an object
}
That is a function declaration! Anyway, I'm talking about data at runtime, not syntax.
Yeah.. it's not an object, it's a piece of code, in the same way that this:

class Foo {
constructor(kar) {
this.eww(kar)
}

eww(wat) {
return wat ** 2
}
}

..is a piece of code, not an object. (Though it could just be my representation of a class “Foo” with a method “eww” and a constructor that do etc etc)

202e-202e-202e-202e-202e UNI-CODE~~~~~
Jonathan50
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

birdoftheday wrote:

In Ruby everything is an object and everything has a class. However, you aren't forced to explicitly do a class declaration for a program, like you have to do in Java, which makes it nice.
Yep, same story with Smalltalk (one of Ruby's inspirations). But even nicer is prototyping OOP like in JavaScript and Self.
While in Java you would have to do:
class Foo {
  public void bar() {
    System.out.println("Hello world");
  }
}
// in main
Foo foo = new Foo();
Foo foo2 = new Foo();
foo.bar();
foo2.bar();
in JavaScript you can just do
var foo = {
  bar: function() {
    console.log('Hello world')
  }
}
var foo2 = Object.create(foo)
foo.bar()
foo2.bar()

Not yet a Knight of the Mu Calculus.
TheMonsterOfTheDeep
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

^ I'm still not used to JS - it seems like there are at least 5 different ways to do OOP.

In my Custom Reporters extension, I'm doing it like this:
var getNewReporter = function() {
    return {
        // Various members of the reporter object
    }
}

my latest extension: 2d vector math
gdpr533f604550b2f20900645890
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

TheMonsterOfTheDeep wrote:

^ I'm still not used to JS - it seems like there are at least 5 different ways to do OOP.

In my Custom Reporters extension, I'm doing it like this:
var getNewReporter = function() {
    return {
        // Various members of the reporter object
    }
}
You can also write constructors like this:
var ObjectTemplateName = function() {
    this.property1 = {};
    this.property2 = {};
    //...
    this.propertyn = {};
};

When used in correlation with the “new” operator, “this” refers to the newly allocated object.

Last edited by gdpr533f604550b2f20900645890 (June 6, 2016 01:44:56)

TheMonsterOfTheDeep
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

Chibi-Matoran wrote:

TheMonsterOfTheDeep wrote:

^ I'm still not used to JS - it seems like there are at least 5 different ways to do OOP.

In my Custom Reporters extension, I'm doing it like this:
var getNewReporter = function() {
    return {
        // Various members of the reporter object
    }
}
You can also write constructors like this:
var ObjectTemplateName = function() {
    this.property1 = {};
    this.property2 = {};
    //...
    this.propertyn = {};
};

When used in correlation with the “new” operator, “this” refers to the newly allocated object.
Thanks for the info.

I have seen that sort of thing before, but JS is just so weird in some of its syntax that it's kinda hard (for me ) to really understand what it's doing…

my latest extension: 2d vector math
liam48D
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

Chibi-Matoran wrote:

When used in correlation with the “new” operator, “this” refers to the newly allocated object.
(except when a library designer is terrible and uses .bind when they should be passing arguments)

202e-202e-202e-202e-202e UNI-CODE~~~~~
Jonathan50
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

TheMonsterOfTheDeep wrote:

^ I'm still not used to JS - it seems like there are at least 5 different ways to do OOP.
Object.create “clones” a JavaScript object to make a new one that inherits it's properties.
Constructors are functions which modify “this” (which is initially a clone of the constructors “prototype” attribute, created by the new operator) to create an object.
For example:
// Using constructors
function Foo() {
}
Foo.prototype.bar = function() {
  console.log('Hello world')
}
foo = new Foo()
You can imagine new as being defined like
function myNew(constructor) {
  var obj = Object.create(constructor.prototype)
  obj = constructor.call(obj) || obj // constructors can actually return an object rather than modifying this
  obj.constructor = constructor
  return obj
}
JavaScript's constructors were supposed to make JavaScript feel familiar to Java programmers (and it failed anyway). Which is unfortunate. And that's the reason for your confusion. Initially JS didn't even have Object.create, only constructors, but you can define Object.create using new and constructors.

ES6's “class” does NOT make classes, it's syntactic sugar for constructors.

Last edited by Jonathan50 (June 6, 2016 01:53:11)


Not yet a Knight of the Mu Calculus.
TheMonsterOfTheDeep
Scratcher
1000+ posts

What are some funny programming/mathematical jokes?

Jonathan50 wrote:

TheMonsterOfTheDeep wrote:

^ I'm still not used to JS - it seems like there are at least 5 different ways to do OOP.
Object.create “clones” a JavaScript object to make a new one that inherits it's properties.
Yeah, I understand the Object.create() method really well, I think, but I haven't used it because I have a hard time writing code that isn't very backwards-compatible. I guess though I should probably just use a polyfill and use Object.create() because it honestly seems like the best method.

my latest extension: 2d vector math

Powered by DjangoBB