News for hackers. Stuff that matters.
Re:Mostly Adequate Guide to Functional Programming in JavaSc... by lojack on Tuesday July 14, 2015 @04:32PM (#9887833)
> It's like trying to show how to do OOP in C.

Actually, I'd think that would be a super valuable to a C developer. Learning to implement OOP patterns in C would provide practical patterns that can help architect C software. For non-C developers, it'd also provide fundamentals of how OOP actually works. C developers have been implementing OOP patterns since well before C++ existed.

There's lots of resources, and practical examples of this. GObject provides an object system used by both Gnome and GTK. Check out "Object-Oriented Programming With ANSI-C" for a book on the subject.

Re:Mostly Adequate Guide to Functional Programming in JavaSc... by stream_fusion on Tuesday July 14, 2015 @07:51PM (#9888888)
It's arguably faster and of more benefit to learn OO in an OO language, and then work backwards to figure out ways to implement those strategies in C (eg. polymorphism using structs with arrays of function pointers, or win32 send_message constructs).

It's similar with functional programming. Figuring out folds, pattern matching and monads is probably easiest in haskell or Ocaml/F#. The decision to apply those techniques in other languages without native support then becomes a judgement about the benefit.

Re:Mostly Adequate Guide to Functional Programming in JavaSc... by ectoplasm on Tuesday July 14, 2015 @04:42PM (#9887894)
That GObject stuff is really complicated. You can get pretty far doing simple OOP in C without inheritance and just containment.