5
c3r38r170
36d

Doesn't it happen to you that you examine too much stock code photos?
"'new Mail()'? Now I want to know what library that is."
(It was just an example, it is probably just a masked PHPMailer)

Comments
  • 3
    Yup, and it's so often PHP
  • 10
    No, but that's only because I have so little respect for "tech journalism" that I can be bothered to pay attention.
  • 1
    it... totally says php at the top, too
  • 2
    Hehe I wrote a java thingy for that.
    It was fun.
  • 4
    It's always php because of the cryptic syntax, it seems more code-ey
  • 5
    $_POST... !=

    *me heats up the iron frying pan*

    It's spanking time....
  • 4
    @IntrusionCM
    "Some tribal knowledge from another system makes this check necessary."

    I can't believe anyone enjoys that language. Just the sheer verbosity of what should be a Mailer(Strategy)(Record) slays me. Java or C# that whole expression would just be a builder or deconstruction pattern.
  • 1
    @SortOfTested

    Fluent Interfaces are no problem at all...

    The thing that really pisses me off - and this is true for any language - that you should _never_ take input from a request and stuff it in "somewhere".

    If done properly... That would be an DTO.

    And that DTO would be passed to an service.

    And that service would _exactly_ like you said use an pattern to send the mail via the _internal_ mailing library, which is completely hidden for the user of the service.

    I really want to spank people with hot frying iron pans who take this as an screenshot because it's so utter poor garbage code that shouldn't even exist.

    🤬🤬🤬🤬🤬🤬🤬🤬🤬🤬
  • 0
    @IntrusionCM
    It's not fluent though, it's
    Declare object;
    Mutate;
    Mutate;
    Mutate;
    Mutate;
    Mutate;
    Do;
  • 0
    @SortOfTested yes.

    I'm aware of that. And that's exactly why I hate this code. XD

    I think we mean the same thing.

    For me, the above code is utterly broken garbage which shouldn't exist.

    I meant that you could use fluent interfaces ____if done properly_____
Add Comment