Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This matches my experience of PHP. The questions/advice on stackoverflow and blog posts are also geared towards people who just want to get something done, which helps a lot if that's your goal.

Go is the only other programming language I've had this experience with - picking it up with a goal in mind and succeeding in doing something more quickly than I might have with a familiar language.



I remember someone on SO saying "Go isn't a programming language, it's a DSL for writing networked services", and, well, if we can squint and call Go that, we can definitely call PHP a DSL for dynamic webpages.


You don’t even really need to squint that hard.

That’s what it started as.

It’s entire process model (instantiating the world for each request then tearing it all back down, not having any shared state) is fairly unlike most other general purpose languages.

PHP inverts the usual assumption that “this code file is primarily code” on its head—it assumes any file it’s given contains other data until it finds the special open/close tags signifying a section that contains code. (Allowing you to embed it within HTML easily.)

The runtime handles things like GET/POST variables natively and has a special way to expose them. Ditto for file uploads.

The standard library isn’t extensive but contains a ton of functionality that revolves around managing web requests. (Managing HTTP headers, setting and reading cookies, ...)

Etc, etc.


I'd say any sufficiently elaborated template language becomes Php.


Damn that would be a pretty elaborate template language


I’ve been using Go in this capacity quite a lot recently, replacing Java code I had previously been using for these kinds of tasks. And have been pleasantly surprised how straightforward the code is.

Especially now with generics support. I’ve been able to quickly write little meta functions for things like translating Kafka events to a channel of structure and spin up a number of go routines to handle them by making REST calls. The code is concise, clean, and simple, without being overly clever.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: