Live data from Hacker News

Go with PHP

gowithphp.com

41–50 of 532 posts

Re: Go with PHP

#42

> There is no need to compile anything. But I really like compilers, they catch a whole class of bugs, before I run things.

And static typing, and linting, and code analysis, and security checks, and .. these pipelines are long nowadays

Oh and the garantiert that no one can modify it post the compile step.

Re: Go with PHP

#44
post #17

As a fullstack developer who has worked many, many years in the javascript hellhole, I mean ecosystem, as well as the python ecosystem and .NET; coming back to PHP the last 2 years, working essentially in Laravel and the like - I couldn't approve more of this message. Seriously, PHP is the grand father that will drive you to class and you'll never be late, the car will never smell and everything will always just be f…

This 100%. It's actually a bit of a red flag to me these days if a developer turns up their nose at PHP. The language has matured a lot and building stuff with it is simple, cheap, straightforward and fast. If someone's still hating on PHP in 2023 it makes me wonder if they've been focused on more exotic technology because they were looking to pad their resume with more expensive skills, build science projects for their own amusement vs. what the business needed, etc. etc. Red flag. I've had these guys like this on my team and guess what, they built fancy over-engineered solutions to problems that no one had and then job hopped and left it for us to deal with. I can't speak for anyone else but I go into work every day for one purpose, and it's to ship shit which users use. I don't have room on my team for people who have other priorities. The amount of stuff you can get done with basically just PHP and Linux is amazing.

Re: Go with PHP

#45
post #38
post #9

Earlier quoted context omitted.

Just made the same comment and deleted it seeing that you already stated it. Protecting against all of these is hard and no tech is going to automatically protect for all of this on its own. Such a weird statement to make that takes away from the message of the site entirely.

I worked for a company and we used the PHP ORM Propel. So in theory no SQL injections you would think, WRONG. We used a function like findOne() (I don't recall exactly). It looked like this: $resetTokens->findOne($GET['password-reset-token']); The issue was that findOne would accept wildcards, so one could use ?password-reset-token=% in the URL and reset the password of any random users.

... why would you pass $GET through to a logical layer with access to a data store write without sanitizing it?

This seems like a pretty basic thing to fix, but then I only have your snippet to go by.

Re: Go with PHP

#46
I agree with the message, but the example has:

- hidden global state

- arbitrary string literals

Is that Laravel?

Re: Go with PHP

#47

> There is no need to compile anything. But I really like compilers, they catch a whole class of bugs, before I run things.

While you don't have a proper compilation step, you can run some very good static analysis on PHP.

I can't imagine not having Psalm or PHPStan in our build pipelines.

Re: Go with PHP

#48
post #24

I'm in the group described halfway down: was on the Internet during PHP 5, lost interest in it, and moved on [to Go]. I haven't written anything in PHP newer than version 5. Even transitioning from 4 to 5 was quite a big deal, I definitely noticed improvements. But it wasn't enough. I couldn't fit the data set in memory with PHP. But I could do it with Go. I couldn't do parallel computations in PHP in order to respon…

[deleted]

Re: Go with PHP

#49
Any programmers here who've used PHP to build command line tools in PHP? What is the experience like compared to, let's say Python or node.js? How good are the facilities? What are the limitations?

Re: Go with PHP

#50

Coming from Rails, how does Laravel compares? If you know both languages, which one would you pick? I've this hunch that there's no reason to lick Laravel over Rails, since that latter is the bees and knees for web development. Alternatively: what would you suggest someone getting into web development to learn? PHP or Ruby?

Personally Rails. From a business perspective both are fine.
Post reply on HN