Live data from Hacker News

PHP is worth learning and using

bulletproofphp.dev

111–120 of 468 posts

Re: PHP is worth learning and using

#111
post #96
post #94

Earlier quoted context omitted.

PHP was my gateway to understanding C. It wasn't my first, but it definitely helped me learn more computer fundamentals than other languages.

Can you pinpoint anything in PHP that allowed you to gain such knowledge better than whatever your first language was?

I started with BASIC, then shell scripting, then an internally developed language similar to COBOL. Being self taught I didn't really "get" data types, so the big names at the time like C and Java made no sense. PHP was a crutch that allowed me to learn and experiment with functions that were pretty forgiving. The eventual type related bugs I'd introduce into my code where it would work but not correctly eventually helped the concept click in my brain. I still don't get Java.

Re: PHP is worth learning and using

#113
post #47

I have a few questions: - Is the "your app gets initialized and torn down for every request" true for frameworks like Laravel and Symfony? - Does this model uses OS threads? Does it uses green threads? And then a few remarks about the language: - I feel like the Go model is a way better model for server software than async. Since PHP is mostly used for server software, I feel like they shouldn't go with async. Python…

That"your app gets initialized and torn down for every request" is _the_ best feature of PHP. This may sound strange first, but it's true. With web applications written in any other language you have a stateful server running all the time with the following "problems":

* If you have a memory leak your complete server will get killed some time later when running out of memory * If you have a bug which crashes your web server every running request is killed * You get all the hard-to-find concurrency bugs when multiple requests concurrently can access some objects.

With PHP's model of (1) initializing and destroying all the state on every request and (2) every request running in it's completely isolated virtual space you don't have any of these problems.

And if you really want to have a long-running server with shared space you can have that too, take a look at Laravel Octane.

Re: PHP is worth learning and using

#114

I have used PHP for years. Like it. Have accomplished some nice things with it. Think it's evolved nicely in recent years. Feel it's a great tool for particular problems. Will continue to use it. Will always be open to alternatives. Will never understand why some people find that so offensive and will tell you that you mustn't use it or imply that you are ignorant or stupid for using it.

I don’t find it offensive at all. I do, however, feel like the problems I worked on in many years of PHP were some of the least interesting projects of my career. It wasn’t the language’s fault necessarily but the types of things that language is most commonly used for? Also it was just a different time so PHP is possibly not the issue.

Re: PHP is worth learning and using

#115
post #50
post #46

Earlier quoted context omitted.

But what is, if not Visual Basic? Do you shoot for what has had longevity, or what's rising? But what is, if not Motorola 68000 Assembly? Do you shoot for what has had longevity, or what's rising? Pointing out that there is not absolute certainty about what is the top choice for a better idea does not make php, or visual basic, or 68000 worth spending your time on in 2021.

Fine: python, ruby, go, rust, elixir, c, java, javascript, plenty more. Pick whatever you want. Just don't pick a language that is known to be on it's last legs.

I bet that there is a bigger demand for PHP devs then all the Rust,Go and Elixir combined.

So if you need a job you would probably have better chances knowing PHP then knowing Rust. But if in your area is raining with Rust jobs then go ahead and learn only Rust.

Re: PHP is worth learning and using

#116
post #7

This seems like a false dichotomy. Is php totally worthless in 2021. Absolutely not. Is php the best language to spend your limited time learning in 2021? Almost definitely absolutely not as well.

> Is php the best language to spend your limited time learning in 2021? Almost definitely absolutely not as well.

Depends if you want a job or not.

At least in many European countries, there are plenty of them doing PHP.

In fact, when doing our Java and .NET consulting sales for Web projects, PHP is the adversary, not Python, Ruby, Go, Rust, or whatever is on the frontpage, like everyone likes to discuss over here.

Re: PHP is worth learning and using

#117
post #54

I don't really understand the reasons for using PHP outside of that people are already familiar with it and like working with it or want to find jobs in that area. If someone is new to software development and in an area of the world where it's not mostly PHP shops, so bigger cities, I don't really understand the benefit. PHP is often used to do certain things or it may be faster for you to whip something up in Larav…

I think there's value in a large, established ecosystem. Languages tend to go through a few years of flavour-of-the-week fads (think of the Vue/React/Angular competition, and all the also-rans that we can't remember now). If you get in too early, there's a fair chance you'll bet on the wrong ecosystem, and end up with unsupported dependencies or difficult to maintain code. In the worst case, you scrap the whole thing…

jQuery changed my life.

These days I write server code in C++ :(

Re: PHP is worth learning and using

#118
post #19

I have used PHP for years. Like it. Have accomplished some nice things with it. Think it's evolved nicely in recent years. Feel it's a great tool for particular problems. Will continue to use it. Will always be open to alternatives. Will never understand why some people find that so offensive and will tell you that you mustn't use it or imply that you are ignorant or stupid for using it.

and the best part is they're probably javascript developers that don't understand the hell they're living in.

Pretty rare to find someone who writes a lot of PHP without also writing a lot of JavaScript. If there are JavaScript engineers who’ve never touched PHP then they probably don’t have much feelings about it at all

Re: PHP is worth learning and using

#119

I have used PHP for years. Like it. Have accomplished some nice things with it. Think it's evolved nicely in recent years. Feel it's a great tool for particular problems. Will continue to use it. Will always be open to alternatives. Will never understand why some people find that so offensive and will tell you that you mustn't use it or imply that you are ignorant or stupid for using it.

Here's a choose your own adventure for people new to the field. Pick something you want to build, then see which languages are the best suited. If you want to build several things, see which languages are the most recurring and versatile:

- Web frontend: Javascript/TypeScript

- Web backend: Javascript/TypeScript, Python

- Performant backend (where you manage threads and queues): Go, Java, Rust

- Machine learning: Python

- Command line scripting: Python

- Command line tools (binaries, eg 'ripgrep'): Rust, Go

- Mobile: Kotlin, Swift

- Systems/bare metal: Rust (discourage C/C++)

- Desktop games: C#, C++, GLSL, Rust (in ten years)

Mix and match.

The safest three to learn that give you the most flexibility are probably Javascript/TypeScript, Python, and Rust. You can build almost anything with those three.

Re: PHP is worth learning and using

#120

Folks bashing PHP like it's crap but praising any crappy thing if it's built with an esoteric lisp-based language. I mean, if you're starting out, chances are you're better off with js/py or even go but in the end you're paid for the types of problems you solve, not by the language you use... It just turns out that some problems are easier in this or that language, or even people who are good at solving this or that…

R is another language that it is bashed constantly, but it is generally much productive in its field (EDA and stats on structured data) than the alternatives like Python.

This. While I'm not sure I'd build a website or something with R, for pretty much anything data related R is a first choice. Even for big data on clusters or something. It's absolutely amazing at what it does. Super easy Fortran and C++ interop. Bonus that it's well enough known in academia and fields like statistics or economics.
Post reply on HN