Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
double sulk
Jul 2, 2010

Shaggar posted:

functions are for morons who want to spend the extra effort to make maintainable code without actually making maintainable code.

:suspense:

Adbot
ADBOT LOVES YOU

double sulk
Jul 2, 2010

I still haven’t actually learned Java well enough to do more than a couple hundred lines of programming in it. I don’t dislike Java but I think it is a little over-verbose, it’s become kind of top heavy. So it’s not my first choice, but if I had to write something in Java I wouldn’t go ‘ICK’.

double sulk
Jul 2, 2010

I am sort of gingerly dipping my toes into the waters of Go, Google’s new language… I’ll tell you one concurrency thing I am really pleased by. I have been wondering since about 1971 why nobody took the ball and ran with Hoare’s communicating sequential processes model. So elegant, so pretty, so nice to reason about and 40 years later the Go people picked it up and ran with it. That’s one reason I’m looking at Go. CSP is the basis of their concurrency model in that language which is enough to motivate me to want to look at it some more.

coaxmetal
Oct 21, 2010

I flamed me own dad

Shaggar posted:

function pointers make me want to vomit

oh yea that reminds me that functions and methods not being first-level objects in java is dumb

trex eaterofcadrs
Jun 17, 2005
My lack of understanding is only exceeded by my lack of concern.

Ronald Raiden posted:

oh yea that reminds me that functions and methods not being first-level objects in java is dumb

why what do you mean you can just make an anonymous inner cl.. :suicide:

Shaggar
Apr 26, 2006

Ronald Raiden posted:

oh yea that reminds me that functions and methods not being first-level objects in java is dumb

murder function objects 2 death.

JawnV6
Jul 4, 2004

So hot ...
hey tef i tried searching but what was that joke you RTed about 1980 called, well, actually 1980 passed us a pointer...

NeoHentaiMaster
Jul 13, 2004
More well adjusted then you'd think.

standardtoaster posted:

Is this accurate?

Its not magic, its just mind boggling electrical engineering thats lets you add 0 and 1 together really really fast.

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
hint: the answer is 1

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug

Shaggar posted:

murder function objects 2 death.

shaggar how do you feel about other callables that aren't technically functions :allears:

code:
In [1]: class Adder:
   ...:     def __init__(self, value):
   ...:         self.value = value
   ...:     def __call__(self, other):
   ...:         return self.value + other
   ...:     

In [2]: four = Adder(4)

In [3]: four(5)
Out[3]: 9

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Sulk posted:

I still haven’t actually learned Java well enough to do more than a couple hundred lines of programming in it.

so, "hello world"

Shaggar
Apr 26, 2006

Lysidas posted:

shaggar how do you feel about other callables that aren't technically functions :allears:

code:
In [1]: class Adder:
   ...:     def __init__(self, value):
   ...:         self.value = value
   ...:     def __call__(self, other):
   ...:         return self.value + other
   ...:     

In [2]: four = Adder(4)

In [3]: four(5)
Out[3]: 9


:barf:

skeevy achievements
Feb 25, 2008

by merry exmarx

trex eaterofcadrs posted:

why what do you mean you can just make an anonymous inner cl.. :suicide:

yeah shaggar after using closures for a while lemme tell you they're pretty nice and you can name them (in some languages at least) so they really cut down the code without sacrificing clarity

still not sold on the pure function approach for general purpose development though

coaxmetal
Oct 21, 2010

I flamed me own dad

Lysidas posted:

shaggar how do you feel about other callables that aren't technically functions :allears:

code:
In [1]: class Adder:
   ...:     def __init__(self, value):
   ...:         self.value = value
   ...:     def __call__(self, other):
   ...:         return self.value + other
   ...:     

In [2]: four = Adder(4)

In [3]: four(5)
Out[3]: 9

ducktyping is cool

coaxmetal
Oct 21, 2010

I flamed me own dad
shagger doesn't like it but he doesn't actually have a good reason not to like it because functions and callables as first-level objects is actually really handy and hes just shaggering

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>
wahts that have to do with duck typing

coaxmetal
Oct 21, 2010

I flamed me own dad

ahhh spiders posted:

wahts that have to do with duck typing

it's a callable because it has the __call__ attribute

Lysidas
Jul 26, 2002

John Diefenbaker is a madman who thinks he's John Diefenbaker.
Pillbug
looks like a function, quacks like a function

Shaggar
Apr 26, 2006

Ronald Raiden posted:

shagger doesn't like it but he doesn't actually have a good reason not to like it because functions and callables as first-level objects is actually really handy and hes just shaggering


no their code obfuscation for no benefit except maybe typing less code in 1 scenario in which ur probably doing it wrong anyways

coaxmetal
Oct 21, 2010

I flamed me own dad
if you understand how objects work it actually makes perfect sense!

Shaggar
Apr 26, 2006
nope. its bad.

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

Ronald Raiden posted:

it's a callable because it has the __call__ attribute

wouldn't that just be operator overloading

Muddy Terrain
Dec 23, 2004

by Y Kant Ozma Post

Shaggar posted:

its bad.

don't sign your posts

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
It is the owningest to pass a function to another function, which then returns another function, which you call.

Like _.debounce in underscore.js

Shaggar
Apr 26, 2006
javascript has functions which is one way to know that functions are dumb

coaxmetal
Oct 21, 2010

I flamed me own dad

ahhh spiders posted:

wouldn't that just be operator overloading

what? idk how operators come into the picture here.

functions are equivalent to objects with a __call__ attribute as far as python is concerned, it's not overloading the () operator. Function/methods are just one type of callable. so are ducks. It's p simple. Quack. You could make a duck that was callable and iterable!

JawnV6
Jul 4, 2004

So hot ...
lol what are you debouncing in javascript

Rufus Ping
Dec 27, 2006





I'm a Friend of Rodney Nano

Sulk posted:

I am sort of gingerly dipping my toes into the waters of Go, Google’s new language… I’ll tell you one concurrency thing I am really pleased by. I have been wondering since about 1971 why nobody took the ball and ran with Hoare’s communicating sequential processes model. So elegant, so pretty, so nice to reason about and 40 years later the Go people picked it up and ran with it. That’s one reason I’m looking at Go. CSP is the basis of their concurrency model in that language which is enough to motivate me to want to look at it some more.

i realise u just copy pasted this and dont fuckin understand it but csp owns and tony hoare owns and it was done w/ occam 25 years ago h.t.h.

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Shaggar posted:

javascript has functions which is one way to know that functions are dumb

also: "java" in the name, classes, strings as objects with special syntax

double sulk
Jul 2, 2010

Rufo posted:

i realise u just copy pasted this and dont fuckin understand it but csp owns and tony hoare owns and it was done w/ occam 25 years ago h.t.h.

take a guess who said it

Rufus Ping
Dec 27, 2006





I'm a Friend of Rodney Nano

Sulk posted:

take a guess who said it

lol

stopped clock etc i guess

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

JawnV6 posted:

lol what are you debouncing in javascript

Well, mouse movement events, for exsmple. Its not debouncing in exactly the same way as some hw driver might debounce a button switch, but

Zombywuf
Mar 29, 2008

Rufo posted:

i realise u just copy pasted this and dont fuckin understand it but csp owns and tony hoare owns and it was done w/ occam 25 years ago h.t.h.

The CSP book has a hell of a lot more in it than channels. Channels and processes are just the Pi calculus, CSP has all kinds of useful poo poo in it that no-one seems to be aware of.

Shaggar posted:

javascript has functions which is one way to know that functions are dumb

Javascript functions are actually objects.

Rufus Ping
Dec 27, 2006





I'm a Friend of Rodney Nano

Zombywuf posted:

The CSP book has a hell of a lot more in it than channels. Channels and processes are just the Pi calculus, CSP has all kinds of useful poo poo in it that no-one seems to be aware of.

i know, its one of the few things i actually know anything about

Police Academy III
Nov 4, 2011

BonzoESC posted:

so, "hello world"

lol

Opinion Haver
Apr 9, 2007

shaggar what do u think about monads and zygohistomorphic prepromorphisms

Shaggar
Apr 26, 2006
sounds bad

Emacs Headroom
Aug 2, 2003
shaggar what is the best program ever written

vapid cutlery
Apr 17, 2007

php:
<?
"it's george costanza" ?>

Ronald Raiden posted:

what? idk how operators come into the picture here.

functions are equivalent to objects with a __call__ attribute as far as python is concerned, it's not overloading the () operator. Function/methods are just one type of callable. so are ducks. It's p simple. Quack. You could make a duck that was callable and iterable!

the function call operator. calling a function is an operation on the function

Adbot
ADBOT LOVES YOU

double sulk
Jul 2, 2010

Ridgely_Fan posted:

shaggar what is the best program ever written

Shutdown.exe

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply