Fork me on GitHub

I still remember how I learned about scala round about 2008-2009 and went to the scala irc to ask a question. And while most of my interactions back then with the community were pretty standard that one time I had a guy tell me in a very rude way to RTFM. While I can totally live with this answer it was his tone and arrogance that turned me away from that specific IRC and in a sense from scala too for some time. In hindsight it was a really bad experience for me that kept my brain thinking for many months if I was really that stupid as he made it sound. It's absolutely fine to tell someone to read the docs, especially if the question is covered there, but it's important to do it in a friendly and teaching way, if possible.

👍 1

i also had or witnessed these kinds of encounters over the years (in various communities), but feel that although they still happen, there are far more positive interactions these days and for this i am grateful.


Please consider helping with the relief efforts for the Beirut explosion. The Lebanese people were struggling before yesterday, and even more so today. I can recommend these organizations:

❤️ 5

Well it took me about 4 years of learning Clojure and I finally got a job... writing C#. 🤑🤪 My question is, well, for the people here who still have to do OOP for their job, how do you manage the cognitive dissonance? I've been indoctrinated into the belief that objects are bad, and thankful to have not had to learn (or therefore unlearn) them. My employer is open to me using any tech I want, but that means I still need to grok the existing C# codebase in order to reverse-engineer it. So I'm looking for any suggested resources for a Clojurian who has never learned OO before who needs to learn just enough to liberate this project from the dark side.


Congrats on the job!


F# and don’t do OOP in C#. You can get surprisingly far on static methods and objects as namespaces as I remember.


Well, the project is Windows Forms which I don't think supports F#


yeah, I think OCaml has the best flavor of OO (really FP with a few hints of OO) of any system I've used, and F# is based on OCaml


even if you can't use it, you can learn things from it that might apply...


it compiles to the same bytecode as c# though I thought


maybe it's more of a tooling consideration rather than compatibility per se


If it is indeed possible to subvert the paradigm through some hackery, I'd love to see some example of that or some kind of "How to do FP in C#" guide


@porkostomus another thing that might help (YMMV - this works for me but others think this sounds nuts) - consider how Clojure already has good parts of OO. All our data structures use Interfaces, and our functions are built against those interfaces not concrete data objects. That's OO.


Forms f# library from my former company


just because you are using C# doesn't mean you need to use inheritance and mutation and getters and setters


Static methods on classes taking immutable objects is very close to namespaces

💯 2
👍 1

Thanks, this is all really useful for me


If you can find some common/simple/generic classes to put your data in, and use those instead of adding data members to classes, you can write some pretty clojure-ish style code too


in combination with the static methods on classes mentioned above


I used to write some pretty Clojure-y PHP back before I finally landed my first Java job


even if you compare the java standard library to mainstream java code, it's much closer to FP and less overboard with OO (inheritance chains are there for actual reuse, not for architectural framework nonsense, there's static methods everywhere, very few factory methods, even fewer factory objects)


Also if you focus on writing pure functions and minimizing global state, you’ll get a lot of the big wins that FP gives you.

💯 1

I think most of the problems with OO are cultural, there's a few useful things there, and you don't need to do it the way most codebases do


like most design tools, it works great when used judiciously, and if you ignore other people's standards of "normal" you can write great code in any language (though you do need to compromise with what they find understandable, programs are a collaboration with other humans after all)


so don't ignore their standards, but bend them toward something more reasonable I guess? I definitely haven't solved this problem but I think about it quite a bit