Live data from Hacker News

Moving from Go to PHP Again

dannyvankooten.com

141–150 of 371 posts

Re: Moving from Go to PHP Again

#141
post #130
post #106

Earlier quoted context omitted.

Deployment of Go services is much easier. Try to deploy any self-hosted service like nextcloud, gitea. It was a nightmare to deploy nextcloud. Also it turned to be too slow for ONE USER.

Nextcloud is just a bad product :/ it’s hard to pin the blame on PHP.

Still, it took quite long time for me to deploy PHP services. Didn't managed to get seafile(python) working at all. And it was relatively easy to deploy pair of Go services.

Re: Moving from Go to PHP Again

#142
post #94

Earlier quoted context omitted.

Of course. That's the only reason to invent languages: to take care of stuff people are not good taking care of, and move the work to the computer, allowing us to work on the level that we're good at taking care of. Else we'd all be using assembly. There's absolutely no pride or glory in doing things nicely and securely that the computer could have automated in the first place. Anything the language allows that it co…

Incompetent people will create incompetent things regardless of the tool. Simpler tools lead to simpler messes while complicated tools lead to complicated messes. I've seen an attitude that people think they can inoculate themselves from inept programming by using obtuse frameworks as if martin-fowler-speak acts as a drill sergeant making disciplined coders out of the herd. But after 20 years of bouncing around start…

You won't get 4 folders with 26 files handling simple tasks like uploading images to an S3 bucket (saw this huge mess just last week and guess what?! It's broken. I know, surprising right?)

You can see right here on HN anytime a post comes up about using a cloud provider someone advocating putting a layer of abstraction over the provider’s SDK to prevent “lock-in”. As if the CTO is going to one day move their entire infrastructure because a developer promises them they’ve abstracted their code perfectly.

So instead of just being able to read the docs of the SDK, you have a custom QueueManagerFactory that gives you an AWSQueueManager that wraps the Boto3 AWS SDK just so one day if the company decides to move to GCP, someone can write a GCPQueueManager.

See also, developers who think they can effortlessly move from their company’s six figure Oracle installation to Postgres because they used the repository pattern.

Re: Moving from Go to PHP Again

#143
post #19
post #11

Earlier quoted context omitted.

Hm, I hate to be on the bandwagon, but why WordPress? One of the things that has made PHP become what it is today is a focus on good software engineering and the introduction of language features that are required by that. WordPress did not keep up on the engineering front and there are so many amazing options out there now for well written, well engineered platforms. Even in pre-built blog platforms. You're not alon…

I am completely out of the loop here. All I know is that I really disliked Wordpress and really-really disliked Drupal back in the day. Can you mention some of the better alternatives? Once in a while a PHP CMS is what I gotta deal with and I dread it, because of the said systems.

I really enjoyed working with https://bolt.cm/

It was the only CMS I could find that had the level of simplicity I needed.

Re: Moving from Go to PHP Again

#144

Earlier quoted context omitted.

"and embedding php in the html made for a rapid though sometimes trying experience." Funny, that is React/JSX's biggest sell

Not really comparable tho. In React, the JS in the HTML is to make loops and conditional rendering, i.e. presentational logic, like in any other templating system. In PHP, you can embed business logic and database accesses in the HTML.

You can do the same in your React render method I suppose, though it’s a bit harder since you are not attached to the server.

Re: Moving from Go to PHP Again

#145

Earlier quoted context omitted.

"and embedding php in the html made for a rapid though sometimes trying experience." Funny, that is React/JSX's biggest sell

React can't execute arbitrary database queries.

I’m sure you can use the all JS mysql client to connect directly from your client app to your database.

Re: Moving from Go to PHP Again

#146

Earlier quoted context omitted.

> Each PHP file is an endpoint. As opposed to having routers in code or client side SPA routing. I mean that's just how CGI works, most every HTTP server still supports CGI, nothing stops you from deploying that way. Unless you're using Java or the like of course, then it's not very convenient.

You can absolutely do this in Java if you want to. I mean, it's insane and you shouldn't, but it's eminently possible.

I'm not saying it's not possible I'm saying it really isn't convenient.

Re: Moving from Go to PHP Again

#147

Earlier quoted context omitted.

Oof. I haven't read that classic in awhile. Yeah, most of the things in there can't really be fixed without pulling a Python 3 and intentionally breaking backwards compatibility. And the scary thing is people just brush some of these horrifying things off as non-issues. PHP was one of my first languages, and it took a long time to break some bad habits it taught. I still can't get over the existence of PHP's "arrays.…

In the context of what you're doing with PHP, that one-fits-all data structure is all you need. I sincerely doubt you had hurdles in your career because of PHP's array :) However, let's prove once more that languages evolve: http://php.net/manual/en/book.ds.php The "classic" you're referring to is far from something objective. There will always be problems with languages. That's why we have the human factor who is su…

I personally really enjoy the one size fits all array. It’s a serious switch going to any other language though.

Re: Moving from Go to PHP Again

#148
post #13

Each PHP file is an endpoint. As opposed to having routers in code or client side SPA routing. PHP files can be deployed independently, swapped out or updated live. No building/compiling of the php files needed. A single layer as opposed to 'modern architecture' where there's client side back/front end layers, api layer, logic, validator, data access, and ORM layers. Can extend itself as it runs. For example Wordpres…

>Each PHP file is an endpoint. As opposed to having routers in code or client side SPA routing.

The vast majority of PHP frameworks, even micro-frameworks, don't work that way. They route all traffic (except static assets) to an `index.php`, which then forwards it to a regular router.

Re: Moving from Go to PHP Again

#149

Earlier quoted context omitted.

Personally I found it too easy to accidentally forget to check an error, or to shadow a named error return, or to create a nil error that doesn't compare equal to nil. Also to write a method that appears to mutate the receiver but which in fact copies it.

use an IDE

What's a good IDE for Go? Something that's snappy and fast, no Java dinosaurs please

Re: Moving from Go to PHP Again

#150
post #100

Earlier quoted context omitted.

its really not... cache is the equivalent to /tmp check permissions there sometimes.

Unless it is mounted noexec why would you risk setting the exec bits on files that are writable by the webserver?

The exec bit is also important for accessing sub/directories. Although for that you should use X instead of x…
Post reply on HN