Live data from Hacker News

The best Go framework: no framework?

threedots.tech

91–100 of 185 posts

Re: The best Go framework: no framework?

#91
post #46
post #23

I couldn't disagree with this any harder. I'm a Java BE Engineer who joined a Go shop, so I have a direct comparison. Both are microservice environments for products of similar complexity. It is insane to me how much less productive Go is for your average microservice enterprise environment. I'm sure it's great for systems programming or tool development. I like the simplicity. But the ecosystem is borderline useless…

You didn't specify what you meant with "more productive", but if it means "being able to produce more code in less amount of time" then i agree that one can be faster with frameworks/Java. If you look at the problem more holistically (say "run a reliable service customers want to use") then that metric is just one of many, and more often than not counterproductive vs some other metrics like maintainability and resili…

We're not going to settle this today but I think the later stages are where frameworks shine.

For instance, when Oauth became popular I was maintaining several apps where the original authors had never dreamed of an alternative login method (email and password had been the norm for longer than any of us had worked as developers).

The Rails apps required a few small config changes which I could get from the documentation then HTML for the "Login with Facebook" button.

The framework-less apps were disasters. Each had their own way of doing things. Some used libraries that were no longer maintained, others had rolled their own authentication workflow or half copied the code from another project.

There is a lot to be said for frameworks when facing an unpredictable future. There is a cost to be paid up front as far as learning the framework but the benefits on the back end are enormous.

Re: The best Go framework: no framework?

#92

There's something to say for getting in the habit of delivering microprojects with minimal dependencies and tooling. I do most of my Python work with PyCharm on a Windows machine, frequently with poetry as a dependency manager, but lately I was writing a script for burning DTS-audio CDs in a single step on my Linux server (has the optical drive) and made the decision to only use the Python standard library and do it…

After years of working with arguably ever-engineered projects where everything is an interface and the actual implementation is hidden so far up the callstack that half the time was spent searching for the file that needed to be changed, I came to like down-to-earth, YAGNI (You aren't gonna need it) mentality. This includes sometimes keeping things in a single file when sensible.

Sure your domains aren't so pure anymore because you've cut some layers of indirection and simplified things. But the cognitive load is so much smaller.

Such a pleasant delight to work on "dumb" code.

As always, it depends on the size of the project. But my threshold for keeping things simpler has certainly shifted towards trying to keep things simpler when possible.

Re: The best Go framework: no framework?

#93
post #41
post #23

I couldn't disagree with this any harder. I'm a Java BE Engineer who joined a Go shop, so I have a direct comparison. Both are microservice environments for products of similar complexity. It is insane to me how much less productive Go is for your average microservice enterprise environment. I'm sure it's great for systems programming or tool development. I like the simplicity. But the ecosystem is borderline useless…

You're saying that grpc and protobuf are over engineered but you're happy with Spring? gRPC and protobuf are just transport and serialization, they have nothing to do with business logic, on the other hand Spring is a heavy, bloated framework. Most Java frameworks are complicated backed by layers of abstraction and black magic. btw no framework does not mean you don't use any library, there are some good lib aka micr…

Spring Boot is actually a VERY easy to use framework. So much so that Netflix shifted out of writing their own libraries to using Spring boot.

For example, the code below is a complete Spring Boot application with all of the default configuration in place. It will take just a couple of minutes to have this running and it provides quite a lot of features under the hood - which you don't need to worry about.

@SpringBootApplication @RestController public class DemoApplication {

@GetMapping("/helloworld") public String hello() { return "Hello World!"; } }

Re: The best Go framework: no framework?

#94

There's something to say for getting in the habit of delivering microprojects with minimal dependencies and tooling. I do most of my Python work with PyCharm on a Windows machine, frequently with poetry as a dependency manager, but lately I was writing a script for burning DTS-audio CDs in a single step on my Linux server (has the optical drive) and made the decision to only use the Python standard library and do it…

Most of my code I write is small projects where all the code is in one or two files

I don't enjoy working on enterprise codebase where there's thousands of files that do very little and the code is refactored so hard that you need to jump between 20 classes to understand how it all works and fits together.

Leetcode solutions are usually single file solutions.

My programming language and interpreter are more than one file though. A parser that lexes and creates an AST and an interpreter class and a class for each kind of AST node that do codegen.

I could probably hast used a single file and inner classes.

Re: The best Go framework: no framework?

#95
post #69

Earlier quoted context omitted.

Different strokes I guess. I've previously worked at big orgs. with Spring, now working with Go microservices and enjoying it by and large. I don't miss the days where I had to deal with random missing or conflicting beans stopping my app from starting. The nice things about a Go app is because the control flow is so exposed, if it compiles you can be pretty sure it is going to run, and if it doesn't compile you can…

By far my least favourite thing about the Java web ecosystem is how weirdly obscured the bootstrapping process for starting processes is. So much of how your application starts is determined by XML files and DI frameworks that I often have no idea (or am sometimes not even exposed to) where the `main` function is.

Caring about the main function in a framework-ey app generally makes as much sense as caring about the x86 initial boot code when launching mspaint.exe

Re: The best Go framework: no framework?

#96
Yeah, Having built a web application serving 100K+ users in Go. First 2/3 weeks were spent on making sure we were a framework. So new Modules could be added. New external calls were abstracted and also dealt with lot of circular dependency.

This was all fun and learning, but wouldn't mind having a "Flask" or "Express" version of a Golang framework which took care of all the boilerplate out of the box.

We did try some existing solution to no avail like Tiny etc.

But ended up building a non-framework framework anyways especially to support new features/modules and new devs coming it.

Re: The best Go framework: no framework?

#97

Earlier quoted context omitted.

The lack of detailed documentation for grpc is pretty crazy considering how many people seem to be using it. So many hours wasted investigating fringe http2 characteristics causing odd bugs on the platform.

It is so bad. Outside of Go (I assume because it seems pretty popular there) the clients for other languages are so hit and miss. I had to pipe a json into the python client to configure a grpc client (which seems bad) and it took me a while to dig up the correct incantation. I like the "contract" that GRPC implies but I am not sure I would choose it again.

Try twirp! Same protos for contracts, but everything is much simpler , saner and slimmer , and just uses standard http. It’s great.

Re: The best Go framework: no framework?

#98
post #23

I couldn't disagree with this any harder. I'm a Java BE Engineer who joined a Go shop, so I have a direct comparison. Both are microservice environments for products of similar complexity. It is insane to me how much less productive Go is for your average microservice enterprise environment. I'm sure it's great for systems programming or tool development. I like the simplicity. But the ecosystem is borderline useless…

> GRPC

Assuming this means grpc-go, that's a framework. Perhaps your seemingly negative experience with it actually echoes that the best Go framework is no framework, contrary to your opening position?

Re: The best Go framework: no framework?

#99
post #91
post #46

Earlier quoted context omitted.

You didn't specify what you meant with "more productive", but if it means "being able to produce more code in less amount of time" then i agree that one can be faster with frameworks/Java. If you look at the problem more holistically (say "run a reliable service customers want to use") then that metric is just one of many, and more often than not counterproductive vs some other metrics like maintainability and resili…

We're not going to settle this today but I think the later stages are where frameworks shine. For instance, when Oauth became popular I was maintaining several apps where the original authors had never dreamed of an alternative login method (email and password had been the norm for longer than any of us had worked as developers). The Rails apps required a few small config changes which I could get from the documentat…

> The Rails apps required a few small config changes which I could get from the documentation

What Rails configuration would be pertinent to Oauth? Perhaps you mean the application was already using some kind of third-party authentication library (e.g. Devise) that supported Oauth? If that's the case, didn't you just luck out that the developers happened to choose a library that 1. Was still being maintained. 2. Had already added Oauth support?

Most of the Rails apps I have encountered in my career (especially those predating Oauth popularity) used hand-rolled authentication, each different to the next, so it seems that you could have just as easily fell into the same trap you saw elsewhere. It is not clear how Rails saved you here.

Re: The best Go framework: no framework?

#100
post #51
post #48

Earlier quoted context omitted.

micro.dev is different from an actual go framework go-micro.dev ?? ( https://github.com/go-micro/go-micro )

Yup, I was the author of go-micro. It was very much a standalone Go framework aka common interfaces grouped together for distributed systems development. By using interfaces they effectively became pluggable abstractions for infrastructure. Unfortunately I don't think a Go library alone solves the problems I was trying to solve so it got merged into Micro which is platform that includes a CLI, API, Runtime, etc. It p…

What if any is the relationship between https://m3o.com/ and https://micro.dev/ ?
Post reply on HN