I’ve learned programming with OOP in Turbo Pascal, C++ and Java. Switching to a different programming style, more data-oriented, using free-floating functions, in languages such as Python, Go, or more recently Zig, has been liberating. I have inherited a C# code base and I have to say that I’m not super excited about going back to using classes and objects everywhere. It’s really hard for me now to “unsee” the problem with that unnecessary complexity.
Quite relatable. Writing a lot of Go and a bit of Rust has changed how I write Python and TypeScript. Most newcomers in startups write Python in a data-oriented manner, but that’s not the case even in new Java or C# codebases I’ve seen.
One reason I dislike Kotlin is that, despite being fairly new, Java has infected it with OO, and most Kotlin code looks exactly like Java. The whole point of Kotlin was to escape Java’s OO baggage and appeal to a new generation of coders, but it flopped hard. I guess old habits die hard, and way more Kotlin is written by Java veterans than by the younger devs it was supposed to attract.
I'm wondering if the solution to my problem could be to start using F#, which seems to encourage a data-oriented style over an object-oriented style, while staying in the same C# and .Net ecosystem. F# has a concept of modules, holding all executable code and data. They elegantly replace C# static classes, and are mapped to static classes in the CLR.
I still like C# more than Java and know that the language now allows you to break out of GoF-style OO. But the issue is, few people actually do, and those who want to aren’t writing C#.