- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
It starts with a
typedef
. Though I admit, it's often a tossup as to whether my laziness over going and making thetypedef
or my laziness overtypingcopying all that cruft wins for any given thing.Admin
Dave's not here.
Admin
The single most used character in HTML is probably " ".
Admin
IQFTW
http://www.cannabisculture.com/files/images/Screen%20shot%202011-03-15%20at%206.04.11%20AM.preview.png
Admin
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.
That's because when you're working with objects in C++, you're much more likely to see
->
than you are.
.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.
Admin
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, buteq
andne
for strings, (same for less than, greater than, etc...)Admin
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
Admin
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.
Admin
Wrong. Dave is the only one here.
[image]Admin
Everybody's dead, Dave
Admin
Nono, it was because PHP actually managed to get version 6 out while PERL didn't!
Wait...
Admin
http://play.golang.org/p/92yRRL_lTd
Admin
/me nods while slowly backing off and looking for his bazookid...
Admin
WHAT?
PHP is wronger than I thought.
Admin
Admin
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…
It does borrow
->
straightfrom 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.That's because they only copied the bad parts of perl.
Except when it does. It does not come with the language itself though.
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?
Admin
Return type is the only thing that makes sense.
I'm going to buttume
fmt.Println
expectsstring
s 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...
Admin
"<" would be used just as much as ">". So ">" isn't the "single" most used character.
Admin
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…No, it's a :wtf:.
Admin
I thought it was
h
,t
,m
, andl
in equal measure...:rimshot:
Admin
I guess you haven't noticed the hundreds of thousands of webpages with missing <html> tags.
Admin
What's that got to do with what I said?
Admin
Ah, I didn't know that bit. I don't Go.
Given that additional info: yes.
Admin
Ah, seems I completely missed the joke. I get it now though.
Admin
>_<
<!-- body is quite descriptive, you twit software -->Admin
It's like you guys don't know the difference between a and а...
Admin
I understand that
a
is one argument anda...
is a list of arguments. But the arguments in the list are still all expected to have the same type ofinterface {}
, no? Or is there some nuance I am missing? Because I still don't see why it should deduce it wantsstring
for the first argument andint
for the third.Admin
Cyrillic font bullshit again? This is why code should be ASCII only
Admin
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.Admin
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.