Live data from Hacker News

Goravel, Web framework inspired from Laravel in Golang

github.com

31–40 of 64 posts

Re: Goravel, Web framework inspired from Laravel in Golang

#31
post #20
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…

When I studied computer science, I promised myself to never touch PHP again. But PHP has more to give than just as a birthing ground for teenage programmers. When I many years later accepted a PHP job as a senior developer, PHP provided a consistent experience of "bad practice everywhere", a fractal of cringe I couldn't ironically reproduce. Working with this for a year taught me a lot about how to deal with critical…

"bad practise everywhere" - you could say that for C++, Python and many more programming languages, too. If we're honest - most of the code out there is poorly written. PHP - nowadays - doesn't prevent developers in following good practises.

Re: Goravel, Web framework inspired from Laravel in Golang

#32
post #13

Yeah, Go is not a great language for frameworks as it usually works until it absolutely doesn't and then you have to rip that out.

That's not a problem with Go, it's a problem with frameworks: they give you some abstractions, e.g. the Laravel query builder, but they don't cover all the use cases, so you quickly find yourself using "raw" queries anyway.

There are some well-established web frameworks for Go (e.g. https://github.com/gin-gonic/gin), but they are controversial too, as most Go developers seem to prefer libraries (that your code calls) instead of frameworks (that call your code and impose their structure upon it). So I don't think just cramming a framework from a completely different language into Go will fly...

Re: Goravel, Web framework inspired from Laravel in Golang

#33

Earlier quoted context omitted.

I think the reddit post missed the point multiple times. Laravel does not use the best principles everywhere, yes. Taylor Otwell is a (very) strange person, yes. But "Laravel should be considered harmful for the PHP community" is just wrong. Laravel was the first framework, that "just worked" and had everything, you need to make your first steps in a web application. Nowadays, people write PHP components that are usa…

I thought Sensio labs and PHP-FIG made lots of efforts to have compatible code...

They did, and the outcome of that is a couple generations tools/libraries that have more standard compatibility 'by default'. That has enabled another generation of frameworks (Laravel probably the largest of those) that can take a 'mix and match' approach, using 'best of breed' bits from the community as well as their own ideas and philosophies.

Re: Goravel, Web framework inspired from Laravel in Golang

#35
post #28

Earlier quoted context omitted.

I think the reddit post missed the point multiple times. Laravel does not use the best principles everywhere, yes. Taylor Otwell is a (very) strange person, yes. But "Laravel should be considered harmful for the PHP community" is just wrong. Laravel was the first framework, that "just worked" and had everything, you need to make your first steps in a web application. Nowadays, people write PHP components that are usa…

"Laravel was the first framework, that 'just worked' and had everything" - well, there was Symfony before. And CakePHP, and Yii (which was also considered as quite easy to learn), and much more. Laravel may did a few things "better", especially for junior devs, but it's not the first.

Laravel didn't have all this on day one, but having docs and supported configurations for something like queue processing. IIRC, there were community plugins for CakePHP for queue processing, but it wasn't something the core framework embraced and supported out of the box. I don't think Laravel had this until their v4.

My experiences with cake and zend back ... 10-12+ years ago... things 'worked' mostly, but there was often a lot of "you can do it any way you want", and often minimal examples for the cases I was trying to achieve. Testing... as much as it was there, my experiences trying to get decent testing never seemed to work very well; Laravel's testing experience felt better out of the box. Testing traits like 'useDatabaseTransaction' to rollback the db after each test seemed both useful and novel - I don't remember seeing things like that in Cake (at least not early on - haven't checked recently).

FWIW, I use Laravel a lot these days, but wasn't terribly 'trusting' of it early on. Started seeing it in what I guess were its 3.x days; then saw 4.x - big changes, and what seemed like a moderate amount of BC breakage, then again from 4-5. Around 5.x, it seemed to adopt a bit more of an incremental approach to changes, and I started using it more day to day in the 5 series.

Re: Goravel, Web framework inspired from Laravel in Golang

#36
post #7

Earlier quoted context omitted.

> Laravel, the framework that made me quit PHP. I would be interested to hear more.

Also interested in hearing more - first person i've heard say they do not like Laravel...

Poke around a bit more; you'll find plenty of people don't care for it.

Re: Goravel, Web framework inspired from Laravel in Golang

#37
post #14

Earlier quoted context omitted.

Not OP. While I didn't quite PHP. I just don't work with Laravel. A lot of good points are written down here: https://old.reddit.com/r/PHP/comments/131t2k1/laravel_consid... In short, it just doesn't use good programming principles. It's not just easy to write code with bad principles, it's everywhere in the tutorials. There's of course Laravel apps out there that do have good programming principles. It's very much p…

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…

It seems like they thought a lot about making sure everything could be mocked and tested: https://www.goravel.dev/digging-deeper/mock.html

Re: Goravel, Web framework inspired from Laravel in Golang

#38
post #2

Laravel, the framework that made me quit PHP. Not sure the concept of "one framework doing everything" will resonate well with the wider Go community. I will keep an eye on it though.

Since this has generated quite some interest, the reasons I dislike Laravel are:

- so. many. godobjects.

- I dislike ORMs. I could not put my finger on it, while using PHP frameworks, because they were omni-present; but after using Python, Go, and C#, I found it to be easier for me to just avoid the overhead of an ORM.

- Terrible structure. Sorting classes by type is something I have experienced to be generally less helpful than sorting by "topic" (not a native speaker, so this might not be the correct word for it. I recently heard it compared to collecting cars, then disassembling them and sorting by tires, steering wheels, seats, and so on)

- Too much magic™. I understand that many like this about it, but I found it harder to understand what exactly the program is doing.

It's not a lot, but after literally years of PHP and having these paper cuts almost weekly, I was at one point fed up. I first switched to CodeIgniter, which I found more pleasant, but still not even comparable to the comfort that cherry-picking components gets you (yes, you can by using composer, but most people I have spoken to discouraged that in favour of Laravel's built-in fun).

Re: Goravel, Web framework inspired from Laravel in Golang

#39
post #34

It's there a "default" web framework for Go which most of people use?

I would recommend to look at Iris-go

I would recommend avoiding iris-go, the author has a bad history of rewriting the git history, and using code without attribution, see this for more: http://www.florinpatan.ro/2016/10/why-you-should-not-use-iri...

Re: Goravel, Web framework inspired from Laravel in Golang

#40
post #11

Earlier quoted context omitted.

AFAIK, no. There are some helper frameworks [1], but none of them is dominant. Two possible reasons: it's quite easy to write a (web) service with the library functions (it even includes a gzip stream), and it's practically impossible to write an ORM framework like you have in Java and Python, so the Go frameworks I've seen are basically a bunch of helper functions. [1] https://github.com/avelino/awesome-go#web-frame…

> impossible to write an ORM framework like you have in Java and Python genuinely interested in knowing why it is so. I quite like Go, but I also like Django, so I would like to know why a Django-like ORM would not be feasible.

I have written about this some time ago here: https://andrewpillar.com/programming/2019/07/13/orms-and-que...

The main reason, in my opinion, comes down to how Go as a language was designed. I have written some follow up posts to that, specifically this one: https://andrewpillar.com/programming/2022/10/24/a-simple-cru... wherein I explore creating an ORM-like library via generics in Go, this may be of interest to you if you want a better understanding of how some of these things would work in Go.

Post reply on HN