10 ms·
If third party libraries are important to you, it's hard to recommend Go over PHP. Everything is available in PHP. Go is still very new. Maybe you can code all
by Capricorn2481 3y ago
If third party libraries are important to you, it's hard to recommend Go over PHP. Everything is available in PHP. Go is still very new. Maybe you can code all that you need by yourself, but that's a pill some companies won't swallow.
On another note, whether or not I can make a database in Go is irrelevant. We're talking about replacing PHP, a web language. Why would I need my web language and database language to be the same?
- zer00eyz 3y ago>> Go is still very new. Well over a decade old. >> If third party libraries are important to you, it's hard to recommend Go over PHP. There are plenty of third party libraries for go. This is where most of Go departs from PHP/java/ruby. Php/ruby you might look to something like larval or rails. Java had spring/hybernate/struts/grails (there's a lot there). Is there A framework you're going to jump on in Go? No, Go isnt Rails, it isnt omakase. Go has a ton of parts that "just work" and work well together. You can pick an ORM (gorm) or use code generation like SQLC (magic!). There is a clean validation implementation that covers 99 percent of your use cases and is easy to extend. If you hate that there are 3 solid alternatives. Do you want a custom router, there are lots of choices but the standard library is good enough. How about logging? Works fine out of the box but plenty of choices here too. Auth, Identity and Access control what do you need there is a middle ware for it already or you can build one in 10 minutes. Are you parsing massive JSON files? hey if the standard lib is too slow there's 4 other choices depending on your use case. Want to recycle all your code for CLI tools or service workers ... go is a hell of a lot more elegant than ruby or PHP for this (better concurrency primitives). > On another note, whether or not I can make a database in Go is irrelevant. I have a little project: the web server, the DB the, images, everything. One simple binary, one config file. Im not installing web servers, run times, databases. It's clean simple and out the door. Im playing with a search engine in go that looks like it could be mixed into that same binary and be 75 or 80 percent of what a solr/open search server would be. Would rails or larval be faster to launch. Sure. Are they going to keep getting features out ahead of go after 6 months or a year. No things are gonna be really even. And when ruby or PHP hits the wall (and they have a point where scaling them stops making sense) then what do you do? Port to java... or go? You could just pick go from the start and scale it all the way out. Binary blob monolith to scaled services you can just stick with go....
- Capricorn2481 3y agoI think you're underestimating how big the PHP ecosystem is compared to Go. Auth, Routing, and Sql code generation are basic things that every ecosystem offers. Even obscure languages have these things. Furthermore, Golang is a famous pain in the ass to parse other people's Json, but is fine for known data structures. It's a great example of where the simplicity of the language falls short as well. As a side note, golang doesn't seem to offer anything even close to what other ecosystems offer for Auth without using a third party service. They have some pretty basic libraries from what I've seen, but I could be wrong. These are not things that you're gonna roll in 10 minutes. When working for clients, and they need to connect to an obscure payment processing service, you could roll your own. But I don't want to be the one to tell them why we can't connect to these services without writing these things ourselves when their competitors can because they chose a language like PHP
- zer00eyz 3y ago>> As a side note, golang doesn't seem to offer anything even close to what other ecosystems offer for Auth without using a third party service. https://awesome-go.com/authentication-and-oauth/ https://awesome-go.com/authentication-and-oauth/ Theres ORY if you want your own in house auth zero... There are piles of other things out there. >>> They have some pretty basic libraries from what I've seen, but I could be wrong Basic, maybe... Minimal closer. I like to think of go as brutalist architecture its so drab and functional that it feels ugly, void, and lacking. Look at go's standard library. It's complete, but there isnt a lot of flash there. Good go packages maintain that stance. They give you enough to finish the job. Your not gonna find a package with a lot of "utility" functions in it, your not gonna find a lot of "left pad" like micro libraries. And when you adopt this sort of thinking you dont really need as many choices. When every thing is boiled down to "this is functional/working" it doesn't leave a lot of room for implementation details or interfaces as distinguishing features.