ToughAd4902
ToughAd4902 t1_iy9rten wrote
Reply to comment by dv_ in Why Functional Programming Should Be the Future of Software Development by fchung
C does not support functions as first class citizens. You can do minimal amounts of things, like not writing mutable code, etc, but you can't do any form of true functional programming, as the language itself doesn't support it (though I guess you could write macros that unwrap everything, but that doesn't really count). The language itself has to have some support or it's just not possible
ToughAd4902 t1_iy8asu2 wrote
Reply to comment by z0mbietime in Why Functional Programming Should Be the Future of Software Development by fchung
Haskell, the definition of a pure functional language, has classes, and then by your definition, methods. Scala, a primarily functional language, has classes. F#, a functional language, has classes. There is like 2 functional languages that don't, and that has no reason about it being functional or not. You are completely wrong, and this is my last response to this. Not a single point you've brought up has been about OOP or Functional, you need to learn them before you can argue them, that is all.
It's just hilarious you led with"you should Google before you comment" when everything you've stated is literally Googleable
ToughAd4902 t1_iy723ej wrote
Reply to comment by z0mbietime in Why Functional Programming Should Be the Future of Software Development by fchung
In years? Java 8 was release in 2014, almost 9 years ago. How many years is "years" in this case? Your entire definition of what functional programming is has NOTHING to do with what actual functional programming is, you should be the one deleting your comment. Every language, literally ever, is going to put code into functions (or methods, if for whatever reason you want to name it that).
According to your definition, C is a purely functional language. Do you understand now how that makes literally 0 sense? C has no classes, nor "methods" with how you want to describe it, and all logic has to exist in functions, this is the first time I've ever heard of C being classified as a functional language
Since you still don't seem to understand the difference: functional languages treat functions as first class citizens. What does that mean? A first class function is when a function can be treated the same as a variable for all purposes. This means they can be assigned to variables, they can be passed as higher order functions and used as a higher kinded type.
Putting logic into a function does not make it functional.
ToughAd4902 t1_iy704p8 wrote
Reply to comment by z0mbietime in Why Functional Programming Should Be the Future of Software Development by fchung
Holy shit, what, Java has lambda's, that is functional programming. There is no way you just made that statement and think you have even an inkling of an idea what functional programming is, like you didn't even google if Java supports functional programming. Yes, functions in Java are not first class in themself so you can't write fully functional code, but that doesn't mean it doesn't support significant parts of functional programming.
Also, a function is a method you dimwit, that's literally the same thing, you found some random online definition saying they were different once, but they are literally the same exact thing
Java has lambda's, C# has LINQ (implemented with lambdas) there are plenty of OOP designed languages with functional aspects.
ToughAd4902 t1_iy6ytsu wrote
Reply to comment by z0mbietime in Why Functional Programming Should Be the Future of Software Development by fchung
you clearly dont understand what functional programming is. it has nothing to do with putting code into functions, and your example makes 0 sense, classes have functions too... you can not use a single class and not write functional code.
ToughAd4902 t1_iyaa2lk wrote
Reply to comment by dv_ in Why Functional Programming Should Be the Future of Software Development by fchung
my point that it didn't count is just that the macro will unwrap it to pure C, which doesn't have those constructs, so in terms of the language it doesn't actually support it, you're just adding a syntactic idea about it.
Though, to be fair, I guess that's all higher level languages do as well at the end of the day, so I guess my argument is kind of mute