Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There’s little point in teaching either functional or procedural programming, as they’ll both be more or less covered when you’re learning Object Oriented programming.

There’s nothing preventing certain functions from being procedural or functional.



If you disagree, I’d love to know why.

Every time I see a post like this, or my comment get downvoted, I read the Wikipedia article again, and am forced to conclude that no, I still don’t appear to be wrong.

- Procedural programming: programming with procedures (e.g. functions)

- Functional programming: programming with only functions

- OO programming: programming with procedures and classes.


> I still don’t appear to be wrong.

Procedures are not functions! I can understand the confusion since both Java and OCaml will let you define both. Procedures have side-effects, e.g. mutating global state, (pure) functions don't. Functional programmers work with predominantly immutable values and this requires a very different style of programming - one that many people struggle with if they have not had much exposure to it. Functional programming languages also have syntax and abstractions (often taken from maths) that are not used in object oriented programming. Why program with functions and immutable data? It enables better composition.


> Procedures are not functions

https://en.m.wikipedia.org/wiki/Procedural_programming

I guess I just happen to be reading an article that doesn’t make any distinction.

> Functional programming languages also have syntax and abstractions (often taken from maths) that are not used in object oriented programming.

True, but this is nothing related to functional programming an sig.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: