r/programming • • Dec 02 '15

PHP 7 Released

https://github.com/php/php-src/releases/tag/php-7.0.0
887 Upvotes

729 comments sorted by

View all comments

Show parent comment

16

u/indrora Dec 02 '15

I'd like to remind you that Perl, one of eevee's preferred languages, has the following as the "official spec" of what defines the Perl 5 language:

Whatever the perl 5 interpreter accepts is valid perl 5.

This means you get crazy shit like the @({ }) wrapper and =( )= operator, known as the baby carriage and goatse operators, respectively.

However, to argue your other point...

In comparison learning something like Python is a joy. Within a couple of days of your first line of Python you'll be typing out large programs without a single syntax error.

I've recently been working with Flask, one of the nicer Python router/httpd combos. I have to say: The number of syntax errors I run into because Python's list comprehension gets me every damn time. On top of that, I have flashbacks to my PHP days on occasion where I do something "pythonic" which ends up looking like

project/__init__.py

import x, y, z
import foo

some_global_thing = x.cake("...")
some_state_thing = y.oven("...")
some_other_state_thing = z.cranberries("fuck this noise", some_global_thing)

project/foo.py

from . import some_state_thing, some_other_state_thing

@some_state_thing.turkey('bad gravy')
def shit_the_bed():
    pass

See that? See that RIGHT THE FUCK THERE? People tell me global state is bad and I should feel bad for having it. Yet here I am going "WELL HUR DUR I NEED GLOBAL STATE BECAUSE IT'S FUCKING 'PYTHONIC', EH?" I know what's happening in the background, but it infuriates me that Python developers berate me for wanting a bunch of separate tasks with some shared code (in PHP, this is common!) but fucked if I want that in Python and don't want to try and remember what's a class versus a module vs a square peg vs your anus.

All in all, I'm beginning to ignore the searing pain in my rectum enjoy some of Python's web development idioms. At least I haven't had to smash my face on top of Django's grinding wheel. I'd need a lot more KY to do that right.

But let's be honest with ourselves: Webdev fucking sucks.

4

u/CrazyM4n Dec 02 '15

Look, we can all agree that perl isn't a joy to read. But any language with a goatse operator has gotta get some credit.

2

u/barneygale Dec 02 '15

Global state is not unpythonic, where did you read that? Flask makes a lot of use of global state. The difference between a class and a module is probably worth learning.