• (disco) in reply to Protoman
    Protoman:
    What's the correct Hungarian notation for a variable of type

    It starts with a typedef. Though I admit, it's often a tossup as to whether my laziness over going and making the typedef or my laziness over typingcopying all that cruft wins for any given thing.

  • (disco) in reply to Jaloopa
    Jaloopa:
    Dave

    Dave's not here.

  • (disco) in reply to Eldelshell
    Eldelshell:
    the single most used character in HTML: ">"

    The single most used character in HTML is probably " ".

  • (disco) in reply to boomzilla

    IQFTW

    http://www.cannabisculture.com/files/images/Screen%20shot%202011-03-15%20at%206.04.11%20AM.preview.png

  • (disco) in reply to Eldelshell
    Eldelshell:
    And this should give you a hint of why PHP is such a WTF language. You would think that a C-like language born to be embedded into HTML code would have used something different than the single most used character in HTML: ">"

    Why does that matter? If it's inside PHP tags (<?php ... ?>) then it isn't rendered as HTML, and if it's not inside PHP tags, then it isn't parsed as PHP.

    Eldelshell:
    Also, it's a C-like language and it borrows basically everything else from C but not for member operators, because it's so much better to type <kbd>.</kbd> than <kbd>- + Shift + ></kbd>

    That's because when you're working with objects in C++, you're much more likely to see -> than you are ..

    Eldelshell:
    I just hate reading/writing PHP code because of this, specially if it's embedded in HTML where it's almost impossible without syntax highlight.

    Embedding PHP code in the middle of HTML has been TRWTF for at least 10 years now. These days, there are plenty of template engines to choose from.

  • (disco) in reply to PleegWat
    PleegWat:
    That's actually `->` in PHP. Though indeed there would be no ambiguity, as the right-hand operator would be a completely different token type.

    Except for static methods, which use ::

    As for . as concatenation operator, they clearly borrowed that from Perl. What's strange is that they didn't copy perl's separation of comparison operators. Specifically, perl uses == and != for number types, but eq and ne for strings, (same for less than, greater than, etc...)

  • (disco) in reply to Dragnslcr
    Dragnslcr:
    That's because when you're working with objects in C++, you're much more likely to see `->` than you are `.`.

    I'd say it's the other way around, at least whenever I have any say in the matter ;)

    Filed under: raw pointers are a health hazard

  • (disco) in reply to Dragnslcr
    Dragnslcr:
    Embedding PHP code in the middle of HTML has been TRWTF for at least 10 years now.

    Which is exactly what gave PHP the popularity it got against Perl, because Perl didn't allow you to do that, all whiners that thought Perl was "hard" jumped to the PHP wagon and started embedding all code inside their HTML code until everything blew in their faces.

  • (disco) in reply to boomzilla
    boomzilla:
    Dave's not here.

    Wrong. Dave is the only one here.

    [image]
  • (disco) in reply to Onyx

    Everybody's dead, Dave

  • (disco) in reply to Eldelshell
    Eldelshell:
    Which is exactly what gave PHP the popularity it got against Perl

    Nono, it was because PHP actually managed to get version 6 out while PERL didn't!

    Wait...

  • (disco) in reply to Onyx

    http://play.golang.org/p/92yRRL_lTd

  • (disco) in reply to ben_lubar

    /me nods while slowly backing off and looking for his bazookid...

  • (disco) in reply to RaceProUK
    RaceProUK:
    if it wasn't for & being bitwise-or.

    WHAT?

    PHP is wronger than I thought.

  • (disco) in reply to ben_lubar
    ben_lubar:
    RaceProUK:
    if it wasn't for & being bitwise-or.
    WHAT?
    I- wait…
    RaceProUK:
    if it wasn't for & being bitwise-**or**.
    [image]
  • (disco) in reply to Protoman
    Protoman:
    `std::unordered_map<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>>, std::vector<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t>>, std::allocator<wchar_t>>>`

    You dare to call that long?

    I've been writing some simple templated code. It features a class template with 12 parameters. The first of them is a concept for which default implementation has 7 more arguments. Two of them are "selectors" that have associated type templates, because otherwise composing correct types would be almost impossible. And then there are more that are normally pseudo-structs constructed from templates. And then my class takes some more templates that extract things from those pseudo-structs and a bunch of functors that have to be generic because spelling out the types is no longer really possible…

    Eldelshell:
    Also, it's a C-like language and it borrows basically everything else from C but not for member operators, because it's so much better to type . than - + Shift + >

    It does borrow -> straight from C via Perl. C has two member operators. . to access member of value and -> to access member of reference (pointer). Since in Perl and PHP everything is a reference, it uses the corresponding operator.

    powerlord:
    What's strange is that they didn't copy perl's separation of comparison operators.

    That's because they only copied the bad parts of perl.

    Eldelshell:
    because Perl didn't allow you to do that

    Except when it does. It does not come with the language itself though.

    ben_lubar:
    http://play.golang.org/p/92yRRL_lTd

    WHAAAAAAT? How on Universe.MilkyWay.SolSystem.Earth does that disambiguate the overloaded calls when the variadic arguments to fmt.Println are declared with the same “anything” type?

  • (disco) in reply to Bulb
    Bulb:
    WHAAAAAAT? How on Universe.MilkyWay.SolSystem.Earth does that disambiguate the overloaded calls when the variadic arguments to fmt.Println are declared with the same “anything” type?

    Return type is the only thing that makes sense.

    I'm going to buttume fmt.Println expects strings as arguments and it's calling the function with the corrensponding return type.

    Which is kinda cool.

    Meanwhile, I can't even do proper overloading here... Yes, PHP, TRWTF...

  • (disco) in reply to Eldelshell
    Eldelshell:
    You would think that a C-like language born to be embedded into HTML code would have used something different than the single most used character in HTML: ">"

    "<" would be used just as much as ">". So ">" isn't the "single" most used character.

  • (disco) in reply to Onyx
    Onyx:
    Return type is the only thing that makes sense.

    I'm going to buttume fmt.Println expects strings as arguments and it's calling the function with the corrensponding return type.

    No - it expects interface {}, to which anything is convertible. So it should accept any type. Worse, what it actually does is that it calls the string overload the first time and the integer overload the second. For the same calls and with the same argument type…

    Onyx:
    Which is kinda cool.

    No, it's a :wtf:.

  • (disco) in reply to FrostCat
    FrostCat:
    The single most used character in HTML is probably " ".

    I thought it was h, t, m, and l in equal measure...

    :rimshot:

  • (disco) in reply to PJH
    PJH:
    I thought it was `h`, `t`, `m`, and `l` in equal measure...

    :rimshot:

    I guess you haven't noticed the hundreds of thousands of webpages with missing <html> tags.

  • (disco) in reply to Zacrath
    Zacrath:
    I guess you haven't noticed the hundreds of thousands of webpages with missing <html> tags.

    What's that got to do with what I said?

  • (disco) in reply to Bulb
    Bulb:
    No - it expects interface {}, to which anything is convertible.

    Ah, I didn't know that bit. I don't Go.

    Bulb:
    No, it's a :wtf:.

    Given that additional info: yes.

  • (disco) in reply to PJH
    PJH:
    What's that got to do with what I said?

    Ah, seems I completely missed the joke. I get it now though.

  • (disco) in reply to PJH

    >_< <!-- body is quite descriptive, you twit software -->

  • (disco)

    It's like you guys don't know the difference between a and а...

  • (disco) in reply to ben_lubar

    I understand that a is one argument and a... is a list of arguments. But the arguments in the list are still all expected to have the same type of interface {}, no? Or is there some nuance I am missing? Because I still don't see why it should deduce it wants string for the first argument and int for the third.

  • (disco) in reply to ben_lubar
    ben_lubar:
    It's like you guys don't know the difference between a and а...

    Cyrillic font bullshit again? This is why code should be ASCII only

  • (disco) in reply to Bulb

    interface{} is "an interface representing any type with a method set that is a superset of ∅", AKA any type. Also, a and а are what I was comparing.

  • Mr. OMBE (unregistered)

    Any PHP coder who writes:

    echo $foo; die();

    --- obviously doesn't have enough to time think clearly, when "exit($foo);" would serve. Using the stdClass? He's obviously never heard of DRY principles either ... all those in_array() checks could easily be made into one method/function with a proper data structure fed into it.

Leave a comment on “Are You Down With PHP?”

Log In or post as a guest

Replying to comment #:

« Return to Article