by rednafi · 1y ago · 0 comments
Plus, many, like myself, just don’t want to write OO code, no matter what. I simply don’t want to spend my time working that way. This makes hiring difficult, especially when many young engineers who start their careers with non-OO languages instinctively shy away from Java-esque languages.
That said, I welcome language diversity in the backend and love that new startups no longer default to Node. I’d rather deal with OO than fiddle with a poorly designed language that was never meant for anything but throwaway frontend code.
If you compare it to something like Java, yes, it has much richer syntax. But having to process some extra unfamiliar syntax is compensated by removing a lot of boilerplate once you get familiar with the features. Also, Java's simpler syntax is far overshadowed by much bigger complexity and cognitive load in other areas of the Java project, including the entire plumbing besides the code itself. Ergonomics, simplicity and comfort of a .NET Core project infrastructure is pretty much unmatched.
However, I was mostly talking about the cognitive load that comes with a large syntax surface and GoF-style OO, and how starting with something like Go is just easier.
There's a good pluralsight course by Zoran Horvat called, "Writing purely functional code in C#" ( https://www.pluralsight.com/courses/writing-purely-functiona... ), where he explores exactly that.
Modern C# has added a bunch of things which means you don't need to write it in the OOP style, although if you find yourself working for others then OOP is what they'll likely expect.
OOP is not going away from mainstream.
People love Python because it’s still one of the easiest languages to start with, as it doesn’t force any particular coding style on you. Underneath, it supports a bastardized version of OO, but it doesn’t care if you just use simple types and pass them around to mostly free-floating, stateless functions. This is how startups write Python anyway.
Add a huge ecosystem of libraries and a fairly well-designed type system, and you’ll appeal to a ton of people—despite being quite sluggish. C# and Java struggle to attract this crowd, which is gradually becoming the majority as the industry ages.
Go is also a OOP language, regardless of how people without CS degrees fool themselves it is not one.
Not having inheritance one OOP language doesn't not make.
By definition they are OOP languages, and anti-OOP folks could do better learning about type systems.
But I’d rather write Python, Node, Go, or Rust in a bastardized, data-oriented, faux-OO way than deal with GoF-style OO in Java, Kotlin, or C#. Sure, you can write code in a non-OO way in C#, but no one does. Whereas in Python, these days, people default to a data-oriented style.
This is just how I like to program. Plenty of folks enjoy OO thinking, and I have nothing against that. But when choosing a workplace, I’m fortunate enough to be able to ask if the codebase is OO-heavy—and politely decline if it is.
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.
You can import all methods from a static class to use them as free-floating functions.
C# started as OO so older codebases are OOP heavy.
I never really understood this argument. The runtime, libraries and compilers are all open source now, and all cross-platform. If MS decided to suddenly be a dick again, there is no danger of being locked in to anything.
Which level of OO is correct is context dependent.
A C codebase, and a C# codebase can have the same amount of OO in it. But while its easy-ish to write Procedural or functional C# it’s quite cumbersome to write good OO in C.
However, that doesn’t mean the language won’t fight against you. Yes, you can write data-oriented code in C# as well, but most people don’t because C# has historically been an OO language, and doing so would feel jarring to many. As a result, getting dropped into an existing C# codebase won’t be pleasant if you don’t enjoy GoF-style OO.
Go, Rust, and Zig don’t have this issue, but the latter two don’t directly compete with C#. Go does and is preferred by those who want to avoid traditional OO. That’s hard to do in an ecosystem that’s pivoting only because people are moving away from it.
But I think the strongest signal for that would rather be e.g the code being related to web/service backends of some kind. I much more rarely see that kind of thing in any other context (games, mobile, scientific, desktop, …).
I stay as far as possible from web stack stuff more than specific languages, but probably for the same reason.
Main frameworks are usually still OO based, but you can write your code on top with minimal OO style.
Big surface area in terms of syntax is not really an issue anymore as LLMs will quickly explain to you anything you don't understand about the syntax.
Modern Python in startups uses loose types and fairly stateless functions. But that’s not the case in C#. Most C# code I’ve come across is extremely Java-like, and while some people find it appealing, I prefer the Go, Rust, and Zig way of coding.
Both strategies have their place. It’s just that in the startup space, OO has fallen out of grace, and no one I know is excited about using C# to solve a novel problem. Also, CTOs always complain about how hard it is to hire for OO languages these days.