3 ms·
I spent years making money off of PHP. I was doing PHP when shitting on PHP was cool. I spend most of my time writing GO now. Go + htmx + tmpl is all you need
by zer00eyz 3y ago
I spent years making money off of PHP. I was doing PHP when shitting on PHP was cool.
I spend most of my time writing GO now.
Go + htmx + tmpl is all you need for a basic site. The go runtime produces binaries... While you're still installing php and a web server, my binary is already running and in systemd.
Need validation, grab validator. Need a DB, grab sqlc and write sql and then have the code for your API calls generated for you!!! (This bit of code generation feels like magic candidly)
Need a command line tool? GO.
Have to build a Key Value store? GO
Want to build a database? GO
Do you need a container deploy system ... well Kubernetes is already in GO...
There was a magic to LAMP and PHP 4... it was the right stack at the right time. When I work in go now I feel all that magic again.
- cies 3y agoI like Go. But how come they have not fix the issue with implicit nulls? Null guards everywhere... I cannot believe that a company as mighty as Google did not choose to use decades old insights on how to fix this. Now it's really hard to fix. The std lib already does implicit nulls all over the place. Kotlin kind of fixed it for Java, and it really helps us. PHP is old, and makes it easier to forgive it's mistakes. But Go?
- hbogert 3y ago> I like Go. But how come they have not fix the issue with implicit nulls? Null guards everywhere... I cannot believe that a company as mighty as Google did not choose to use decades old insights on how to fix this They relied on decades old insights of persons who worked on C and Unix. That said, I'm honestly still on the fence about if nil checking is really braindead, or just what it boils down to in the end and the rest like exceptions and Options/Result is just theatrical. What I don't get is that they are not more pedantic about checking nil errs in the compiler. They error hard during compilation on unused variables, but err checking is simply not done.
- kaba0 3y agoWhy? Like, besides some basic cli tool, and some “system” network programming (what google meant in their marketing, as go is definitely not a system language), I fail to see any benefit of that thoroughly uninteresting language. It’s basically Java 1.2, sold in “Unix-flavor”, somehow making it acceptable to the people that otherwise hate to touch anything non-C (and in extension, never having used anything more modern)
- zer00eyz 3y agoWhy go: I like Rust, and zig. Both end up with better performance than go. All three will output portable binary. I like Ruby and Django. I can get a V1 site out faster than I can with go. Java is java. Its great if its huge, but hard to do "simple" in java... and the specter of "is this the year oracle fucks every one" looms large in the java ecosystem. The compile/test loop for GO is stupid fast. How go deals with dependency is fist class. Go nailed concurrency model has found a sweet spot between safety, ease of use and developer performance that is unmatched. Go is the "brutalist architecture" of programing. Most people look at it and go "why" but if you embrace it, and adopt it, there is an effective sensibility that you're not really getting elsewhere.
- Capricorn2481 3y agoIf 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....