« first day (896 days earlier)      last day (4046 days later) » 

9:00 PM
Maybe trying to mimic Rails? Bad defaults are their territory ^^
 
the one good thing about SF always has been that it does not mimic rails
 
@NikiC most likely to be more beginner friendly, and I would agree with that. people who rely on the generated stubs probably don't even know what DI is.
 
user895378
If you look at the symfony docs they explicitly demonstrate the container by using it as a service locator: symfony.com/doc/2.0/book/service_container.html
 
user895378
class HelloController extends Controller
{
    // ...

    public function sendEmailAction()
    {
        // ...
        $mailer = $this->get('my_mailer');
        $mailer->send('ryan@foobar.net', ...);
    }
}
 
user895378
Don't inject the mailer service. Inject the all powerful SL and go hunting through your entire app of globally accessible state for a mailer.
 
9:01 PM
it actually hurts to read this =/
 
user895378
So that's where I'm coming from with my comments regarding SLs and Symfony.
 
yeah, that example is a bit unfortunate. that should be fixed.
 
public function indexAction($bar)
{
    $session = $this->get('session');
    $session->set('foo', $bar);

    // ...
}
 
Controllers as Services is linked at the very bottom of the page.
 
user895378
@igorw See that makes so much more sense.
 
9:03 PM
and that doc also kinda blows
 
@igorw It is full of such examples
 
fact that there exists Controller::get() is a code smell
 
thanks for linking me to specific examples, I totally understand why one would think it's locator only based on that.
most of my knowledge on the topic is from the source code an blog posts. I don't actually spend much time reading the sf2 docs.
 
user895378
Of course, all of these problems would be solved if we just used Python.
 
@rdlowrey obviously ... look at how good the Django clone in PHP turned out. Yii .. oh .. wait ..
 
9:07 PM
@tereško in general I agree with you, but this is not a mandatory base class, it's a purely optional one.
 
user895378
hehehe it's true.
 
user895378
Django ... what a mess.
 
afaik , Django was inspired by Rails
 
user895378
But seriously if I could do all my error handling like this I can't even explain how happy I'd be:
 
user895378
try:
    pass
    # do something
except Exception:
    pass
finally:
    pass
 
user895378
9:10 PM
You mean I don't have to check for and/or suppress errors and notices from every built-in language function?!?!?!?! Preposterous!
 
why the finally pass?
 
user895378
I was just putting the pass statements in for syntactic correctness.
 
@rdlowrey many thanks for pointing this out, I will talk to the guy in charge of docs.
 
user895378
@igorw no problem. Thanks for listening and not taking my opinions as a personal attack :)
 
user895378
@NikiC I'd been operating under the assumption (having seen a few benchmarks) that as of 5.4 PHP was slightly faster than python on most tasks. However, my recent experiences indicate that while the gap has narrowed tremendously, python still seems to be a bit quicker (at least for the things I've been comparing).
 
9:14 PM
@NikiC pass is 'python' for 'I needed a statement here, but it doesn't do anything'
 
@rdlowrey I have no idea about Python performance, can't really say anything to that
@BenjaminGruenbaum Sure, I was just wondering about the use in that particular example ;) I didn't realize it was just dummy code and not intended as "discard all exceptions"
 
user895378
I was mostly just passing that along as an FYI. But newer PHP seems to be more or less as fast as Python.
 
user895378
Which makes me feel a bit better about using PHP all day.
 
@rdlowrey Always depends on what one is doing I guess
 
user895378
True.
 
9:17 PM
That's also the reason why looking at benchmarks conducted by other people than yourself is usually a total waste of time
 
user895378
It really is.
 
Just yesterday or so saw another inter-language framework performance comparison where they really did run php without opcode cache...
 
@rdlowrey in case you care, here's the blog post that explains moving from base controller and locator to DI.
 
user142019
Good morning.
 
Welcome Zoid.
 
9:24 PM
I don't get some questions... stackoverflow.com/questions/15723570/…
 
user142019
@NikiC linky?
 
user895378
@igorw Thanks for the heads up.
 
user142019
I answered a question about PHP today.
 
user142019
Where can I ask for forgiveness?
 
i think i will actually install Neverwinter Nights now
 
9:36 PM
@Zoidberg hell
 
user142019
@Satan yo dawg can I ask you a question.
 
@Zoidberg I think Satan is probably in the Java room
 
Good evening.
 
user142019
@BenjaminGruenbaum I think Satan invented both Java and PHP.
 
@Zoidberg To think I actually liked his paper about algebraic constraints :(
 
9:41 PM
@Zoidberg in that case , who made Objective C ?
 
@Zoidberg No PHP isn't evil, it's far too disorganised and incoherent for satan. I suspect it was merely one of God's Sunday morning fuck-ups. Y'know, when you try and cook breakfast when you're really hung over an burn eveything.
 
user142019
@tereško Satan's second-born daughter.
 
Jon Ribbens said "PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals" , that said, I have no idea who Jon Ribbens is :P
 
user142019
9:54 PM
Perl is almost as bad as PHP.
 
user142019
Perl is just a little better than Java.
 
Anonymous
11:04 PM
Religion is a sacred subject to be subjected to humour
 
11:20 PM
@phpNoOb That was a stupid statement :/
 
@BenjaminGruenbaum which statement?
 
16 mins ago, by php NoOb
Religion is a sacred subject to be subjected to humour
 
@BenjaminGruenbaum Agreed, just wasn't sure that you were referring to that one.
 
@phpNoOb lol
@Lusitanian and lol at that too ^^
 
* The moment I notice I can't see (removed) messages because this isn't the JavaScript room *
^ That was probably a "Thanks god this is not the JavaScript room, I wish he'd die"
 
11:28 PM
lololol
 
Anonymous
11:45 PM
what is the lolling about?
 
yo
 
Anonymous
@NikiC Me don't like you
 
@phpNoOb je ne suis pas sure, mais je pense qu'il faut evité de rigolé avec ces gas ...
 
Anonymous
@HamZaDzCyberDeV tu as raison, je le ferai apartir d'aujourd'hui
 
@phpNoOb apart ca, everything allright ?
 
Anonymous
11:57 PM
Oui, all is good
 
Aight !
 

« first day (896 days earlier)      last day (4046 days later) »