Okay, so OOP failed royally with Java, I get that

Okay, so OOP failed royally with Java, I get that.

But how did functional programming not also fail massively with JavaScript?

And what alternative do we have left?

Attached: dpt.jpg (2000x1125, 294K)

Other urls found in this thread:

lwn.net/Articles/444910/
lwn.net/Articles/446317/
gist.github.com/briancavalier/3296186
twitter.com/SFWRedditImages

>functional programming
>JavaScript
somebody is confused

What's a good intermediate project for Haskell?

>object-oriented programming
>Java
somebody is confused

>Doesn't know how to program functionally in any language

Java is POO
But JavaScript is rarely functional

Paradigms are not tied to specific languages. Just because Java is shit doesn't mean OOP is shit.

Also javascript is a multi-paradigm language. It has functional language constructs as well as language constructs from every other common paradigm.

I would say C# is even more poo. All of my Pajeet friends use C# and few use Java, at least where I work.

Attached: 18trump-diwali.jpg (700x424, 57K)

here's some functional js
['10', '10', '10'].map(parseInt)

kys you're self namefag

i see /dpt/ is off to a good start as always

is your work taking any devs with, in about a week, three months of professional experience

This is all true.
I actually really like Common Lisp's CLOS incarnation of OOP.

>But how did functional programming not also fail massively with JavaScript?
Dynamically typed functional programming did indeed fail massively with javascript.
Statically typed functional programming is still the king of paradigms as always.

anybody else love these big ass o'reilly books?

Attached: 90.jpg (500x359, 82K)

>But how did functional programming not also fail massively with JavaScript?

It did, but Javascript developers are idiots, and haven't figure it yet.

This doesn't do what you expect.

map() passes the element as the first argument and the index as the second argument. parseInt() accepts the number as the first argument, and the radix as the second element.

Your example evaluates to [10, NaN, 2]. Try again.

Yup got 30 of them digitally as well

>OOP failed royally with Java
it didn't

Are any of the O'Reilly books good for learning programming?

Thinking about getting into Java.

Javascript isn't bad, you just get a shitload of fags that learn other languages and are mad that it doesn't work the same way, or new programmers that don't understand how it works. Also it's a prototypal language, not a functional language.

a 9mm

>Statically typed functional programming is still the king of paradigms
Yes, we can all clearly see Haskel is the most loved, useful and popular language.

>Thinking about getting into Java.
Horstmann - Core Java for the Impatient

Thank you user

>hey kids, lets start a 'programming discussion' by accepting my unsubstantiated opinions as fact and build logical conclusions from it

I have only good things to say about them to be honest. Generally speaking books > videos any time for me.

>Just because Java is shit doesn't mean OOP is shit.
All mainstream examples of OOP are pure and unadulterated shit. There are some obscure takes on OOP that aren't shit, but they're nowhere near as widely applicable as their authors deem them to be.

>everyone else must try to prove to OOP shills that OOP is shit before they can have a discussion about how OOP is shit
This thread is not for you, Rajesh.

>currying js means hiring cut price pajeets to poo on ur node

Programming noob here /g. I don't quite get linking. If i for example #include in my file, doesn't the preprocessor include all code from stdio.h into my file so it's already there. What does the linking actually do?

>doesn't the preprocessor include all code from stdio.h into my file so it's already there.
No. It mostly inserts function and structure declarations, not the actual definitions.

>What does the linking actually do?
Connects function declarations to the actual compilation results of the function definitions.

CLOS is the king master of OOP

Attached: 1520891157211.gif (838x650, 252K)

Okay so if I have a file:
a.c
#include

int main()
{
printf("hello");
}

compiling just turns this code in to an object file unaware of the declaration of stdio.h
and then the linking connects the printf definition of stdio.h with my printf call in a.o?

sorry for being a brainlet

Compiling it results in an object file with an unresolved call to some as-of-yet undefined function "printf" with a particular signature as defined in stdio.h. The linker, when generating an actual executable, will then resolve this call to the actual address of a function matching the name and signature if it can find a corresponding definition.

>CLOS is the king master of OOP
The strengths of CLOS result from huge deviations from what OOP is about in the first place.

>Dravidian
>white
No, nigger. Dravidians are australoids.
t. Dravidian
But you're right, C#, especially the MS variety is definitely more Pajeet prone than Java.

>Java
>Javascript
So being massively popular is failing now, OP?

You know that language is a failure when every modern web stack includes JavaScript to JavaScript transpiler. Two of them, in fact.

OOP did not fail royally with Java, Javascript is also OOP, fuck off bait faggot.

POO failed royally with Simula, and has been failing ever since.

>Why everyone uses POO instead of the FAR superior [insert paradigm here]? Am I wrong? NO, the world is wrong !

>REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

>muh purity

Plenty of examples where the world is using garbage solutions when the superior ones exist.

I always love how retards can see that popularity has nothing to do with quality when it comes to anything except the trash they personally happen to approve of.

Here's what you actually meant to write
['10','10','10'].map(x => +x)

JavaScript is a lisp without s-expressions.

Parsing and interpreting a subset of Haskell. Or any other language you like.

JavaScript is a C without pointers.
It's also a Haskell without monads.

So I decided to finally learn JavaScript now that apparently everyone and their mother is expected to know it. I already know a bunch of languages from all popular paradigms so I got the core ES5 and its supposed "good parts" pretty quickly, but where do I go from there? Is there a "standard" set of tools for structuring, managing, testing and deploying non-trivial JS projects, or do I need to pick one of what seems like a bazillion of competing frameworks/stacks/ecosystems at random? Any resources on best development practices in JS?

>best development practices in JS
Best practice is to not use JS.

Basic understanding of webpack, learn some react or vuejs, and then express for the server side. That's the basics of what people want I think. Between react and Vue, I found Vue a lot faster to pick up, then switch to react was ez

If you've ever used a Promise, you've literally used a monad in JavaScript.

>If you've ever used a Promise, you've literally used a monad in JavaScript.

Attached: 1514883135537.jpg (244x206, 10K)

I think he meant OOP, in spanish it's POO and he didn't realize it maybe

>javascript is a c without pointers
the absolute state of web designers. designers, not developers. no such thing as web development in the context of software
it's like saying making music is software development

Back to your /dpt/ containment thread, you drooler.

>no such thing as web development in the context of software
I'm designing a networked state synchronisation protocol and writing a web frontend in C++. Do tell how your fizzbuzz standards don't classify me as a software developer.

Your fizzbuzz-tier project actually does quality under my fizzbuzz standard. You are now an approved fizzbuzz developer.

>I don't know how Array.prototype.map() and parseInt() work: the post
Try actually learning the language. You can write functionally in it, that's true, but your code is a mess.

>you can do some babby-tier map/filter stuff in JS
>le JS is functional

>networked state synchronisation protocol
not the web
>web frontend in c++
my sides

Java didn't fail at anything. Its just too old and the way it is designed makes it age faster

>not the web
It runs in a browser and thus is webdev.
>my sides
I'm aiming to build something akin to a lovechild between Qt and VDOM in a browser and ship it as a library.

>muh networked state synchronization
I'm sorry, but sending JSON over a socket doesn't make you a developer, and using C++ pretty much disqualifies you from being considered a programmer or a human.

What esoteric programming language is this?

>you can do some babby-tier polymorphism/encapsulation stuff in Java
>le Java is object-oriented

you're right, it's still the web but not using the exact technologies and protocols used as of now
in this context what I meant with web dev is obviously people using html, css, javascript, php, http/s etc. those can be barely called developers since all they do is design and tweaking UI, and the business logic part is usually really simple
good luck with your project

Go to bed grandpa

>being this retarded
Maybe you can call JS a FP language if you reduce the scope of FP to include first class functions and not much else, in which case almost everything is a "FP language", rendering the label basically meaningless. Most FP abstractions are either impossible or extremely crippled in JS, it doesn't support persistent data structures, and you'll run into stack overflows unless you use imperative looping constructs, so you can't write programs in a functional style beyond babby's first pure function. Now, what canonical OOP features is Java missing?

>barely called developers since all they do is design and tweaking UI

I have a friend who's job it is to debug and refactor c/c++ written by the "core" developers in his company. Would you call him a developer? 95% of "developers" are actually code-monkeys who are don't do anything cerebral. More likely than not they think they are hotter than they actually are.

On I side note I don't think any self-respecting webdev who works purely on ui/ frontend would call themselves such. Maybe a web designer.

>Most FP abstractions are either impossible or extremely crippled in JS
Name one.

>and you'll run into stack overflows unless you use imperative looping constructs,
That's just wrong.

monad = (modifier) => {
return (value) => {
let monad = Object.create(null);
monad.bind = (f) => f(value);
modifier.call(monad, value);
return monad;
};
};

Number.maybe = monad(function (value) {
if (typeof(value) != 'number') {
this.bind = () => undefined;
}
});

maybeNumber = Number.maybe('a')
result = maybeNumber.bind((value) => value + 3);
print(result);

In your opinion, what all features must a language provide to support your criteria for functional programming?

>what canonical OOP features is Java missing?
Just off the top of my head: message passing, first-class classes, metaclasses, strict encapsulation, design by contract...

lwn.net/Articles/444910/
lwn.net/Articles/446317/

>Yes, we can all clearly see Haskel is the most loved, useful and popular language.
What?
I was talking about C, dude.

The most beloved programming language is the object-oriented Smalltalk though, my friend.

>The most beloved programming language is the functional C though, my friend.
ftfy

>C
>functional
kys

You're objectively wrong.

Just because you can chain calls it doesn't mean it is a monad.
Post proof that ES6 promises comply with the 3 monadic laws and I will believe you.

do people like you have any friends? are people immediately digusted when conversing with you?

gist.github.com/briancavalier/3296186

>you're objectively wrong
Get your facts straight next time.

>b-but muh rust is ahead of smalltalk!
Those are just mozjw shills, user.

Attached: 1516974822516.png (688x1078, 32K)

>OOP failed royally with Java
Nope. OOP was a success, and so was Java.
Friendly reminder that classes were added to EcmaScript in this decade because pajeets couldn't do shit without them. And of course TypeScript has them. In the past, books have been written shilling about prototypal inheritance and the no need for classes, but in the end it was all bullshit. There is nothing more natural than classes.

Classes are the antithesis of OOP, you brainlet.

Actually JavaSc*ipt is the nigger of all languages. C is a white man. Java is the pajeet.

>An object-oriented concept is the antithesis of OOP.
Please explain yourself

Attached: Capture.png (130x280, 52K)

My nigga.

The new version for java 9 titled Core Java SE 9 for the Impatient is out, so pirate that one.

It's true, today's OOP has nothing to do with the original OOP idea, it was supposed to be about 'messaging' and not objects like the name implies, smalltalk is the most OOP language out there.

Oh shit user you're rig..
>This report is based on a survey of 101,592 software developers
user ....

>message passing
>first-class classes
Java supports this.
>but it's not REAL message-passing unless the messages are first-class
Cool opinion.

>muh first class messages
>muh metaclasses
>muh "strict" encapsulation, design by contract...
Nobody considers any of that to be canonical OOP features besides Smalltalk shills. If you want to argue that only Smalltalk is "real OOP", be my guest. In that case, Java is not OOP.

>what all features must a language provide to support your criteria for functional programming?
It should at least support TCO, ADTs and proper type inference.

>That's just wrong.
function loop() {
loop();
}

Existence discarded.

Attached: brainlet2.png (645x729, 91K)

>before: objects + messages
>now: objects + method calls
It doesn't mind what method you are using to implement the dynamic dispatch. Method calls can also be conceptualized as messages.
Trying to make the case that the communication between the objects is the main characteristic of OOP is absurd. The whole point of OOP is that there are objects which encapsulate data and behavior, whether this abstraction is made using classes or prototypes is irrelevant (though classes are superior), but in no way messages were the core concept not even back in the Xerox times.
BTW Objective-C also has messages and it sucks as compared to any normal language
.

>Trying to make the case that the communication between the objects is the main characteristic of OOP is absurd.
It's not at all absurd. It's a far more productive perspective. It's just absurd to pretend this is the mainstream canonical viewpoint, especially when faced with hordes of monkeys like you who will insistently claim to the contrary.

>Nobody considers any of that to be canonical OOP features besides Smalltalk shills
How are Betrand Meyer and Yegor Bugayenko Smalltalk shills?
Just accept that JavaScript is functional and move on, user. It will hurt less.

stupidest thing ive ever herd. its ok to hate c++ but blame it on the fact youre retarded

I could write an OO program consisting on a set of objects living in memory and not communicating with each other at all.
However you can't have messages between objects without objects.
And this is why it is not called message-oriented programming.

>but muh Betrand Meyer and Yegor Bugayenko
Irrelevant. Name all the mainstream "true OOP" languages that include all of the features you claim characterize canonical OOP.

>Just accept that JavaScript is functional and move on
We've already gone through this, and it has no relation to the question of whether or not Java is proper OOP. To reiterate:

S a FP language if you reduce the scope of FP to include first class functions and not much else, in which case almost everything is a "FP language", rendering the label basically meaningless. Most FP abstractions are either impossible or extremely crippled in JS, it doesn't support persistent data structures, and you'll run into stack overflows unless you use imperative looping constructs, so you can't write programs in a functional style beyond babby's first pure function.

Nothing you've said so far refutes this.

>I could write an OO program consisting on a set of objects living in memory and not communicating with each other at all
>However you can't have messages between objects without objects.
Nice circular reasoning right there.

What do ADTs and type inference have to do with functional programming? They're nice things to have in a properly fleshed out type system, but they're certainly not part of the concept of functional programming

>What do ADTs and type inference have to do with functional programming?
Quite a lot.

Attached: 1566147226.png (800x729, 48K)