DEV Community

Discussion on: Function vs Object

Collapse
 
rbilash profile image
Ruslan Bilash

Sorry to say man but it is all terribly wrong, objects are not state with attached behaviors, they are holding a state but not state itself. Functional programming is against manipulating state, it is declarative. In FP "they" don't like to pass function, it is not a key principle but just a result of principles of FP. You have started with wrong assumptions and make totally wrong conclusions, however it was curious to read.

Collapse
 
stereobooster profile image
stereobooster • Edited

Ok, not sure where to start here...

  1. Would you care to write your post with the right conclusions?
  2. "objects are not state with attached behaviors, they are holding a state but not state itself" would you care to explain it or provide the reference?
  3. "Functional programming is against manipulating state, it is declarative". Never said otherwise.
  4. "In FP they don't like to pass function..." full phrase reads as "they like to pass functions as values", opposed to most OOP (old generation) languages, which doesn't support functions as values, and instead they pass objects.
  5. Adding "Sorry to say" to salty phrase doesn't make it more respectful. Next time change the phrasing as well (or don't add "sorry to say"). The respectful versions would sound, for example, "It can happen that you arrived at wrong conclusions. Here is how I see the situation... <explanation>"