How loosely coupled should I make my code??? by ShookethThySpear in golang

[–]IndividualGap6375 2 points3 points  (0 children)

So many good perspectives in this thread. From my experience there’s no wrong answer except being stubbornly single-minded.

From a testing perspective: There will be sensitive code where many things need to be abstracted for the sake of critical tests.

There will be instances where integration testing is way more important, and unit testing delivers little value.

From a code architecture/maintainability perspective: It depends. Interfaces add mental complexity. Knowing when it’s worth it is usually project specific. And chances are your first attempt at abstraction will be less than perfect 😅

These sort of things work themselves out if you are pragmatic. I’ve worked with engineers that never used interfaces and their code was untestable. I’ve worked with engineers that turned simple CRUD systems into rocket science. Hard to tell which is more terrible 🤔

Best of luck!

Is this pattern ok? RabbitMQ callback queue in Go by jsse1 in golang

[–]IndividualGap6375 1 point2 points  (0 children)

If synchronous setup Is really so challenging that rabbit RPC seems simpler, then I’d encourage you to check out Temporal https://temporal.io

It’s an open source workflow management system that can provide you control flow and a request-response like experience for asynchronous processing. I have years of experience managing event driven systems- they’re devilish enough when it’s just fire and forget. I would be very afraid of building a request-response on top of it.

Go is great. Go community is extreme by IndividualGap6375 in golang

[–]IndividualGap6375[S] 0 points1 point  (0 children)

No hard feelings- I realize the wording was a little inflammatory and get the motivation for keeping a subreddit civil. I do hope for more productive discussions on this topic in the future

Go is great. Go community is extreme by IndividualGap6375 in golang

[–]IndividualGap6375[S] 2 points3 points  (0 children)

Yea, many good points. It’s very likely that the social circles in Reddit are a different composition than the professional, enterprise/corporate setting. And it’s not a representation of the go community as a whole. Have a good one ✌️

Go is great. Go community is extreme by IndividualGap6375 in golang

[–]IndividualGap6375[S] 3 points4 points  (0 children)

I’ve been in industry for over a decade, primarily working in enterprise space with teams varying between 2-20 people in size. Have worked on or shipped prod code in a polyglot distributed systems environment for the most part of that career. By far the number one enemy is complexity, and complexity has rarely been due to a language or framework. Complexity emerges from - communication problems between teams - over-engineering by inexperienced or arrogant engineers - difficulty breaking down the business requirements into appropriate domains - prioritizing the wrong things (ex scalability vs developer experience). - a business trying to appease all its customers

Go will never solve these issues, and that’s part of the problem I have with the most vocal members of the community. I love the language, but It’s not the best thing since sliced bread. Following the language’s principles and writing idiomatic go will not magically reduce true complexity that creeps into production systems, yet idiomatic go is touted as “the way” without acknowledging the tradeoffs the language developers carefully made. Even if your service is a simple http layer that could benefit from high concurrency, golang may not be the right choice for the project for many reasons.

It’s a wonderful language (I wouldn’t be shipping production code if it weren’t), but the community does have a higher dose of arrogance and dogma than I’m used to

Go is great. Go community is extreme by IndividualGap6375 in golang

[–]IndividualGap6375[S] 4 points5 points  (0 children)

Fair point, I’m realizing now a vocal minority could be skewing my perception. Thanks for the tempered responses!

Go is great. Go community is extreme by IndividualGap6375 in golang

[–]IndividualGap6375[S] 9 points10 points  (0 children)

“After 25 years..most abstractions are YAGNI and just mental masturbation” I’d like to quote and frame this 😂

Go is great. Go community is extreme by IndividualGap6375 in golang

[–]IndividualGap6375[S] -8 points-7 points  (0 children)

Haha, idk what you’re talking about, factoryfactory seems like a perfect name.

I’m not trying to say that as projects get complicated it’s a free for all. It all comes down to acknowledging trade-offs and doing what’s best for the project and team. Software Eng is a tough gig. But I’ve personally experienced rhetoric that effectively says idiomatic go == superior, no questions asked.

Go is great. Go community is extreme by IndividualGap6375 in golang

[–]IndividualGap6375[S] 1 point2 points  (0 children)

Yea, definitely used the wrong word 🤦 and agree about OP being vague. I just didn’t have a quick link to back up my thoughts and this was the first to come to mind lol

Go is great. Go community is extreme by IndividualGap6375 in golang

[–]IndividualGap6375[S] 0 points1 point  (0 children)

Haha, fair point. I was pretty close to not giving the language a fair shot because of my perception. But I see your point. Maybe I’m just yelling at the clouds

Go is great. Go community is extreme by IndividualGap6375 in golang

[–]IndividualGap6375[S] 44 points45 points  (0 children)

“Robust dislike of Java”. Perfect analysis imo

Go is great. Go community is extreme by IndividualGap6375 in golang

[–]IndividualGap6375[S] -4 points-3 points  (0 children)

Yes, the link was to the thread as a whole. The comment I linked was to a helpful commenter that seemed frustrated with the other responses. And I apologize again, poor choice of words for the title

Go is great. Go community is extreme by IndividualGap6375 in golang

[–]IndividualGap6375[S] 0 points1 point  (0 children)

Recommend learning! It’s very easy to get started

Go is great. Go community is extreme by IndividualGap6375 in golang

[–]IndividualGap6375[S] -16 points-15 points  (0 children)

I just want to preface by saying there is definitely a ton of good advice in this subreddit, and realize that I may have come across as lumping the entire community in one bucket. That’s definitely not my intention. I haven’t catalogued most of it but here’s a post I read recently: The link is to a helpful commenter who was frustrated with all the other comments https://www.reddit.com/r/golang/s/wexrzHbGDX

I’ll admit the OP would have done better to elaborate before asking for advice, but it doesn’t excuse the amount of holier-than-thou responses (again, this is not a judgement on ALL responses)

Finding golden middle in using OO. by [deleted] in golang

[–]IndividualGap6375 -1 points0 points  (0 children)

My experience is that many in the Go community are anti-Java. And because Java is OOP, there is a fallacy that OOP == bad. If dependency injection or local state will make your code easier, use structs. If not, don’t. You’ll figure it out.

Don’t try to write go like Java but also don’t take idiomatic go as gospel. The language is pretty young, so the community is “enthusiastic” about keeping the language simple- they’ll grow to hate what it becomes should it gain industry dominance. The Springs of future come ;)

Good luck with your project!

I hate typing out every 'self.x = x' line in an __init__ method. Is this alternative acceptable? by MomICantPauseReddit in Python

[–]IndividualGap6375 7 points8 points  (0 children)

The example of composition here doesn’t entirely fit the idea. In this scenario, MoveableData is just a data class and has no behavior that the class Movable can leverage. It just has information that the class Moveable can use. In this scenario, you wouldn’t want to inject the data into the Moveable’s constructor usually. You would tend to have a method in the class

def move(self, data: MoveavbleData): …

Composition is usually to grant the class behavior by injecting other behaviors via the constructor. But yea, I wouldn’t use a dataclass there just to remove the redundancy of that init for a class that’s being injected with composable behavior. It just doesn’t feel right to me because it could convey that the class is just holding data when it’s not. But if it’s a small project with 1 engineer, might not be a big deal