Live data from Hacker News

PHP in 2019

stitcher.io

381–390 of 489 posts

Re: PHP in 2019

#381
post #374

Earlier quoted context omitted.

I do. I was using it back in 2003... pear/DB. I still have some code from that era that uses it.

Would you use a pear dependency in a new project if you weren't pulling bits in from an older one? Personally, I wouldn't... I worked with pear and pecl and composer is just far more pleasant to interact with.

I agree... No, I would not. That code is old enough to drive at this point...

Re: PHP in 2019

#382

I worked at a small PHP shop for about two years. There was a ton of legacy code that was utterly terrifying: a 13-deep nested `if` and the like, global variables, etc. I convinced my boss to let me start using Laravel. It made development worlds more sane. It made development orders of magnitude easier. Laravel does a lot for you, and they’ve thought about how to solve some tricky problems in clever ways. That being…

You forgot one thing: PHP has a far larger community and packages compared to exotic languages like Elixir. Everything is documented and there are tons of resources out there to solve a problem. It's like C++ for the web. Why does C++ still live? Community, extensively tested and adopted by large organizations. Well PHP is the same. Until big companies are out there using PHP (consider Vimeo or Flixbus or Groupon as…

I agree with you: strong community support is essential in the survival of any language/technology. PHP has a large community and a dizzying number of packages. That helps a lot. But I can think of a number of languages (Python, Perl, Ruby) that also have large communities and vast numbers of libraries at their disposal. Therefore, I don't think you could pick PHP over any of those just because "it has more libraries".

Furthermore, Elixir, while it has fewer libraries and a smaller community, is growing fast. The core language is also exceptionally well documented and discoverable. It has libraries that cover essentially all your common use cases.

I guess what I want to say is, I'm happy PHP is getting better for all the programmers stuck using it. There's no reason to use it for anything new, because there's always a better tool out their for your job.

Re: PHP in 2019

#383

Earlier quoted context omitted.

What's wrong with Laravel or Symfony?

I don't know if there's anything inherently wrong with them. I'm just saying that I don't see any job listings for them as an interviewee, or see any resumes with them as an interviewer. In contrast to other technologies that HN or Reddit declare to be "dead" or "dying", yet actually seem to run the world with no serious disruption on the horizon yet.

Where do you live? In the US there are a shitload of PHP and Laravel jobs.

Re: PHP in 2019

#384

Earlier quoted context omitted.

I'm not one to proselytize since I use a handful of languages every day, but when my Java hat is on, I double click a build target, my software is tested, built, deployed side-by-side with my current production build. New users are automatically pushed to the new build, and users with existing sessions remain on the previous build. When I undeploy the previous build, the rest of the users start seeing the new build a…

What's your setup?

Grails / Tomcat

Re: PHP in 2019

#385

I think the easiest thing to forget is what made PHP popular was how easy it was to get started writing software that worked good enough. The barrier to entry was incredibly low. It caused a lot of bad code & gave PHP a bad reputation but a lot of good was also made from it. PHP made a lot of careers for developers as they were able to fake it until they made it while learning how to code & providing significant valu…

The thing that I like about PHP is that I can mix HTML, code, and database queries into a single file. This is incredibly useful when learning basic web development, even though it doesn't scale for more complicated applications. It's also incredibly useful when trying to bang out a simple experiment.

In the world of machining people will often build a tool for a job. Its a one off, or something that will rarely if ever be used again.

These features of PHP are still eminently useful if you have to do the dirty one off. You can eliminate a massive amount of time pressure (an emergency or time invested vs time saved) if you dont have a ton of overhead that comes with modern frameworks.

Re: PHP in 2019

#386
The question for me is what can PHP do better than any other language out there?

I've worked with Laravel for a few years and while it has sooo many great features out of the box, it doesn't quite detract from how unpleasant working with PHP is, when comparing with any other common/modern language. Of course this is only my opinion and experience with it.

I don't think I would ever recommend PHP to anyone unless they live in an area where you can only find PHP job opportunities. Otherwise, any other language can do what PHP can do and will provide a better programming experience IMO.

Re: PHP in 2019

#387

Earlier quoted context omitted.

> That's irrelevant. When talking about language consistency, we should also be including the language's standard library. As you said, PHP was merely an interface to (many already existing) modules written in C. When people complain about mysql_real_escape_string() in PHP they don't realize that that is the actual name of the function in the MySQL C API. Same with the image functions (imagemagik). And so on. Some ar…

Genuine question, because I do not know the answer. Does it support: Lexical scoping Coroutines Generators Decorators Generic type containers A functional API (e.g. something like Java 8 streams) An extensive selection of data structures (collections) included in the standard lib ?

> Lexical scoping

Yes.

> Coroutines

No.

> Generators

Yes.

> Decorators

No.

> Generic type containers

In progress. But also PHP has dynamic/weak typing and static/strong typing so this isn't strictly necessary.

> A functional API (e.g. something like Java 8 streams)

Available as a 3rd party library.

> An extensive selection of data structures (collections) included in the standard lib

https://www.php.net/manual/en/book.spl.php

Re: PHP in 2019

#388
post #159

Earlier quoted context omitted.

Your parent comment has a point about performance; I don't see why he is downvoted. Crystal is cool, but it is still immature in terms of ecosystem, the language could change, limited library support, and most importantly, not many great engineers . Particularly not outside of the valley. Performance is a concern for many people, and this is somewhat overlooked because of the number of people here who work for compan…

I simply meant that Crystal lang features ultra high performance, and yet shares much of Rubys syntactical elegance. Much is built into the standard library and I have to ask what your experience with Crystal has been like so far? I find pretty much everything I need, and the easy FFI with C takes care of most of the rest (see the Mongo.cr wrapper for the C mongo driver, for example...)

I agree with that assessment. My experience has been reading a good bit into it. I considered learning it a few months ago, but wanted to focus on things that people were currently hiring for. Maybe at some point I will learn more, but I am a bit too broke right now to spend that much time on something that doesn't pay. I don't say that to be disparaging, it goes back to my point about it being immature and not having many engineers or companies using it.

Re: PHP in 2019

#389
In all honesty, Laravel has been a blast to create projects with. Prior to that framework, I had very little experience with PHP or any back-end development. It's simple to setup, has sane/safe defaults, and it scales well with the complexity of projects. Can't recommend it enough!

Re: PHP in 2019

#390
post #27

Earlier quoted context omitted.

There are comparable things with other frameworks too. For example I wrote a course on building a SAAS app with Flask. It's available at: https://buildasaasappwithflask.com/ It covers everything about user registration, profiles, subscription billing, 1 time billing, invoicing, and about 50 other things you would likely want to do in a SAAS app or any application really. The course comes with the source code along wi…

Nice! It looks very nice and complete. I've found this other one in Go lang https://buildsaasappingo.com (I'm not affiliated nor tested it) I think it is a good idea to turn something that you need for yourself into a side income, I've though about doing this same thing myself in a different language. What can you tell about your experience building this course, is it worth it ? rewarding ? Did you find difficult to…

Hey thanks for mentioning my book. Like nickjj after building 2 SaaS in Go, I noticed that there were lots of pieces that could be extracted into a library.

I'm currently building another with that library.

Post reply on HN