Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » What are some funny programming/mathematical jokes?
- joefarebrother
- Scratcher
500+ posts
What are some funny programming/mathematical jokes?
Found this one on Facebook:
- 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.
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?
True. and scheme is also just as much about lists/pairs Not really fair to Lisp, which is just as much about functions as Scheme, although people didn't realize that right away.
- 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.
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?
If everything's an object in JS then 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.
- 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?
Functions are objects! And there is no such thing as the “function statement”If everything's an object in JS then 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.
- what are functions?
- what is 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?
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.Functions are objects! And there is no such thing as the “function statement”If everything's an object in JS then 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.
- what are functions?
- what is 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.
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?
oops. they're instances. just like in python. I'm stupidFunctions are objects!If everything's an object in JS then 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.
- what are functions?
- what is the function statement?
And there is no such thing as the “function statement”
function hi() { // ^ what is that?? it's a statement, not an object }
what are you talking about? int, bool and char are all classes.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.
thisandagain pls explain
- birdoftheday
- Scratcher
500+ posts
What are some funny programming/mathematical jokes?
Integer, Boolean, and Character are classes. The thing is, int, bool, and char aren't those.oops. they're instances. just like in python. I'm stupidFunctions are objects!If everything's an object in JS then 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.
- what are functions?
- what is the function statement?
And there is no such thing as the “function statement”function hi() { // ^ what is that?? it's a statement, not an object }what are you talking about? int, bool and char are all classes.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.
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?
Yeah but it's mostly equivalent to storing an anonymous function in a variable like so:oops. they're instances. just like in python. I'm stupidFunctions are objects!If everything's an object in JS then 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.
- what are functions?
- what is the function statement?
And there is no such thing as the “function statement”function hi() { // ^ what is that?? it's a statement, not an object }
var hi = function() {...}
/offtopic
- Jonathan50
- Scratcher
1000+ posts
What are some funny programming/mathematical jokes?
That is a function declaration! Anyway, I'm talking about data at runtime, not syntax.function hi() { // ^ what is that?? it's a statement, not an object }
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?
Yeah.. it's not an object, it's a piece of code, in the same way that this:That is a function declaration! Anyway, I'm talking about data at runtime, not syntax.function hi() { // ^ what is that?? it's a statement, not an object }
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?
Yep, same story with Smalltalk (one of Ruby's inspirations). But even nicer is prototyping OOP like in JavaScript and Self. 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.
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();
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:
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?
You can also write constructors like this: ^ 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 } }
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?
Thanks for the info.You can also write constructors like this: ^ 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 } }var ObjectTemplateName = function() { this.property1 = {}; this.property2 = {}; //... this.propertyn = {}; };
When used in correlation with the “new” operator, “this” refers to the newly allocated object.
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?
(except when a library designer is terrible and uses .bind when they should be passing arguments) When used in correlation with the “new” operator, “this” refers to the newly allocated object.
202e-202e-202e-202e-202e UNI-CODE~~~~~
- Jonathan50
- Scratcher
1000+ posts
What are some funny programming/mathematical jokes?
Object.create “clones” a JavaScript object to make a new one that inherits it's properties. ^ I'm still not used to JS - it seems like there are at least 5 different ways to do OOP.
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()
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 }
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?
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.Object.create “clones” a JavaScript object to make a new one that inherits it's properties. ^ I'm still not used to JS - it seems like there are at least 5 different ways to do OOP.
my latest extension: 2d vector math