Earlier quoted context omitted.
I have not used Go generics, but it's viability as a business logic language would depend on that.
Wait, what? Generic programming is a perfectly valid style, but are you saying it's essential to implement business logic? Because, like, the last 3 languages that got adopted as the default business logic language didn't have them (Java pre 1.5, C, and Cobol).
Java 21 makes me like Java again
701–710 of 777 posts
Re: Java 21 makes me like Java again
#702Earlier quoted context omitted.
It would be good for my job if learned go, but I've been having a hard time because it's just so boring.
You're doing it wrong if you think programming for work is about the code being a means of expressing your inner soul. The most successful professional programmers derive their enjoyment from achieving business objectives, like making products that users love and improve the world. If you want to express your soul in your code, do that on the weekend using whatever language you want. Trying to mix these motivations i…
Re: Java 21 makes me like Java again
#703Earlier quoted context omitted.
It would be good for my job if learned go, but I've been having a hard time because it's just so boring.
You're doing it wrong if you think programming for work is about the code being a means of expressing your inner soul. The most successful professional programmers derive their enjoyment from achieving business objectives, like making products that users love and improve the world. If you want to express your soul in your code, do that on the weekend using whatever language you want. Trying to mix these motivations i…
Re: Java 21 makes me like Java again
#704Earlier quoted context omitted.
> I've worked with the kind of engineers who are still doing Java + Spring like it's still the 90s, and they're not the ones you want on your projects And I've worked with programmers who use the latest fad of the day (golang, etc) and they're not the ones you want to have on your projects. > The best talent don't even want to consider working with Java if they can help it. Not in my experience.
Every single person who's arguing against Kotlin in this thread is resorting to the argument that it's the latest fad of the day. It's not.
Re: Java 21 makes me like Java again
#705Earlier quoted context omitted.
Nothing to do with the nature of the language, but with the nature of the program. If you're writing a few line script, you don't need a DI container. Once your program gets large, it becomes extremely messy without one. It's no surprise projects like [1] exist. [1] https://github.com/ets-labs/python-dependency-injector
That DI library is not pythonic at all. There's nothing wrong with this at all, say: class MyClass: def __init__(self, my_dep1=None): if my_dep1 is None: self.my_dep1 = get_my_dep1() # Or potentially raise else: self.my_dep1 = my_dep1 [...] Then to test: def test_my_class(): mocked_dep1 = MagicMock() my_class = MyClass(my_dep1=mocked_dep1) [...]
Re: Java 21 makes me like Java again
#706The biggest problem with Java is... the walled garden, the snob society, the elitist, exclusive culture. Go isn't like that, or at least wasn't when G+ was still around. Nowadays I don't get in touch much with people, but when I create issues Go people are usually not as unfriendly as Java/JVM people.
Imo problem with Java is... JVM because it's quite a resource intensive application itself, memory usage is orders of time magnitude worse than most of the language I've used.
Re: Java 21 makes me like Java again
#707Earlier quoted context omitted.
as soon as you copy your struct by value around, it is easy task for escape analysis to decide to put struct on stack. also, golang has arena API now, and it also makes heap allocations super cheap if you manage to integrate it into app life cycle.
Golang doesn't have copy elison unlike C++ so in principle you need to leverage the heap escape anyways. Golang's arenas were an experiment that has already been ditched by the maintainer as un-feasible.
I mean you can pass structs by ref or value around, which makes direct impact will they be on stack or heap.
> Golang's arenas were an experiment that has already been ditched by the maintainer as un-feasible.
Thank you, good to know, looks like big pros in favor of rust as lang for my next project.
Re: Java 21 makes me like Java again
#708Earlier quoted context omitted.
That DI library is not pythonic at all. There's nothing wrong with this at all, say: class MyClass: def __init__(self, my_dep1=None): if my_dep1 is None: self.my_dep1 = get_my_dep1() # Or potentially raise else: self.my_dep1 = my_dep1 [...] Then to test: def test_my_class(): mocked_dep1 = MagicMock() my_class = MyClass(my_dep1=mocked_dep1) [...]
And if you want to configure the scope of `my_dep1` (singleton, transient, etc.)? What about nested dependencies? etc.
Re: Java 21 makes me like Java again
#709Earlier quoted context omitted.
I don't think any existing Go developer is going back to Java. I worked with Java for 10 years and switched to Go and I will never go back. This is mostly because applications and libraries are so hard to reason about and understand due to inheritance, packaging, OOP, build tools ect compared to Go. Go is simple. It's easy to understand, read, and maintain. The packaging is like how you would package files on your co…
> This is mostly because applications and libraries are so hard to reason about and understand due to inheritance, packaging, OOP, build tools ect compared to Go. You are just at the early phase of the project. > Go is simple. It's easy to understand, read, and maintain My opinion is that Go is too simple, to the point that it hinders understanding and readability. 4 nested loops with random mutability is much worse…
Nah.
99% of the code written out there doesn't need layers of indirection, responsibility tossing around, Code splitting across classes, design patterns, inheritance and the class jungle that is common in Java.
Rise of languages like Go is simply majority of the people realising when they want X, they are better of writing just X. You don't have to write a generic version of X that needs to work in a dozen situations. This is for a simple reason. Most of the times, there are no dozen situations. Most, not all the times.
Most of the code I write, doesn't change all that much. If you are writing code that needs to run for decades in an industry where grifting and job hunting is a daily affair you are doing it wrong.
Re: Java 21 makes me like Java again
#710Earlier quoted context omitted.
> This is not a fun situation to deal with and inheritance makes it a lot harder because the "is a" relationship is driving a ton of your logic. Judicious OOP design allows others to change behavior based upon needs that perhaps the original coder never thought of. I would not call most Java OOP design judicious. The control in Java is owned by the library writers and the language devs -- not the people using it.
What is a language with judicious oop design? Asking to know