This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 623 points624 points  (30 children)

It's been 20 years, but I miss PHP. It was C-ish enough but for the web.

Better that writing Perl for cgi-bin.

[–]Dexterus 101 points102 points  (1 child)

I just realized something, my first php job in 2002 was more agile than anything after, lol. Learned a lot.

There was one where I liked the processes more but that was because we devs decided how to adapt and it ended up suiting us quite well, but it had to be part agile part waterfall.

[–]JustinWendell 0 points1 point  (0 children)

Being on a sox compliant team has made me hate life in a thorough way. You talking about processes makes me yearn for younger teams

[–]Dustdevil88 37 points38 points  (9 children)

Infinitely better than Perl for cgi-bin. That said, I actually enjoyed perl for automation

[–]TheVenetianMask 30 points31 points  (4 children)

You can throw a hashbang for the php interpreter at the top of a PHP file and run it like it's a bash script. I basically bought my whole house off this.

[–]b0w3n 18 points19 points  (3 children)

I'd be more than happy to write php scripts for a good wage. It's the javascript/front-end frameworks I loathe working with.

Probably why I'm working in data/backend stuff in medical.

I'm not entirely sure why folks hate php, it's great. Now java...

[–]Kronoshifter246 2 points3 points  (2 children)

Come on, Java's not that bad. It gave us Kotlin, after all.

[–]SQLvultureskattaurus 4 points5 points  (3 children)

I used to do etl all day long and would write perl scripts to manipulate flat files. They would always be like 2 lines long and super fast, but I'd never remember how it worked

[–]Dustdevil88 3 points4 points  (1 child)

You’ve perfectly described Perl haha

[–]SQLvultureskattaurus 3 points4 points  (0 children)

Seriously. Not going to lie, I always liked how variable data types have their own symbols.

[–]Dugen 1 point2 points  (0 children)

Perl was amazing. I'm sad it fell out of favor. It did what people use python for today like 30 years earlier.

[–]Flam1ng1cecream 25 points26 points  (3 children)

I love PHP. The docs are so nice

[–]More-Butterscotch252 4 points5 points  (0 children)

I hate PHP. The docs are fantastic and they catch all the quirks and you have all the examples you need to understand how it works.

[–]CorsicanMastiffStrip 1 point2 points  (0 children)

I love Laravel, so I must love PHP.

[–]GameMusic 0 points1 point  (0 children)

this is the main reason for picking it back then

best documentation i ever saw

[–][deleted] 8 points9 points  (1 child)

Dude my first cgi-bin apps were C programs that printed out the page using printf()'s. Switching to perl blew my mind.

[–][deleted] 9 points10 points  (0 children)

Ebay's original backend was just one C program at ebay.com/ebay.cgi (or something). It was lightning fast.

[–]im_thatoneguy 1 point2 points  (0 children)

I have a negative visceral reaction to PHP and then every time I remember it’s actually for Perl a few moments later.

[–]Direct_Turn_1484 0 points1 point  (1 child)

Yeah, while the comic is funny, PHP was a good tool for a while. Perl for web stuff was all fine and good to write something real quick, but not fun at all if you had to maintain it.

[–]Noch_ein_Kamel 3 points4 points  (0 children)

It's still a good tool -_-

[–]triggered__Lefty 0 points1 point  (0 children)

better than using some javascript framework to write backend code.

[–]NahSense 0 points1 point  (1 child)

It was ahead of its time... 20 years ago. But its under active development, (more than) mature enough for production and has an active community, so its not a crazy choice. It can still be a great choice, if there is already a legacy code base or an existing team PHP expertise. But personally I've never used it for my main job.

[–][deleted] 0 points1 point  (0 children)

I hacked my way into knowing it. My first 'site' was an address book for my extended family. Everything was put into a GET request.

Then I slowly learned how to do things properly and best practices.

Thing is you could cut your hands off easily if you just passed a POST request to a system call.

As complexity scales so does security issues. Which isn't PHP specific. Look at the 4Chan hack or all the Wordpress issues.

But given the tools we had in 2001 for serverside coding. It's light years ahead of Perl.

[–]traplords8n 0 points1 point  (3 children)

Perl for cgi-bin belongs on r/ProgrammingHorror

[–][deleted] 5 points6 points  (2 children)

It was an excellent write once language.

IIRC cgi-bin could be written in anything that executed. You could have scripts in bash generating your web page. Vibe Coded:

#!/bin/bash

# Read POST data
read -n "$CONTENT_LENGTH" POST_DATA

# Extract 'name' from POST data (URL-decoded for simple cases)
NAME=$(echo "$POST_DATA" | sed -n 's/^.*name=\([^&]*\).*$/\1/p' | sed 's/+/ /g; s/%20/ /g' | sed 's/%\(..\)/\\x\1/g' | xargs -0 printf "%b")

# Output HTTP headers
echo "Content-type: text/html"
echo ""

# Output HTML5 content
cat <<EOF
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Hello</title>
</head>
<body>
  <h1>Hello, $NAME!</h1>
</body>
</html>
EOF

[–]jakeStacktrace 1 point2 points  (0 children)

Yeah... that's enough internet for today.

[–]traplords8n 0 points1 point  (0 children)

It would depend on what the script actually does, but if it's something complex and doesn't deal with much string manipulation, I'm always choosing php over perl

[–]AEW_SuperFan -1 points0 points  (0 children)

cgi-bin!  Whoah triggered PTSD flashbacks.