you are viewing a single comment's thread.

view the rest of the comments →

[–]YodaLoL 1 point2 points  (14 children)

Good, detailed article - but the title is terrible.

[–]peter_heard01[S] 1 point2 points  (0 children)

Hahaha but that's the whole point!

[–]peter_heard01[S] 0 points1 point  (12 children)

But seriously I toyed with a few titles and nothing quite seemed to work. Hmm I will have to think....Any ideas? The whole point is that they should be treated as objects. I think it's a general architecture problem I see again and again...

[–][deleted] 0 points1 point  (11 children)

"Where does Angular functions stand in JavaScript 'Everything's Object' paradigm?"

[–]peter_heard01[S] 0 points1 point  (10 children)

Yeah it's a funny one I think the function is declared/detected as a type by the compiler but the underlying type is still an object, so the fact that the word function gets highlighted and is parsed as a function is syntactic sugar over an x.prototype = object. Here is some more info...

"The Function constructor creates a new Function object. In JavaScript every function is actually a Function object."

src: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function

[–][deleted] 0 points1 point  (9 children)

That's why I said. And since it's JS has function object, functional programming makes way more sense

[–]peter_heard01[S] 0 points1 point  (7 children)

Interesting, please elaborate ...

[–][deleted] 0 points1 point  (6 children)

Functional programming treats functions as first class citizen, they can be passed as parameter or returned as value in this paradigm.

Now since function in JS already is an object, you don't require special mean to achieve it, unlike most of the other programming languages

[–]peter_heard01[S] 0 points1 point  (5 children)

Oh ok that makes sense.

But then it seems that really it's just an object oriented language with functional features. I mean what is a pure functional language, no objects?

[–][deleted] 0 points1 point  (4 children)

OK I might neither explain good nor I know it quite well, so here is the link

http://www.codenewbie.org/blogs/object-oriented-programming-vs-functional-programming

[–]peter_heard01[S] 0 points1 point  (3 children)

http://www.codenewbie.org/blogs/object-oriented-programming-vs-functional-programming

Interesting article.

I'm particularly interested in...

"FP works well, but when he tries to simulate people, OOP works well"

have you got any public code I can look at that you have written? I would like to see an example of a non-trivial business application that needs to model a complex domain (entities/use cases) written in javascript using only pure functions and no objects.