« first day (1131 days earlier)      last day (4157 days later) » 
00:00 - 18:0018:00 - 00:00

18:00
And even constructors (while syntactically different in Haskell) are simply functions to inject data into a type.
@jozefg Sort of... I'm thinking about the way I approach things in LISP compared to C#, I always start C# by modeling the data I'm going to be working with in objects that present the necessary data and objects that know how to work with that data, in LISP where I don't really think about types I find myself just creating some functions that unfold/refold primitives and composing them together
Does that make sense? Coming from an ML standpoint it's a little different approach but I'm thinking from LISP because it simplifies the contrast
OOP is defined by data but in Functional code it's defined by functions? Is that what your saying more or less
It's just a matter of thinking less about the data that's available and more about the things you want to do, the structures of the data configure themselves naturally from that fact but I suppose your right: It's default hidden
That's how I tend to define stuff in Lisp. I often have things in my code like (define date car) or something
Just to be thinking at a higher level then "I'm accessing this part of my data" to "I'm extracting this meaning from my data"
@jozefg Yeah more or less. In OOP you write your code to pay attention to available data in your state and make decisions based on that so you spend a lot of time up front thinking about how to model that data to help your code know what to do, in FP you just pay attention to what you're given and you express behaviours as computations and think about how to make your behaviours composable rather than thinking about presenting data
user55340
18:07
Consider that in CLOS, one writes generics / abstracts / interfaces for the functions and then later implementations for them.
Does my analogy to math make sense? In math it's much more worthwhile to come up with an equation that can predict your data points as opposed to coming up with a good way of presenting the data points you have
in OO you think about how to present the data you have, in FP you think about how to generate and transform data that you may get
user55340
@JimmyHoffa then what do you do in clojure?
@MichaelT CLOS generic functions are like little mini interfaces
@MattD did you work on burnout paradise?
That dispatch in cool ways, but fundamentally they're functions and reasonably orthagonal to the class system
18:10
@MichaelT Unfold/refold primitives
The intermittent structures are fairly naturally occurring
So in short, in OOP you model data. In functional programming, you model computation and let your data shape itself to it
tl;dr; magic
@jozefg Yes. Does that seem like an excuse for saying "Data hiding simply doesn't apply like it does in OO"
user55340
@jozefg My understanding of it is still that FP is in contrast to Procedural - not OO. OO can exist in different types of programming - procedural, logic, functional or whatever.
@MichaelT It can, but to be certain: I've found 0 FP folks who really care to use an OO system in any serious way when they're in an FP language because you have a higher level abstraction available to you making objects simply data bags no better than a dictionary
18:15
@MichaelT It'd say it's more in contrast to imperative programming, and OOP is traditionally implemented imperatively (though it doesn't have to be)
There's a good argument over whether erlang nodes are objects that i'm sure has popped up on reddit
user55340
How about OHaskell
user55340
Despite the lack of popularity, OO does not imply not functional.
OHaskell died a long time ago I think, i havent heard it mentioned in years
@MichaelT I'm sure it's a neat idea, but seriously, with the HM type system and type classes objects are no longer even remotely worth bothering with
like I said, it comes down to: In an FPL you can give it objects, but they're just data dictionaries and all the things you use objects for in a non-FPL no longer becomes useful because the abstractions the FPL gives you are better at doing all the dispatching and polymorphism you normally would rely on the object for in an OOPL
so in an FPL when you're using other techniques for abstractions and polymorphism/dispatch/etc, the object is simply a dictionary
user55340
I'm still of the opinion that OO vs FP is a false dichotomy. How OO a language is is on a different axis than how functional a language is.
18:20
@MichaelT I don't disagree, but it's a matter of combining them being possible but pointless
like writing a regexp library for perl, you could, but really what's the point?
user55340
CLOS has seen a fair bit of acceptance in various lisp communities.
@MichaelT that's because CLOS is the behemoth monster of technological evolution
CLOS?
common lisp object system
@Sparticus
user55340
18:22
CLISP with CLOS is likely one of the most feature rich platforms out there
OCaml has pretty wide acceptance as well
@MichaelT Or more compellingly OCaml
but that doesn't mean people use objects for a ton more than the ADTs even in OCaml
@jozefg could speak better to how much people rely on OO abstractions in OCaml than I though
Maybe they do use it more than I realize
Not really, OCaml is basically used as Caml. The object part is (rarely) used, mostly by libraries trying to twist OCaml in weird ways. A lot of which would be alleviated by type classes
user55340
The thing is, its not "one or the other" its "while both are available, the abstractions that OO offers haven't found wide acceptance given the other abstractions available in traditional FP"
@MichaelT "havent found wide acceptance" - because they're just not as useful
user55340
18:26
But they aren't mutually exclusive.
No, just pointless to combine, it's like winning first and second place in a competition, the second one doesn't really matter given the first
which goes to why I say: Given the first, data hiding is pointless. If you're relying on data hiding in an FPL, basically you're doing it wrong
Well modulo things like hiding constructors, which are synonymous with functions really
Though I would like to bring up things like monads, things go on in there that are very much hidden
@jozefg Aye, there's a couple niche places you do it, but it's not really the same type of considerations as in OO
@jozefg Yes, but you don't have to hide them, like you said, it's hidden by default
maybe that's a good point I should toss in my answer
Hmm so there's i think the better rephrasing of your answer, it's a gradient, and OOP is higher on it then functional
In OOP you abstract stuff to be "messages" to opaque objects you shouldn't think about what data these messages use, just what they do. In a minimalist functional approach, data is dumb and you instead have functions over data. You can hide functions that do things you don't want end users doing, but the data is usually dumb and harmless
@jozefg Yeah, that's basically what I'm getting at, you hide data in OO because data defines behaviour, but in FP behaviours aren't defined by data
18:31
That seems more reasonable :)
Aye, after I'm done refactoring all of this message processing to be asynchronous and out of proc I'll try and make those edits to my answer. Thanks!
user55340
Both FP and OO imply a degree of 'data hiding'? The big win with imperative (OO Forth) or procedural (C++, Java) is that the traditional structures of these languages don't have data hiding with functions to access it.
user55340
Btw, OO forth... heh.
@MichaelT I'll make very clear in my answer they aren't mutually exclusive with metions from OCaml/F# and CLOS and how it doesn't matter
18:34
@MichaelT No way...
that just feels.. incredibly anti forth
that's pretty hilarious
yours now for the low, low price of $190.34
forth Visitor pattern for the win!
@JimmyHoffa Sorry, caller number 7 is the winner. Better luck next time.
@MichaelT The authors name sounds incredibly made up.
user55340
Btw, Logo (a functional language that many forgot about) had an OO variant back in the day too.
user55340
ObjectLOGO is a variant of the programming language Logo with object-oriented programming extensions and lexical scoping. Version 2.7 is sold by Digitool, Inc. It is no longer being developed or supported, and does not run on versions of the Mac operating system after version 7.5. Notes and references External links *[http://www.digitool.com/home.html Digitool, Inc.] home page * [http://vano.vn/dich-vu-cung-cap/thiet-ke-logo/308.html Thiet ke logo]
I want to see the reverse, functional smalltalk or something. That would be a travesty :)
@MichaelT the popularity of the buzzword OO in the late 80s through 90s coupled with the fact that PLT folk are by definition unambiguously fearless in their willingness to put experimental shit together meants that there are OO variants of nearly every language
OO x86. I want it
18:40
@jozefg I was just thinking some PLT folks must have done exactly that as I was writing that thinking about how much those folks experiment
That'd be a weird CPU
There are hardware JVMs
They're used in the defense industry, running missiles and drones and such
user55340
18:42
> Any language that supports indirect transfer of control (jumping to a FunctionPointer) can be used to implement ObjectOriented principles.
user55340
> In 1977 I wrote a significant amount of true object oriented code in 8080 AssemblyLanguage. This was not theoretically OO code, this code has a hard constraint to be OO. We were using 2708 EPROMS that held only 1K bytes of memory each. We had a 32K program. If we compiled that program as a single executable, then every time we made a one line change we'd have to reburn 32 EPROMs per machine and ship them to all the hundreds of installed sites. This was unacceptable.
user55340
>Thus, I partitioned the system into 32 little objects, each of which fit neatly on a single EPROM. Each EPROM declared a set of entry points into itself. These entry points were copied into RAM vectors. Anybody who wanted to call a function, called it through the RAM vector. (We'd now call them vtables).
This allows us to recompile individual EPROMs and ship them to the customers. They could pop out the old ones and push in the new ones and the system would just run. We could also make easy patches by rerouting a vector to RAM, copying some code to that RAM and then patching it.
@MichaelT Fair... but it's not quite as satisfying as having it embedded as true processor instructions or something
@jozefg the hardware JVMs would meet that criteria, I presume JVM's IL has object instructions
It's the same as OO C, sure it works, but it doesn't give you the same mad scientist feeling that creating an OO dialect and bolting it on :)
@JimmyHoffa yeah probably
18:44
and the hardware JVMs take java bytecode as instructions
Is visibility a JVM constraint or a Java one? Can't remember off the top of my head
I know nil about java's bytecode
I've read a bit of the CIL spec in the past but never java's
I rather like CIL, it's fun to compile to..
LLVM is much nicer though
user55340
Btw... I'd like to point out...
user55340
Oct 1 at 18:15, by Yannis Rizos
@JimmyHoffa Americans are crazy.
user55340
18:47
That is coming from a Greek.
... At least their government is running
user55340
(thats kind of my point...)
Did any of you guys hear about that 7 year old that got on a plane without a ticket? Gotta love the TSA.
WHAT?! HE COULD HAVE BEEN A TERRORIST!!! 'MURICA
Ah yes, he got through secuirity without a boarding pass, ate a meal (didn't pay), then just hopped on a plane to las vegas.
And of course it was vegas
user55340
18:51
Vegas is an interesting airport...
user55340
There's no problem unless he tries to play a slot machine (need to be 18).
I'm glad that someone finally got around to pinning gnat's confession so that everyone else who joins can share in that imagery
@Sparticus whatever, YAGNI!
three more stars and this shocking truth will come over Americans are crazy
I tried to explain to my boss that the company wasn't going to need clothing but he wouldn't buy it. Maybe I'll head over to workplace and see what they think
@Sparticus I think all the clothing-optional questions are supposed to be on the outdoors SE
user55340
18:56
@JimmyHoffa Do you recall that one?
@MichaelT One? There's more than one...
@Sparticus Somewhere you've just given an HR person an aneurysm
@jozefg I heard everytime an HR person has an aneurym an angel gets it's wings
user55340
1
Q: Sunblock for clothing-optional camping

cartomancerWhat should I look for in a suntan lotion for a nude camping trip? I don't know what to look for when it goes on the whole body. Are there any ingredients that I should watch out for?

18:59
@MichaelT They have more there than that one
user55340
Do note, thats California. Wisconsin... yea, you try going nudist on a cold january night. Things freeze. Extremities first.
@JimmyHoffa My mother's an HR person!
@Sparticus Did your father smell of elderberries?
No, but my knowledge of swallows is unparalleled.
What the.. this is the 5th monte python joke that's someones made around me today O_o
19:02
And we tried burning @MichaelT as a witch yesterday so that pretty much makes 6.
@jozefg You're the one who spends his time around computer wizards, you only have yourself to blame for this.
just couldn't find the stupid duck
user55340
@jozefg Monty Python fans have gone to a similar point as that Star Trek episode... "Darmok and Sparticus, in the breakroom, when the coffee ran out" --- just communicating in cliches.
psr
psr
7 Americans are crazy, 6 are coding naked. What is the other crazy American doing?
@psr I'm writing Haskell, and leave me alone
psr
psr
19:11
@JimmyHoffa Functional clothing. Makes sense.
19:27
@jozefg what are your thoughts on languages like Node.JS betting their whole fortune on CPS as opposed to doing a naturally non-blocking runtime like GHC or Erlang? Does it seem needless or do you think the complexity of the CPS is really not a big deal?
user55340
20:20
Did you stub your brain?
I often have that problem
so heres a weird design problem: I am using a networking protocol to get information from a remote device. That doesn't really matter that much, but suffice to say, I want to know whether I got back a message or not.
If one of my messages doesn't come back as expected, I return False within my code, which I can use to see if the send failed and take appropriate action. That all works as intended
but I'm looking for a serial number, and 0 is an appropriate value in this case (for a device that hasn't been given one yet)
so when I'm seeing whether I actually can talk to the device, I compare what I got back from the device against false as follows to make sure that I am able to send and receive from the device
dutSerial != False
but a 0 will make that statement fail (because 0 = False)
What do I do?
do I add another check to see if dutSerial != 0 and do a logical AND between the two comparisons?
actually that won't work will it, because 0 and False are equivalent....
is this a case where I have to use type checking?
user55340
@Sparticus Not allow 0 to be a serial number.
I have to. Virgin devices don't come with a serial number
I'm writing the code that gives them a serial number
user55340
@Sparticus Defile them?
hahaha technical term, but suffice to say they just came off the assembly line and have never even been turned on yet
user55340
20:33
...
0 is a valid serial number
It's kind of a neat problem really
I guess I'm kind of abusing pythons typeless system aren't I
@MichaelT I got the joke, it's just been made 1000 times since I started here :P
user55340
Ok... just making sure.
I could call my code Project Defiler if I so chose hahaha
user55340
Now, it would be fun if removing a file made it a 'virgin' system, then defiling it would have the other meaning.
Lol, Well they do get plugged in for the first time ever ;)
the mating count goes from 0 to 1
user55340
20:36
So... perl has a concept of 'undef' which is falsy but can be tested for. Does python have a similar concept?
yeah, None
I suppose I could change all the checks for false to checks for None
and have a dead message return a None instead of a False
I mean that None is an actual type in python, not that there are no concepts for undefined
It's like Void
well, I have a more elegant solution. I just don't use the SN to check if it's alive. I'll use the software version (which is unsettable and never 0)
and I'll wrap that into a little method and throw it into the actual source for the device
Because objects are fun
Functional Programming is for Losers.
@Sparticus Return mempty instead of false. I'll leave it up to you to figure out how to do that. Monoids are your friends
> A monoid is an algebraic structure with an associative binary operation that has an identity element
Define your set and operation, make sure it satisfies those two simple laws, and you can now compose the behaviours without ever actually checking the if condition you're concerned about.
mempty?
3 hours ago, by Sparticus
tl;dr; magic
there we go
well unfortunately after showing up to work naked, they banned me from using magic too
So I guess I'll be stuck with my mere mortal programming methods
20:52
@Sparticus Yeah, the identity element of your monoid
isnt a monoid just a typeless container?
because essentially all variables in python are typeless which is what's biting me in the butt at the moment
3 mins ago, by Jimmy Hoffa
> A monoid is an algebraic structure with an associative binary operation that has an identity element
well not really, I fixed the problem
@Sparticus you should watch out for pythons biting you in the butt
but I like to hear about elegant solutions that I can wrap my m ind around
20:54
@Sparticus monoids are actually not really hard
@enderland It didn't look poisonous...
They just sound funky, but it's got two laws.
Associativity: (a * b) * c = a * (b * c)
Identity: There is one identity i where i * a = a * i = a
Substitute * for your binary operation
so it's got the same rules as matricies
Iduno anything about matricies
user55340
@Sparticus matrices don't have associativity IIRC.
20:56
is (A * B) * C the same as C * (A * B)
@MichaelT you may be right on that one... Shoot I should know that.
lists under the binary operation of concatenation are an example:
Concatenation operation: ++, Identity element: []

Associative: ([1,2] ++ [3,4]) ++ [5,6] == [1,2] ++ ([3,4] ++ [5,6])
Identity: [] ++ [1,2] = [1,2] ++ [] = [1,2]
user55340
I stand corrected, it does.
user55340
> Matrix multiplication satisfies the rules (AB)C = A(BC) (associativity), and (A+B)C = AC+BC as well as C(A+B) = CA+CB (left and right distributivity), whenever the size of the matrices is such that the various products are defined.
@Sparticus No, that's commutativity when A * B = B * A
yeah alright
matrices can't do that either
20:58
associativity is where order of operations isn't relevant, commutativity is when order of parameters in a singular operation isn't relevant
monoids don't need to be commutative except with the identity element
user55340
> matrix multiplication is not commutative, in marked contrast to (rational, real, or complex) numbers whose product is independent of the order of the factors.
user55340
user55340
I know matricies aren't commutative guys....
I was asking if monoids were
because it sounds like they are very similar to matricies in terms of allowable operations
(I don't know how that helps me yet)
Nope, monoids don't need to be commutative, just associative and have an identity element
21:01
so what would the identity monoid look like?
@Sparticus the key is here in a monoid, call your identity mempty and call your binary operation mappend ok, now:

mappend(mempty, A) = mappend(A, mempty) = A
with that you can take your result from your serial number operation, and if it's mempty, you can have a default alternative
mappend(no_serial_returned, default) = default
where no_serial_returned is mempty
you can also do more interesting things then where you compose behaviour

def anAlternativeFunction(functionNeedsSerialNumber, functionIfYouDontHaveSerialNumber)
    return def anonymousFunction(serialNumberReturned)
        if (mappend(serialNumberReturned, mempty) == mempty) // serialNumberReturned is mempty
            return functionIfYouDontHaveSerialNumber()

        return functionNeedsSerialNumber(serialNumberReturned)

then usage:

anAlternativeFunction(doThisWithSerialNumber, shitDoThisIfNoSerialNumber)(tryAndGetASerialNumber());
wow. someone who was requesting programming help and last time we met had no idea responded back to the followup questions I had and gave me a ton of info
I feel... like my job assimilating the real world into the SE "how to ask" is becoming complete
woo hooo reached the first milestone in link-only answers crusade - reviewed all posts under length 200. Thanks to fellow moderators, voters and reviewers, you guys did a fantastic job in last 6 months!
2
Hooray P.SE community, @Sparticus doesn't count. Stupid 25 rep points users...
user55340
@gnat any other fun queries you want me to look into?
21:14
@JimmyHoffa I'm sure you were rolling in those reviews :P
@MichaelT well, to start with I am not going to simply drop this one. It will only "downgrade" from big project to regular maintenance, to something like cliff questions - we don't have "milestones" at these, do we? :) And, generally, yes I am interested in fun queries
@Sparticus so a structure that might work let's see what we can come up with...

serial numbers can be the set of all natural positive numbers, and identity can be I for now.

The operation could be...
f(x, y) =
  if (x == I) return y
  else if (y == I) return x
  else x || y && (f(x, I))

I think that would work, and technically you could use "I" for your I element in python, being dynamically typed and all
I think, just test it against the laws... the identity should stand up, not sure if the associativity stands...
That last else should say "return" before the expression. I presume here that python will automatically allow for bitwise operations to be executed against any integral like that
shit that's stupid. It should just be else return x. whatever.
not it's not commutative, but that would be associative. 1 * (2 * 3 ) = (1 * 2) * 3 = 1
user55340
@gnat Well, milestones there would be "no cliff questions exist with a rep less than N" - where N is the milestone.
yep that's a functional monoid.
"I" * (2 * 3) = ("I" * 2) * 3 = 2
user55340
There's the flip side of that query - the ones that have accepted answers and thus can't be downvoted over the cliff... they need delete votes.
21:21
@MichaelT one thing I would be very interested in pretty soon is, would it be possible to run the marginal answers query against older Programmers snapshot - one taken about "mar 12" (date of query creation). I would want to have a retrospective for further use - stats on how many answers remained as is, were edited, deleted, hist-locked... stuff like that
user55340
@gnat Maybe... I'm not sure if the data explorer has older snapshots online... and I'm not sure I have access to a compatible database to run locally.
@MichaelT that's hard to control. Close some old question and you get a candidate for cliff with unknown parameters
@Sparticus just make your failure to find a serial number return "NoSerialFound" and implement that mappend function above which looks for "NoSerialFound" instead of I and make it else return x instead of my stupid code and tada
user55340
Well, just need to keep knocking them down as they show up near the cliff.
user55340
Though point taken.
21:24
@MichaelT yep I suspect it's the case. Have a plan B to ask our mods or Shog to help with it, just exploring if maybe this is available in a regular way
user55340
-1
Q: How do you write code for a compiler to translate in to machine code?

LB Chrisname devonrevengeOOOkkkkk, we are 'grammers from this website: http://www.cplusplus.com We are a trio, yet we are not very smart or bright at much of anything in our lives. We wanted to learn basic infos on how to write code. I know there are lots of Hard and Long languages I'd like to climb up on, but this is ...

user55340
If people have the appropriate votes to do things to this, please cast them.
@MichaelT one thing I expect to change at the end of "link-only answers project" is that I won't be off of down- and close votes at the end of the day ;(
user55340
Side bit on that post... I'm guessing its our 'friend'.
user55340
21:28
"Bastion"?
0
A: Need detail about Regex package c++

LB Chrisname devonrevengejust fix those pointersss!!!!!! :)

21:41
-2
Q: Why is programming code so hard? How do you remember what to write and stuff?

LB Chrisname devonrevengeIt is hard to know from what angle I begin writing code. Like, I wanna code a hello world, but I can not seem to find how to compile/link it and stuff. It is really hard, and my poor reading skills make it harder to comprehand the stuffs. Please tell me the origins of how to code hello world bef...

whaaat
@Sparticus Does the monoid make sense now, or just more
3 hours ago, by Sparticus
tl;dr; magic
user55340
@enderland I'm guessing its our resident troll.
...heading their usual way to post ban
user55340
This, I suspect will be a bit more than a post ban if I was to guess. Normally, he's just an idiot. If its him, this time, he's being abusive to the site itself.
at least he's persistent
?
21:45
oh wait, we shouldn't forget to avoid voting more than two crappy posts in the row, to avoid reversal...
18
Q: Fix serial downvoting reversal to not apply to users spamming site front page with bad answers

enderlandThe Problem (an example) This user's answers have been downvoted consistently as they are not very high quality. The also tend to come in bursts of nearly 10 often on older questions. They are not low quality enough to trip an automatic ban, apparently, but as you can tell many of the answers...

user55340
Heh... true.
okay will spread over NPosts/2 days, fine. BTDTGTTS
I'm pretty sure this chap is going to get all his content deleted though within a few hours, it's those who are "bad but not terrible" spam which is a problem
user55340
I'm personally more interested in pushing it off the front page than the reversal.
user55340
-4 appears to be the cutoff.
21:48
not in this view though - programmers.stackexchange.com/questions
user55340
@enderland nope - that gets 'em all. programmers.stackexchange.com is filtered.
weird,
@MichaelT I flagged (VLQ). And, though I usually am pretty careful to avoid declines, this time I just don't give a shit
you rebel @gnat
:)
user55340
@gnat VLQ also gives a -1, that I think is immune to the rollback.
21:51
@MichaelT that is, if it's not declined. But, as I said, this time I don't care
psr
psr
The most recent question has been edited - anyone who wants to look and see if they want to flag as offensive...
user55340
I've also flagged that first question for mod examination - the user's profile has... well. lets say don't follow that link.
cplusplus.com ?
that's legit (if not dubious quality)
..... I think?
psr
psr
@MichaelT I didn't. I was afraid to.
user55340
@psr I flagged it VLQ prior to that... can't flag again.
psr
psr
21:53
@MichaelT Well, the quality dropped after your flag.
user55340
Just think of the fun when a mod gets online... I wonder how many flags are pending.
psr
psr
I think enough offensive flags and no mod required.
user55340
6x offensive flags will delete it.
user55340
(3x on a comment)
Aug 8 at 18:37, by World Engineer
Holy Flagpocalypse
that's what they will say
user55340
21:58
Mod types - apparently he's tweaked the url in the profile. It was previously one of the shock sites. Now its a C++ forum (though I can't say its much better)
> Batten the hatches, man the hedge, assault the louvre, beware the gorge!
22:47
I've deleted all the posts from that user as they are all junk.
2
23:04
@JonEricson Whaaattt?? You darned nazi mods, that was high quality content. I was dying to find out something about C++ by monitoring those questions closely. Seriously I keep refreshing them over and over, my finger was getting sore! Now it's all for nought! Woe is me, you evil fun hating mods you...
@JonEricson You know, with that last name, it would be terribly disappointing if you didn't know Erlang inside and out. May I interest you in a Monoid? Oh excuse me, the crazy train has arrived, I'll catch you when the clock strikes 5 and 3 quarters percent of the average cross sections available to a bi-pedal sunflower.
@JimmyHoffa Heh.
I've not gotten to the point of "Hello world" with Erlang, sadly.
psr
psr
Hello World is tough with Erlang. Due to concurrency you have to say hello to the whole world at once.
3
23:44
@Sparticus yes, i was the presentation code lead on burnout paradise.
well, the first 12mths of it anyway.
00:00 - 18:0018:00 - 00:00

« first day (1131 days earlier)      last day (4157 days later) »