Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Notorious b.s.d.
Jan 25, 2003

by Reene

Sapozhnik posted:

Php is the boomer programming language

IT WORKS FINE THE WAY IT IS DON'T CHANGE IT OR YOU'LL BREAK SOMETHING WHY ARE YOU ALWAYS TRYING TO BREAK THINGS THAT ALREADY WORK

p. sure rasmus is literally a boomer

Adbot
ADBOT LOVES YOU

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
nah, he’s an Xer and surprisingly nice

got to have dinner a number of years ago with him and Guido and others

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Antigravitas posted:

I was pointed to https://github.com/php/php-src/blob/master/ext/pdo_mysql/mysql_statement.c#L235 for an example of PHP's excellence in dealing with databases.

I'll admit to be not very good at C/C++, but…is that doing what I think it's doing?

the only obvious problem with this code is that the comment should have a link to the applicable mysql bug. a mundane workaround for a bug in a different library is a pretty boring choice to show "PHP's excellence" though.

eschaton posted:

nah, he’s an Xer and surprisingly nice

got to have dinner a number of years ago with him and Guido and others

rasmus gets a lot of poo poo for having designed a bad programming language, but he fully admits that he didn't do a very good job and has never pretended that php is anything other than something he hacked together to solve his particular needs. he's like the exact opposite of the go designers.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

Plorkyeran posted:

rasmus gets a lot of poo poo for having designed a bad programming language, but he fully admits that he didn't do a very good job and has never pretended that php is anything other than something he hacked together to solve his particular needs. he's like the exact opposite of the go designers.

well except for the "having designed a bad programming language" part

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
he doesn’t put on airs and never really has though, that’s the key difference

PHP is just a thing that he made

Rob Pike et al insist that Go is “well-actually good”

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



HappyHippo posted:

well except for the "having designed a bad programming language" part

p sure php wasnt designed, it just sprang fully formed from rasmus' loins

Ralith
Jan 12, 2011

I see a ship in the harbor
I can and shall obey
But if it wasn't for your misfortune
I'd be a heavenly person today
so what you're saying is, php is a kidney stone?

Beamed
Nov 26, 2010

Then you have a responsibility that no man has ever faced. You have your fear which could become reality, and you have Godzilla, which is reality.


HappyHippo posted:

well except for the "having designed a bad programming language" part

he didn’t really design it to be a programming language, he just built a tool to help him make sites and poo poo. then programmers happened

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



php is fine for making a personal home page, its just a shame that other people started using it for important stuff

Ralith posted:

so what you're saying is, php is a kidney stone?

checks out, i wouldnt use someones kidney stone for important stuff either

abraham linksys
Sep 6, 2010

:darksouls:

Krankenstyle posted:

php is fine for making a personal home page, its just a shame that other people started using it for important stuff

i would even argue it's probably fine for a hypertext preprocessor!

akadajet
Sep 14, 2003

abraham linksys posted:

i would even argue it's probably fine for a hypertext preprocessor!

a personal homepage

Sapozhnik
Jan 2, 2005

Nap Ghost
Php got there first and is easily deployed on classical shared hosting setups. Even now it's a lot easier to just ftp a bunch of poo poo to a public_html folder than it is to set up a full blown VM and configure nginx and stuff.

Docker almost gets there for ease of use but not quite. Config management isn't it and never will be it for casual projects.

akadajet
Sep 14, 2003

php is so easy even dumb 15 year old me was able to make insecure webapps with it.

seriously, my first php app was a news aggregator and blog and it got owned because someone figured out how to inject new articles through the comments

Sapozhnik
Jan 2, 2005

Nap Ghost
Php's poo poo security is orthogonal to its ease of deployment. Unfortunately.

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

akadajet posted:

php is so easy even dumb 15 year old me was able to make insecure webapps with it.

seriously, my first php app was a news aggregator and blog and it got owned because someone figured out how to inject new articles through the comments

mine was a single page with a guestbook and a link to a video about penguins. nobody signed the guestbook, but iirc i just stored each comment as a separate file in the file system because i has never heard of a database before

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



I wrote my lovely web apps in perl :smuggo:

Cybernetic Vermin
Apr 18, 2005

my webapps are a mix of bash and c. i am pretty sure they have no security issues whatsoever.

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

Krankenstyle posted:

I wrote my lovely web apps in perl :smuggo:
ah, the booking.com model of development

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
imo if what you want to do is expose a web service that takes an http request, validates some fields, and stuffs them in a database, or takes an http request, runs a database query, and spits out results, php is actually very good and practical

i would not build anything in php that took more than about 50 lines of php to write, though

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
honestly its a shame that more languages have not approached mod_php levels of deployment. that was probably the big thing that cemented php in place in history, and somehow everything that came after requires three nginx backwards proxies, a load balancer, and an orchestration control plane

Athas
Aug 6, 2007

fuck that joker
I still like plain CGI because the 1:1 relationship between program and page, and the from-scratch execution on page load, makes simple things really easy to set up and keep running. I don't care about the scalability or performance of my web trash at all.

Cybernetic Vermin
Apr 18, 2005

it is generally sort of weird that there hasn't been more webby languages that just up-front glues themselves to a web server and a sql database, since 99.9% of usecases would be improved by just accepting e.g. apache+postgres as a default if that means that everything is wired up at the get-go and can be purchased as semi-managed hosting.

cgi remains great for just knocking a tiny thing out too.

but otoh this is the pl thread and probably just tearing down abstractions left and right is not on-theme.

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

fart simpson posted:

mine was a single page with a guestbook and a link to a video about penguins. nobody signed the guestbook, but iirc i just stored each comment as a separate file in the file system because i has never heard of a database before

better db than mongo tbh

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Cybernetic Vermin posted:

it is generally sort of weird that there hasn't been more webby languages that just up-front glues themselves to a web server and a sql database, since 99.9% of usecases would be improved by just accepting e.g. apache+postgres as a default if that means that everything is wired up at the get-go and can be purchased as semi-managed hosting.

cgi remains great for just knocking a tiny thing out too.

but otoh this is the pl thread and probably just tearing down abstractions left and right is not on-theme.

https://hub.packtpub.com/introducing-postgrest-a-rest-api-for-any-postgresql-database-written-in-haskell/

written in Haskell so extreme on brand for plang thread

Nomnom Cookie
Aug 30, 2009



Malcolm XML posted:

better db than mongo tbh

mongo doesn’t throw your data in the trash by default anymore, at least

Soricidus
Oct 21, 2010
freedom-hating statist shill

Nomnom Cookie posted:

mongo doesn’t throw your data in the trash by default anymore, at least

if you’re sending data to mongo then it is you that is throwing it in the trash :xd:

distortion park
Apr 25, 2011


Some of our data is in mongo but people keep putting the wrong shape in (it should all be the same shape) so rather than applying a schema were writing a new validation layer from scratch.

Progressive JPEG
Feb 19, 2003

I like stuff like scgi since it allows decoupling the webserving from the app and the protocol is super simple so p much every lang supports it, while not requiring a process launch on each request like regular cgi

Antigravitas
Dec 8, 2019

Die Rettung fuer die Landwirte:

fart simpson posted:

mine was a single page with a guestbook and a link to a video about penguins. nobody signed the guestbook, but iirc i just stored each comment as a separate file in the file system because i has never heard of a database before

That is perfectly valid for a number of document based workflows. You'd have to do some restructuring if it grows, because having 100k small files in one folder tends to perform like arse, but if you can compute the name of the file from the request you can get pretty good performance from this.

Dokuwiki does this. Even if everything crashes and burns you can still access documentation by grepping through the plain text pages.

CPColin
Sep 9, 2003

Big ol' smile.
My son is also named ../../../../etc/passwd

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

pointsofdata posted:

Some of our data is in mongo but people keep putting the wrong shape in (it should all be the same shape) so rather than applying a schema were writing a new validation layer from scratch.

an external validation layer is probably the right call. every time i have a conversation about mongo schema validation i am just left with more confusion about how anyone thought the design chosen was useful or would work

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."

Cybernetic Vermin posted:

it is generally sort of weird that there hasn't been more webby languages that just up-front glues themselves to a web server and a sql database, since 99.9% of usecases would be improved by just accepting e.g. apache+postgres as a default if that means that everything is wired up at the get-go and can be purchased as semi-managed hosting.

i suspect that the rise in popularity of rest-style web apis was the source of the disconnect. once you start worrying about "routing" requests, encoding arguments into the hierarchical structure of a URL and dealing with different verbs you lose any meaningful mapping between directory structure and scripts that should get executed

this "modern" approach is mega overkill for many simple use-cases, though, which is why i think it's good that php still exists for said simple use-cases

Shaggar
Apr 26, 2006

Cybernetic Vermin posted:

it is generally sort of weird that there hasn't been more webby languages that just up-front glues themselves to a web server and a sql database, since 99.9% of usecases would be improved by just accepting e.g. apache+postgres as a default if that means that everything is wired up at the get-go and can be purchased as semi-managed hosting.

cgi remains great for just knocking a tiny thing out too.

but otoh this is the pl thread and probably just tearing down abstractions left and right is not on-theme.

SQL server had a featrure that was litterrally this. you could expose your procs directly as SOAP. idk if the implementation was the right way to handle it wrt security, but the idea is good.

of course web "developers" are loving morons so we get poo poo like json.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



Internet Janitor posted:

i suspect that the rise in popularity of rest-style web apis was the source of the disconnect. once you start worrying about "routing" requests, encoding arguments into the hierarchical structure of a URL and dealing with different verbs you lose any meaningful mapping between directory structure and scripts that should get executed

this "modern" approach is mega overkill for many simple use-cases, though, which is why i think it's good that php still exists for said simple use-cases

i remember using CGI::Application to rewrite path-style urls to query args before passing them on to my handler functions. tbh im not sure why, im sure theres an easier way

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Nomnom Cookie posted:

mongo doesn’t throw your data in the trash by default anymore, at least

i trust the fs more than I do mongo and linux fs consistency is trash, so

Bloody
Mar 3, 2013

Suspicious Dish posted:

honestly its a shame that more languages have not approached mod_php levels of deployment. that was probably the big thing that cemented php in place in history, and somehow everything that came after requires three nginx backwards proxies, a load balancer, and an orchestration control plane

last time i made a fart web app i just clicked publish to azure in visual studio and then it was on the internet

Bloody
Mar 3, 2013

well i guess that was the last time i made a publicly facing one. last one i made period was an internal tool so i spent a little bit of time loving around with an autogenerated dockerfile to get it to go into our docker thingy correclty. took like half an hour of blind googling and copy pasting. it was awful

Nomnom Cookie
Aug 30, 2009



Malcolm XML posted:

i trust the fs more than I do mongo and linux fs consistency is trash, so

just follow every write() with an fsync(), and also an fsync() on the directory if the size changed! easy. this is something that even mongo (nowadays) does better than a randomly chosen php dev will

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

Nomnom Cookie posted:

just follow every write() with an fsync(), and also an fsync() on the directory if the size changed! easy.
falsehoods programmers believe about fsync

Adbot
ADBOT LOVES YOU

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Nomnom Cookie posted:

just follow every write() with an fsync(), and also an fsync() on the directory if the size changed! easy. this is something that even mongo (nowadays) does better than a randomly chosen php dev will

lol

it's way the gently caress harder than that

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply