4 ms·
I think multi-paradigm is better. I hate that in Java I have to have classes to do most things. Whereas in C I can just have a function. I wish more languages a
by giancarlostoro 6y ago
I think multi-paradigm is better. I hate that in Java I have to have classes to do most things. Whereas in C I can just have a function. I wish more languages approached things like D or Python. Let the developer figure out what they actually need and fully empower them.
- jayd16 6y agoIs a class name before your static methods really so onerous?
- jimsmart 6y agoIt's not about having a name in front of the static method, it's about e.g. say I have IO readers, and I want to provide a method to drain a reader, or copy a reader to a writer, why should such methods have to be class members? If the only reason is because the language doesn't permit otherwise (like Java) then it's essentially nothing but extra boilerplate. When you write a lot of code, this all adds up. Inevitably, over time, folk will grumble. There are simpler ways to express such things in other languages. Sometimes less is more.
- giancarlostoro 6y ago> If the only reason is because the language doesn't permit otherwise (like Java) then it's essentially nothing but extra boilerplate. When you write a lot of code, this all adds up. Inevitably, over time, folk will grumble. There are simpler ways to express such things in other languages. This is also part of why Kotlin so easily sells itself, despite not being perfect, it removes a lot of what you refer to as boilerplate (I prefer the ceremony of Java / some OOP-only languages).
- macintux 6y agoThe problem for me is that multi-paradigm languages, out of necessity, don’t have the feature that I value most about FP languages: immutability. Plus the multi-paradigm nature means there’s less consistency with 3rd party libraries, and they’re usually OO in structure, which obviously annoys me to no end.
- giancarlostoro 6y agoD has functional programming constructs, including pure functions: https://tour.dlang.org/tour/en/gems/functional-programming https://tour.dlang.org/tour/en/gems/functional-programming
- macintux 6y agoI guess I should have said reliable, consistent immutability. When it’s omnipresent, it makes reasoning about code so much easier for me.
- teawrecks 6y agoJava is trying to force a code architecture on the devs. It's useful in enterprise situations where devs cycle in and out but the code base has to stay. You never have to guess where or how something is defined. C/C++ on the other hand gives you 1000 ways to shoot the person who replaces you in the foot.
- p2detar 6y agoExactly. This is what people bashing Java just don’t seem to understand. Training a new Java employee on an existing code base is far cheaper than on a C/C++ codebase. Speaking from personal experience.
- giancarlostoro 6y agoI've found it just as simple to teach someone a Python codebase, and I do have OOP in most of my python projects, but sometimes I don't and that's okay, because not everything needs to be an instance of a class. D is not as prevalent but I'm certain showing someone around a D code base wouldn't be too complicated.
- giancarlostoro 6y ago> You never have to guess where or how something is defined. I mean sure, this is mostly true of Go more than most other languages though. I didn't mean to pick on Java alone, C# which is a language I love has this similar problem, though they seem to be heading slowly towards a multi-paradigm language, though the emphasis on OOP is still there, it doesn't feel as restrictive as Java. Heck, even Kotlin seems to be getting rid of a lot of what I call the ceremony of Java whilst still producing equivalent bytecode (I can only imagine most of it is just syntatic sugar).