Live data from Hacker News

Goravel, Web framework inspired from Laravel in Golang

github.com

61–64 of 64 posts

Re: Goravel, Web framework inspired from Laravel in Golang

#63
post #42
post #14

Earlier quoted context omitted.

Also not OP, but the linked reddit post sums up one of the major reasons I had to get out of PHP several years ago. Everything is/was moving to Laravel in PHP land. I got tired of dealing with highly coupled, non-unit testable code that seemed to go out of it's way to ignore SOLID principles. God help us if it this project becomes the normal way of writing http go servers applications. Maybe at that point it's time t…

What would you like to do with PHP/Laravel that isn't unit testable? Laravel is, from my experience, written in a way that specifically makes testing of most things very easy.

Yeah, I'd like to know, too. I've done laravel + TDD for almost a decade and I can't think of anything you can't test or mock. Emails, Queues, Guzzle requests, AWS SDK, events, grammers, sessions, etc.. You name it, I've probably done extreme TDD to it.

Re: Goravel, Web framework inspired from Laravel in Golang

#64
post #52

Earlier quoted context omitted.

I thoroughly dislike Django. But if you look at how it works in Python, it's by taking over class definitions in such a way that a field can be both a description of the field and an actual value. That doesn't work in Go (explicit casting the fields at every place you use them could work, but is prone to errors). It "cleverly" overrules operators to turn something like the Python expression `age > 50` into the sql st…

> why not skip that and use libraries that implement the functionality you do need. I was just asking specifically about the ORM part. The subject of "use an opinionated framework vs. tie specialized libraries together" is a complete different debate. But about this matter: I quite like to assemble libraries when I'm solo on a personal project. But that's definitely not something I want in a team. That's pretty much…

I meant: you'd need quite a bit of scaffolding to imitate django's way of importing urls. If you're happy writing them as function calls, and/or manually importing them, it can be quite straight-forward.

But Go doesn't have one framework that pretends to do it all. And IMO, django just pretends. Want to turn your GET/POST-based views into JSON/REST-like endpoints? Add a library, and two extra modules per data type. Want to do something slightly more complicated with the database? Be prepared to write a bunch of code, or look for a library that understands tree/graph-structures. Want to integrate Angular or React? Add another library or two. File conversion? Charting? Monitoring? Repeated tasks? Packing static files? Moving images into the right place for deployment? You get the picture.

You may have to good reasons to pick django for your team, but it sounds a bit like you're outsourcing the architecture, hoping that django suffices and the community can support you. But if you understand the needs of your (web) service, flask or basic 'requests' or fastapi are not such bad starts. Once you're at that point, Go's web frameworks can look quite similar, so I'd recommend that if you ever take that step.

Post reply on HN